From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22683 invoked by alias); 4 Apr 2012 02:40:38 -0000 Received: (qmail 22476 invoked by uid 22791); 4 Apr 2012 02:40:35 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_BH,TW_IB X-Spam-Check-By: sourceware.org Received: from mail-wi0-f177.google.com (HELO mail-wi0-f177.google.com) (209.85.212.177) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Apr 2012 02:40:20 +0000 Received: by wibhj13 with SMTP id hj13so76444wib.12 for ; Tue, 03 Apr 2012 19:40:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding:x-gm-message-state; bh=GYVJXPa2sqhmKwrwXp+mpDm8rF37fK7uDbiw3r1m33Q=; b=A370WFCEw9fRJf5+KZejjispyzRE/LIQIQVYyp4fLJ5uvgon/WtdT92LoBfKmFmnJm u6PyeqEbCcXabDfTca723WJsvZsvRNdRl33JdWww9L3aWxQSEfc94V3HsHNfisQObynw d0N8hkeznMKX9PSaZaZMMShkRPdqLR/sBm8PpZ0XOYhCyIsQX/LpHATYvFnzbWmvKQY9 Efukpb2SGbn+vBnuYt8Dtq0AabpZFxEqEmc4L552DGvAeMYECvq6JIq8wUVF8FPWjb3R 0Lk3r4M0wfVERvIwYPlizNLNNfQGs6rc1+rwOlEfuBeb88IYKNoLrIMEGqiILqOzoo5I Jiew== Received: by 10.180.81.37 with SMTP id w5mr1031988wix.16.1333507218748; Tue, 03 Apr 2012 19:40:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.7.206 with HTTP; Tue, 3 Apr 2012 19:39:58 -0700 (PDT) In-Reply-To: References: <20120329193401.GA14860@dannf.org> <4F75F2E2.3030909@arm.com> <20120402210653.GC28152@dannf.org> From: Michael Hope Date: Wed, 04 Apr 2012 02:40:00 -0000 Message-ID: Subject: Re: [PATCH] ARM: Use different linker path for hardfloat ABI To: "Joseph S. Myers" Cc: dann frazier , Richard Earnshaw , "cross-distro@lists.linaro.org" , "gcc-patches@gcc.gnu.org" , libc-ports@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQl9NdBY9eheY0RYyveZ2ew0ZPK/hLi500XWdHc60Rq46vP7TtTCaYFBK2eVrJOiV8j9qDMT 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/msg00001.txt.bz2 On 4 April 2012 10:56, Joseph S. Myers wrote: > On Tue, 3 Apr 2012, Michael Hope wrote: > >> +#define GLIBC_DYNAMIC_LINKER \ >> + =A0 "%{mhard-float:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \ >> + =A0 =A0%{mfloat-abi=3Dhard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \ >> + =A0 =A0%{!mfloat-abi=3Dhard:%{!mhard-float:" GLIBC_DYNAMIC_LINKER_SOFT= _FLOAT "}}" > > (a) -mhard-float is a .opt Alias for -mfloat-abi=3Dhard so does not need = to > be handled in specs. Fixed. > (b) You need to handle compilers configured with --with-float=3Dhard, so > make the specs depend on the default ABI the compiler was configured with. GCC seems to take configure time options into account when evaluating a spec file. Tested by building a default, --with-float=3Dhard, and --with-float=3Dsoftfp compiler then checking the loader path for all combinations of {,-mglibc,-mbionic,-muclibc} x {,-mhard-float,-msoft-float,-mfloat-abi=3Dhard,-mfloat-abi=3Dsoftfp}. > (c) Please include libc-ports on future submissions and provide both the > GCC patch and the glibc ports patch that have been tested to work together > to build and install the library in the given path; a patch to one > component like this cannot sensibly be considered in isolation. =A0I imag= ine > you'll need appropriate ARM preconfigure support to detect what ABI the > compiler is using, much like the support for MIPS, so that the right > shlib-versions files are used. Agreed. > =A0I try to follow all ARM glibc discussions > on libc-ports closely, as the ARM glibc maintainer; was there a previous > discussion of the dynamic linker naming issue there that I missed? Steve McIntyre is driving this inside Debian. I'll ping him on the GLIBC support. The tricky one is new GCC with old GLIBC. GCC may have to do a configure time test and fall back to /lib/ld-linux.so.3 if the hard float loader is missing. > =A0(The only previous relevant discussion that I recall is one on > patches@eglibc.org starting at > , regarding how the > dynamic linker should check that a library has the right ABI, and there > was no real followup on that after I indicated what would seem to be the > appropriate implementation approaches and places for subsequent > discussion.) The patch above changes the loader to catch a mixed installation and reject mixing incompatible libraries. The static linker does this currently but it's not essential. > I have no idea whether shlib-versions files naming a file in a > subdirectory will work - but if not, you'd need to send a patch to > libc-alpha to support dynamic linkers in subdirectories, with appropriate > justification for why you are doing something different from all other > architectures. Understood. For now this is just a path. There's more infrastructure work needed if the path includes a directory. > (d) Existing practice for Power Architecture and MIPS at least is that > hard-float and soft-float *don't* use different library directories / > dynamic linkers. The goal is to have a standard loader path for all hard float distros and, similar to how you can have a mixed 32/64 bit installation, allow mixed softfp/hard float installations for distros that want it. This is a new requirement and ARM is the first one exposed to it. I assume Debian would push for similar changes on MIPS and PowerPC. Do the MIPS or PowerPC loaders detect the ABI and change the library path based on that? I couldn't tell from the code. > (e) Existing practice for cases that do use different dynamic linkers is > to use a separate library directory, not just dynamic linker name, as in > lib32 and lib64 for MIPS or libx32 for x32; it's certainly a lot easier to > make two sets of libraries work in parallel if you have separate library > directories like that. Is this required, or should it be left to the distro to choose? Once the loader is in control then it can account for any distro specific features, which may be the standard /lib and /usr/lib for single ABI distros like Fedora or /usr/lib/$tuple for multiarch distros like Ubuntu and Debian. > So it would seem more appropriate to define a directory libhf for ARM (me= aning you need a binutils patch as well to > handle that directory, I think) I'd like to leave that discussion for now. The Debian goal is to support incompatible ABIs and, past that, incompatible architectures. libhf is ambiguous as you could have a MIPS hard float library installed on the same system as an ARM hard float library. > and these different Debian-style names > could be implemented separately in a multiarch patch if someone submits > one that properly accounts for my review comments on previous patch > versions (failure to produce such a fixed patch being why Debian multiarch > directory support has not got into GCC so far). Agreed. Note that this loader path discussion is unrelated to multiarch. It came from the same people so there's a family resemblance. (BTW Dann, apologies for stealing your patch) -- Michael 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 path. diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h index 80bd825..8c9d2e7 100644 --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -62,7 +62,11 @@ /* Use ld-linux.so.3 so that it will be possible to run "classic" GNU/Linux binaries on an EABI system. */ #undef GLIBC_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/arm-linux-gnueabihf/ld-linux.so.3" +#define GLIBC_DYNAMIC_LINKER \ + "%{mfloat-abi=3Dhard:" GLIBC_DYNAMIC_LINKER_HARD_FLOAT "} \ + %{!mfloat-abi=3Dhard:" 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. */