This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v2, 1/2] glibc-ports: Use /lib/ld-linux-armhf.so.3 as the dynamic linker for the ARM hard-float ABI.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]