This is the mail archive of the mailing list for the GCC 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]

Re: [PATCH] ARM: Use different linker path for hardfloat ABI

On 3 April 2012 09:06, dann frazier <> wrote:
> On Fri, Mar 30, 2012 at 06:52:34PM +0100, Richard Earnshaw wrote:
>> On 29/03/12 20:34, dann frazier wrote:
>> > This is an updated version of a patch Debian and Ubuntu are using to
>> > use an alternate linker path for hardfloat binaries. The difference
>> > with this one is that it covers the case where no float flag
>> > was passed in, defaulting to the softfloat path.

Hi Dann.  The change should be in the EABI specific linux-eabi.h
instead of the shared/OABI linux-elf.h.  It breaks support for uClibc
and Bionic by always using the GLIBC loader in hard float mode.  The
final line in the spec is missing a '=hard' and always adds

How about:

2012-04-03  Michael Hope  <>

       * config/arm/linux-eabi.h (GLIBC_DYNAMIC_LINKER_HARD_FLOAT): Define.
       (GLIBC_DYNAMIC_LINKER): Redefine to use the hard float loader.

diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
index 80bd825..8498472 100644
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -62,7 +62,12 @@
 /* Use so that it will be possible to run "classic"
    GNU/Linux binaries on an EABI system.  */
-#define GLIBC_DYNAMIC_LINKER "/lib/"
+   "%{mhard-float:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \
+    %{mfloat-abi=hard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \
+    %{!mfloat-abi=hard:%{!mhard-float:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "}}"

 /* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
    use the GNU/Linux version, not the generic BPABI version.  */

which works for the following test cases:
 gcc -mhard-float foo.c => /lib/arm-linux-gnueabihf/
 gcc -mfloat-abi=hard foo.c => /lib/arm-linux-gnueabihf/
 gcc -msoft-float foo.c => /lib/
 gcc -mfloat-abi=softfp foo.c => /lib/
 gcc -mbionic => /system/bin/linker
 gcc -mbionic -mhard-float => /system/bin/linker
 gcc -muclibc => /lib/
 gcc -muclibc -mhard-float => /lib/

-- Michael

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