Patchwork ARM: Use different linker path for hardfloat ABI

login
register
mail settings
Submitter dann frazier
Date March 29, 2012, 7:34 p.m.
Message ID <20120329193401.GA14860@dannf.org>
Download mbox | patch
Permalink /patch/149465/
State New
Headers show

Comments

dann frazier - March 29, 2012, 7:34 p.m.
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.

2012-03-29  dann frazier <dann.frazier@canonical.com>

	* config/arm/linux-elf.h: Use alternate linker path
          for hardfloat ABI
Richard Earnshaw - March 30, 2012, 5:52 p.m.
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.
> 
> 2012-03-29  dann frazier <dann.frazier@canonical.com>
> 
> 	* config/arm/linux-elf.h: Use alternate linker path
>           for hardfloat ABI
> 
> Index: gcc/config/arm/linux-elf.h
> ===================================================================
> --- gcc/config/arm/linux-elf.h	(revision 185708)
> +++ gcc/config/arm/linux-elf.h	(working copy)
> @@ -59,14 +59,21 @@
>  
>  #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
>  
> -#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
> +#define LINUX_DYNAMIC_LINKER_SF "/lib/ld-linux.so.3"
> +#define LINUX_DYNAMIC_LINKER_HF "/lib/arm-linux-gnueabihf/ld-linux.so.3"
>  
>  #define LINUX_TARGET_LINK_SPEC  "%{h*} \
>     %{static:-Bstatic} \
>     %{shared:-shared} \
>     %{symbolic:-Bsymbolic} \
>     %{rdynamic:-export-dynamic} \
> -   -dynamic-linker " GNU_USER_DYNAMIC_LINKER " \
> +   %{msoft-float:-dynamic-linker " LINUX_DYNAMIC_LINKER_SF "} \
> +   %{mfloat-abi=soft*:-dynamic-linker " LINUX_DYNAMIC_LINKER_SF "} \
> +   %{mhard-float:-dynamic-linker " LINUX_DYNAMIC_LINKER_HF "} \
> +   %{mfloat-abi=hard:-dynamic-linker " LINUX_DYNAMIC_LINKER_HF "} \
> +   %{!mfloat-abi: \
> +     %{!msoft-float: \
> +       %{!mhard-float:-dynamic-linker " LINUX_DYNAMIC_LINKER_SF "}}} \
>     -X \
>     %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
>     SUBTARGET_EXTRA_LINK_SPEC
> 

Looks to me as though this will break the old Linux ABI.  While we've
marked that as deprecated, it hasn't been removed as yet.  So I think
this patch either needs to wait until that removal has taken place, or
provide the relevant updates to maintain the old ABI support.

R.

Patch

Index: gcc/config/arm/linux-elf.h
===================================================================
--- gcc/config/arm/linux-elf.h	(revision 185708)
+++ gcc/config/arm/linux-elf.h	(working copy)
@@ -59,14 +59,21 @@ 
 
 #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
 
-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define LINUX_DYNAMIC_LINKER_SF "/lib/ld-linux.so.3"
+#define LINUX_DYNAMIC_LINKER_HF "/lib/arm-linux-gnueabihf/ld-linux.so.3"
 
 #define LINUX_TARGET_LINK_SPEC  "%{h*} \
    %{static:-Bstatic} \
    %{shared:-shared} \
    %{symbolic:-Bsymbolic} \
    %{rdynamic:-export-dynamic} \
-   -dynamic-linker " GNU_USER_DYNAMIC_LINKER " \
+   %{msoft-float:-dynamic-linker " LINUX_DYNAMIC_LINKER_SF "} \
+   %{mfloat-abi=soft*:-dynamic-linker " LINUX_DYNAMIC_LINKER_SF "} \
+   %{mhard-float:-dynamic-linker " LINUX_DYNAMIC_LINKER_HF "} \
+   %{mfloat-abi=hard:-dynamic-linker " LINUX_DYNAMIC_LINKER_HF "} \
+   %{!mfloat-abi: \
+     %{!msoft-float: \
+       %{!mhard-float:-dynamic-linker " LINUX_DYNAMIC_LINKER_SF "}}} \
    -X \
    %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
    SUBTARGET_EXTRA_LINK_SPEC