This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH v2, 1/2] glibc-ports: Use /lib/ld-linux-armhf.so.3 as thedynamic linker for the ARM hard-float ABI.
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: libc-ports at sourceware dot org, "Joseph S. Myers" <joseph at codesourcery dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 7 May 2012 14:56:22 -0400
- Subject: [PATCH v2, 1/2] glibc-ports: Use /lib/ld-linux-armhf.so.3 as thedynamic linker for the ARM hard-float ABI.
- References: <CADZpyiw9Sf+iZQSJRWpuuX0Eomewz98gaXFUU9YjFrPZ_V-BCQ@mail.gmail.com><m262c8ih7y.fsf@igel.home>
On Mon, May 7, 2012 at 3:27 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> "Carlos O'Donell" <carlos@systemhalted.org> writes:
>
>> +AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
>> + ?[libc_cv_arm_pcs_vfp],
>> + ?[archcppflag=`echo "" |
>> + ? ? ? $CC $CFLAGS $CPPFLAGS -E -dM - |
>> + ? ? ? grep __ARM_PCS_VFP |
>> + ? ? ? sed -e 's/^#define //' -e 's/ .*//'`
>
> Please use AC_EGREP_CPP.
Thanks. Patch updated.
With AC_EGREP_CPP in a default ARMv5TE build I get:
checking for grep that handles long lines and -e... (cached)
/usr/local/tools/gcc-4.3.3/bin/grep
checking for egrep... (cached) /usr/local/tools/gcc-4.3.3/bin/grep -E
checking whether the compiler is using the ARM hard-float ABI... no
With AC_EGREP_CPP in a ARMv7-A hard-float ABI build I get:
checking for grep that handles long lines and -e... (cached)
/usr/local/tools/gcc-4.3.3/bin/grep
checking for egrep... (cached) /usr/local/tools/gcc-4.3.3/bin/grep -E
checking whether the compiler is using the ARM hard-float ABI... yes
Everything works as expected.
v2 - Use AC_EGREP_CPP.
OK to commit?
2012-05-07 Carlos O'Donell <carlos_odonell@mentor.com>
* sysdeps/arm/configure.in: Set libc_cv_arm_pcs_vfp.
If libc_cv_arm_pcs_vfp equals yes then define HAVE_ARM_PCS_VFP.
* sysdeps/arm/configure: Regenerate.
* sysdeps/arm/shlib-versions: If HAVE_ARM_PCS_VFP is defined
then use ld=/lib/ld-linux-armhf.so.3.
diff --git a/sysdeps/arm/configure.in b/sysdeps/arm/configure.in
index 706add2..f00b798 100644
--- a/sysdeps/arm/configure.in
+++ b/sysdeps/arm/configure.in
@@ -49,3 +49,20 @@ EOF
if test $libc_cv_asm_cfi_directive_sections != yes; then
AC_MSG_ERROR([need .cfi_sections in this configuration])
fi
+
+# We check to see if the compiler and flags are
+# selecting the hard-float ABI and if they are then
+# we set libc_cv_arm_pcs_vfp to yes which causes
+# HAVE_ARM_PCS_VFP to be defined in config.h and
+# in include/libc-symbols.h and thus available to
+# shlib-versions to select the appropriate name for
+# the dynamic linker via %ifdef.
+AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
+ [libc_cv_arm_pcs_vfp],
+ [AC_EGREP_CPP(yes,[#ifdef __ARM_PCS_VFP
+ yes
+ #endif
+ ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
+if test $libc_cv_arm_pcs_vfp = yes; then
+ AC_DEFINE(HAVE_ARM_PCS_VFP)
+fi
diff --git a/sysdeps/arm/shlib-versions b/sysdeps/arm/shlib-versions
index 626d58b..ba88d95 100644
--- a/sysdeps/arm/shlib-versions
+++ b/sysdeps/arm/shlib-versions
@@ -1,3 +1,9 @@
arm.*-.*-linux-gnueabi.* DEFAULT GLIBC_2.4
-arm.*-.*-linux-gnueabi.* ld=ld-linux.so.3
+%ifdef HAVE_ARM_PCS_VFP
+# The EABI-derived hard-float ABI uses a new dynamic linker.
+arm.*-.*-linux-gnueabi.* ld=ld-linux-armhf.so.3
+%else
+# The EABI-derived soft-float ABI continues to use ld-linux.so.3.
+ arm.*-.*-linux-gnueabi.* ld=ld-linux.so.3
+%endif
===
Cheers,
Carlos.