public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Hope <michael.hope@linaro.org>
To: dann frazier <dann.frazier@canonical.com>
Cc: Richard Earnshaw <rearnsha@arm.com>,
		"cross-distro@lists.linaro.org" <cross-distro@lists.linaro.org>,
		"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] ARM: Use different linker path for hardfloat ABI
Date: Tue, 03 Apr 2012 03:29:00 -0000	[thread overview]
Message-ID: <CANLjY-nk7ML5QMBd0bKRJBA9stUOdvu1tWZqmFHxpRzObzFw1Q@mail.gmail.com> (raw)
In-Reply-To: <20120402210653.GC28152@dannf.org>

On 3 April 2012 09:06, dann frazier <dann.frazier@canonical.com> 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
/lib/ld-linux.so.3.

How about:

2012-04-03  Michael Hope  <michael.hope@linaro.org>

       * 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 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 \
+   "%{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/ld-linux.so.3
 gcc -mfloat-abi=hard foo.c => /lib/arm-linux-gnueabihf/ld-linux.so.3
 gcc -msoft-float foo.c => /lib/ld-linux.so.3
 gcc -mfloat-abi=softfp foo.c => /lib/ld-linux.so.3
 gcc -mbionic => /system/bin/linker
 gcc -mbionic -mhard-float => /system/bin/linker
 gcc -muclibc => /lib/ld-uClibc.so.0
 gcc -muclibc -mhard-float => /lib/ld-uClibc.so.0

-- Michael

  reply	other threads:[~2012-04-03  3:29 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29 19:34 dann frazier
2012-03-30 17:52 ` Richard Earnshaw
2012-04-02 21:07   ` dann frazier
2012-04-03  3:29     ` Michael Hope [this message]
2012-04-03 14:31       ` dann frazier
2012-04-03 22:56       ` Joseph S. Myers
2012-04-04  2:40         ` Michael Hope
2012-04-04  9:06           ` Joseph S. Myers
2012-04-04 12:10             ` Dennis Gilmore
2012-04-05 13:30               ` Konstantinos Margaritis
2012-04-05 14:13                 ` Niels de Vos
2012-04-05 15:09                 ` Mike Frysinger
2012-04-05 15:24                   ` Konstantinos Margaritis
2012-04-05 15:55                     ` Mike Frysinger
2012-04-05 16:25                       ` Konstantinos Margaritis
2012-04-10  4:10                         ` Mike Frysinger
2012-04-05 16:16                   ` Steve McIntyre
2012-04-05 17:36                     ` Mike Frysinger
2012-04-04 23:33             ` Michael Hope
2012-04-05  0:07               ` Joseph S. Myers
2012-04-05  1:17                 ` Michael Hope
2012-04-05 16:05                   ` Steve McIntyre
2012-04-05 16:03               ` Steve McIntyre
2012-04-05  1:32           ` dann frazier
2012-04-05 14:57         ` Steve McIntyre
2012-04-10 20:31         ` Carlos O'Donell
2012-04-03  9:29     ` Andrew Haley
2012-04-03 10:46       ` Richard Earnshaw
2012-04-03 10:51         ` Richard Guenther
2012-04-03 10:55           ` Richard Earnshaw
2012-04-04  8:59             ` Andrew Haley
2012-04-03 11:02         ` Jakub Jelinek
2012-04-03 16:10           ` Richard Earnshaw
2012-04-03 16:18             ` Andrew Haley
2012-04-03 21:19               ` Michael Hope
2012-04-03 23:12                 ` Jakub Jelinek
2012-04-03 23:49                   ` Michael Hope
2012-04-04  0:00                     ` Peter Robinson
2012-04-04  0:56                     ` Paulo César Pereira de Andrade
2012-04-04  1:35                       ` Michael Hope
2012-04-04  6:54                         ` Jakub Jelinek
2012-04-04  9:16                           ` Joseph S. Myers
2012-04-04 22:51                           ` Michael Hope
2012-04-09 20:48                             ` Adam Conrad
2012-04-09 23:14                               ` Mike Frysinger
2012-04-09 23:31                                 ` Adam Conrad
2012-04-10  4:01                                   ` Mike Frysinger
2012-04-10  5:17                                     ` Adam Conrad
2012-04-10  5:36                                       ` Jakub Jelinek
2012-04-10  9:19                                         ` Konstantinos Margaritis
2012-04-10 14:35                                           ` Dennis Gilmore
2012-04-10 15:14                                             ` Konstantinos Margaritis
2012-04-10 15:39                                             ` Steve McIntyre
2012-04-11 12:06                                               ` Jeff Law
2012-04-10  6:17                                       ` Jeff Law
2012-04-10 16:47                                         ` Michael Edwards
2012-04-11  3:15                                           ` Mike Frysinger
2012-04-11 17:22                                             ` Michael K. Edwards
2012-04-11  3:08                                       ` Mike Frysinger
2012-04-10  4:17                                 ` Jeff Law
2012-04-10  4:43                                   ` Mike Frysinger
2012-04-10  5:26                               ` Paulo César Pereira de Andrade
2012-04-05 13:34                           ` Dennis Gilmore
2012-04-11 10:55                             ` Richard Earnshaw
2012-04-05 14:39                         ` Steve McIntyre
2012-04-05 15:09                           ` Mike Frysinger
2012-04-05 15:38                             ` Paulo César Pereira de Andrade
2012-04-05 14:33                   ` Steve McIntyre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANLjY-nk7ML5QMBd0bKRJBA9stUOdvu1tWZqmFHxpRzObzFw1Q@mail.gmail.com \
    --to=michael.hope@linaro.org \
    --cc=cross-distro@lists.linaro.org \
    --cc=dann.frazier@canonical.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rearnsha@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).