From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26734 invoked by alias); 26 Apr 2012 20:21:13 -0000 Received: (qmail 26720 invoked by uid 22791); 26 Apr 2012 20:21:11 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-pz0-f54.google.com (HELO mail-pz0-f54.google.com) (209.85.210.54) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Apr 2012 20:20:33 +0000 Received: by dady13 with SMTP id y13so10440dad.13 for ; Thu, 26 Apr 2012 13:20:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.238.164 with SMTP id vl4mr125773pbc.37.1335471632824; Thu, 26 Apr 2012 13:20:32 -0700 (PDT) Received: by 10.68.48.8 with HTTP; Thu, 26 Apr 2012 13:20:32 -0700 (PDT) In-Reply-To: References: <4F9576DE.9070608@arm.com> Date: Thu, 26 Apr 2012 20:21:00 -0000 Message-ID: Subject: Re: [PATCH v2] ARM: Use different linker path for hardfloat ABI From: "Carlos O'Donell" To: Michael Hope Cc: Richard Earnshaw , GCC Patches , "cross-distro@lists.linaro.org" , "libc-ports@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-04/txt/msg00170.txt.bz2 On Mon, Apr 23, 2012 at 5:36 PM, Michael Hope wro= te: > 2012-04-24 =A0Michael Hope =A0 > =A0 =A0 =A0 =A0 =A0 =A0Richard Earnshaw =A0 > > =A0 =A0 =A0 =A0* config/arm/linux-eabi.h (GLIBC_DYNAMIC_LINKER_SOFT_FLOAT= ): Define. > =A0 =A0 =A0 =A0(GLIBC_DYNAMIC_LINKER_HARD_FLOAT): Define. > =A0 =A0 =A0 =A0(GLIBC_DYNAMIC_LINKER_DEFAULT): Define. > =A0 =A0 =A0 =A0(GLIBC_DYNAMIC_LINKER): Redefine to use the hard float pat= h. > > diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h > index 80bd825..2ace6f0 100644 > --- a/gcc/config/arm/linux-eabi.h > +++ b/gcc/config/arm/linux-eabi.h > @@ -62,7 +62,17 @@ > =A0/* Use ld-linux.so.3 so that it will be possible to run "classic" > =A0 =A0GNU/Linux binaries on an EABI system. =A0*/ > =A0#undef =A0GLIBC_DYNAMIC_LINKER > -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" > +#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3" > +#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3" > +#if TARGET_DEFAULT_FLOAT_ABI =3D=3D ARM_FLOAT_ABI_HARD > +#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_HARD_FLOAT > +#else > +#define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT > +#endif > +#define GLIBC_DYNAMIC_LINKER \ > + =A0 "%{mfloat-abi=3Dhard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \ > + =A0 =A0%{mfloat-abi=3Dsoft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ > + =A0 =A0%{!mfloat-abi=3D*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" > > =A0/* At this point, bpabi.h will have clobbered LINK_SPEC. =A0We want to > =A0 =A0use the GNU/Linux version, not the generic BPABI version. =A0*/ This patch is broken. Please fix this. You can't use a named enumeration in cpp equality. The type ARM_FLOAT_ABI_HARD is a named enumeration and evaluates to 0 as an unknown identifier. Therefore "#if TARGET_DEFAULT_FLOAT_ABI =3D=3D ARM_FLOAT_ABI_HARD" evaluates to "#if 0 =3D=3D 0" and is always true. Watch out that "#define ARM_FLOAT_ABI_HARD ARM_FLOAT_ABI_HARD" for such enums is not conforming C99/C11. I suggest you define the types as macros and then set the named enum to those values, then use the macros in the header equality checks. e.g. #define VAL1 0 then enum FOO { RVAL1 =3D VAL1, ... } Look at arm.h for the enum definition. Cheers, Carlos.