This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [WIP] glibc: Use /lib/ld-linux-armhf.so.3 for ARM's -mfloat-abi=hard ABI.
- From: Khem Raj <raj dot khem at gmail dot com>
- To: libc-ports at sourceware dot org
- Date: Mon, 30 Apr 2012 21:47:52 -0700
- Subject: Re: [WIP] glibc: Use /lib/ld-linux-armhf.so.3 for ARM's -mfloat-abi=hard ABI.
- References: <4F886201.3040200@redhat.com> <4F886277.6000006@redhat.com> <20120413173512.5D52B2C074@topped-with-meat.com> <CADZpyiyr3d8VrBwp_WQyg1H_=w-8hyHw82Vck6U2kv49JtFxPg@mail.gmail.com> <4F9515D5.60804@redhat.com> <4F99B990.7020300@mentor.com> <Pine.LNX.4.64.1204262155510.30855@digraph.polyomino.org.uk>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/26/2012 03:03 PM, Joseph S. Myers wrote:
> On Thu, 26 Apr 2012, Carlos O'Donell wrote:
>
>> (b) Detect dynamic linker used by compiler.
>>
>> The following new configure test detects the dynamic linker used
>> by the compiler given the current set of options. We store the
>> result in libc_cv_compiler_dynlinker_default for later use in
>> ARM's preconfigure.
>
> This is far too complicated. GCC isn't detecting what dynamic
> linker glibc has, after all. We should simply test if the compiler
> predefines __ARM_PCS_VFP, which is easy to do in the ARM
> preconfigure.
>
>> I caught a couple of problems early and fixed them though, like
>> not using AC_MSG_ERROR for the configure failure cases because
>> you might be installing headers and not have a compiler capable
>> of compiling an application yet. This does imply that you *might*
>> not get the right set of headers if such headers changed
>> depending on the dynamic linker selected (which they shouldn't).
>>
>> Comments?
>
> It shouldn't (ideally) be necessary to configure glibc, or GCC,
> more than once when bootstrapping. See Roland's comments at
> <http://sourceware.org/ml/libc-alpha/2012-03/msg00960.html>. That
> means we don't want any configure tests that will give the wrong
> results in a bootstrap configuration (where you don't have a
> preexisting libc so can't link things using it) - where there are
> existing tests we should remove them, and we should avoid adding
> more.
>
> Testing preprocessor defines is safe. Linking without -nostdlib
> isn't safe in configure tests. While it looks like GCC will still
> pass the default -dynamic-linker option to ld when using -nostdlib,
> I don't think you should really rely on that either.
>
I have the following patch which is based on Carlos's work and
Joseph's suggestion
Thanks
- -Khem
glibc-2.15
2012-04-30 Carlos O'Donell <carlos_odonell@mentor.com>
Khem Raj <raj.khem@gmail.com>
* sysdeps/arm/preconfigure: Select armhf based on __ARM_PCS_VFP
compiler predefine.
* sysdeps/arm/eabi/armhf/shlib-versions: New file.
* sysdeps/arm/eabi/armhf/armv6t2/Implies: New file.
* sysdeps/arm/eabi/armhf/armv7/Implies: New file.
glibc-trunk
2012-04-30 Carlos O'Donell <carlos_odonell@mentor.com>
Khem Raj <raj.khem@gmail.com>
* sysdeps/arm/preconfigure: Select armhf based on __ARM_PCS_VFP
compiler predefine.
* sysdeps/arm/armhf/shlib-versions: New file.
* sysdeps/arm/armhf/armv6t2/Implies: New file.
* sysdeps/arm/armhf/armv7/Implies: New file.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk+favgACgkQuwUzVZGdMxSjrwCfZF3udfIe4OzFCewKRDTzcAdY
+FgAoI/k+zEZPxVquFoK62cSYTOqMK9j
=qJbN
-----END PGP SIGNATURE-----
Index: libc/ports/sysdeps/arm/eabi/armhf/armv6t2/Implies
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ libc/ports/sysdeps/arm/eabi/armhf/armv6t2/Implies 2012-04-30 20:27:01.788730633 -0700
@@ -0,0 +1 @@
+arm/eabi/armv6t2
Index: libc/ports/sysdeps/arm/eabi/armhf/armv7/Implies
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ libc/ports/sysdeps/arm/eabi/armhf/armv7/Implies 2012-04-30 20:26:37.332729450 -0700
@@ -0,0 +1 @@
+arm/eabi/armv7
Index: libc/ports/sysdeps/arm/eabi/armhf/shlib-versions
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ libc/ports/sysdeps/arm/eabi/armhf/shlib-versions 2012-04-30 20:28:01.764733536 -0700
@@ -0,0 +1,6 @@
+# As of 2.16 the -mfloat-abi=hard ABI variant has a new unique
+# name for the dynamic loader.
+arm.*-.*-linux-gnueabi.* DEFAULT GLIBC_2.4
+
+arm.*-.*-linux-gnueabi.* ld=ld-linux-armhf.so.3
+
Index: libc/ports/sysdeps/arm/preconfigure
===================================================================
--- libc.orig/ports/sysdeps/arm/preconfigure 2012-04-30 20:23:20.032719900 -0700
+++ libc/ports/sysdeps/arm/preconfigure 2012-04-30 20:24:34.948723526 -0700
@@ -35,6 +35,19 @@
;;
esac
+ archcppflag=`echo "" |
+ $CC $CFLAGS $CPPFLAGS -E -dM - |
+ grep __ARM_PCS_VFP |
+ sed -e 's/^#define //' -e 's/ .*//'`
+ case x$archcppflag in
+ x__ARM_PCS_VFP)
+ echo "Found compiler is configured for ARM hard-float ABI"
+ machine=armhf/$machine
+ ;;
+ *)
+ ;;
+ esac
+
machine=arm/eabi/$machine
if [ "${CFLAGS+set}" != "set" ]; then
CFLAGS="-g -O2"
Index: arm/armhf/armv7/Implies
===================================================================
--- arm/armhf/armv7/Implies (revision 0)
+++ arm/armhf/armv7/Implies (revision 0)
@@ -0,0 +1 @@
+arm/armv7
Index: arm/armhf/armv6t2/Implies
===================================================================
--- arm/armhf/armv6t2/Implies (revision 0)
+++ arm/armhf/armv6t2/Implies (revision 0)
@@ -0,0 +1 @@
+arm/armv6t2
Index: arm/armhf/shlib-versions
===================================================================
--- arm/armhf/shlib-versions (revision 0)
+++ arm/armhf/shlib-versions (revision 0)
@@ -0,0 +1,6 @@
+# As of 2.16 the -mfloat-abi=hard ABI variant has a new unique
+# name for the dynamic loader.
+arm.*-.*-linux-gnueabi.* DEFAULT GLIBC_2.4
+
+arm.*-.*-linux-gnueabi.* ld=ld-linux-armhf.so.3
+
Index: arm/preconfigure
===================================================================
--- arm/preconfigure (revision 18306)
+++ arm/preconfigure (working copy)
@@ -34,7 +34,18 @@
echo 2>&1 "arm/preconfigure: Did not find ARM architecture type; using default"
;;
esac
-
+ archcppflag=`echo "" |
+ $CC $CFLAGS $CPPFLAGS -E -dM - |
+ grep __ARM_PCS_VFP |
+ sed -e 's/^#define //' -e 's/ .*//'`
+ case x$archcppflag in
+ x__ARM_PCS_VFP)
+ echo "Found compiler is configured for ARM hard-float ABI"
+ machine=armhf/$machine
+ ;;
+ *)
+ ;;
+ esac
machine=arm/$machine
if [ "${CFLAGS+set}" != "set" ]; then
CFLAGS="-g -O2"