Skip to contentSkip to conversation

gcc: fix dynamic linker path for mips soft-float

PATCH New Thomas Petazzoni 2 participants 2 messages Mar 8, 2016 – Mar 10, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gcc: fix dynamic linker path for mips soft-float

This commit updates the gcc musl patches for gcc 4.7, 4.8 and 4.9 so that the path to the dynamic linker encoded as "program interpreter" in the generated binaries actually matches the symbolic link installed by musl when building for mips soft-float.

Indeed, musl installs a symlink called ld-musl-mipsel-sf.so.1, but gcc currently generates binaries that use /lib/ld-musl-mips.so as program interpreter.

The fix is simply the one from
https://bitbucket.org/GregorR/musl-cross/commits/825219202365, i.e adjust MUSL_DYNAMIC_LINKER in our musl gcc patches.

Thanks to these patches:

$ ./host/usr/bin/mipsel-linux-readelf -a ./target/bin/busybox
[...]
      [Requesting program interpreter: /lib/ld-musl-mipsel-sf.so.1]
[...]

gcc 5.x doesn't need any fix because the musl patches already use the right value.

Fixes bug #7562.

---
 package/gcc/4.7.4/900-musl-support.patch | 2 +-
 package/gcc/4.8.5/900-musl-support.patch | 2 +-
 package/gcc/4.9.3/900-musl-support.patch | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
package/gcc/4.7.4/900-musl-support.patch +1 -1
index 67b8c30..bf8fbc0 100644
@@ -478,7 +478,7 @@ Index: b/gcc/config/mips/linux.h
 +#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
 +#endif
 +#undef MUSL_DYNAMIC_LINKER
-+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
 Index: b/gcc/config/rs6000/linux64.h
 ===================================================================
 --- a/gcc/config/rs6000/linux64.h
package/gcc/4.8.5/900-musl-support.patch +1 -1
index 6743a88..6840fcc 100644
@@ -332,7 +332,7 @@ Index: b/gcc/config/mips/linux.h
 +#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
 +#endif
 +#undef MUSL_DYNAMIC_LINKER
-+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
 Index: b/gcc/config/rs6000/linux64.h
 ===================================================================
 --- a/gcc/config/rs6000/linux64.h
package/gcc/4.9.3/900-musl-support.patch +1 -1
index a711b06..90f64de 100644
@@ -637,4 +637,4 @@ Index: b/gcc/config/mips/linux.h
 +#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
 +#endif
 +#undef MUSL_DYNAMIC_LINKER
-+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
Signature · 1 line
2.6.4
#1 lore raw

PATCH 1/1 gcc: fix dynamic linker path for mips soft-float

Quoted 22 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

This commit updates the gcc musl patches for gcc 4.7, 4.8 and 4.9 so that the path to the dynamic linker encoded as "program interpreter" in the generated binaries actually matches the symbolic link installed by musl when building for mips soft-float.

Indeed, musl installs a symlink called ld-musl-mipsel-sf.so.1, but gcc currently generates binaries that use /lib/ld-musl-mips.so as program interpreter.

The fix is simply the one from
https://bitbucket.org/GregorR/musl-cross/commits/825219202365, i.e adjust MUSL_DYNAMIC_LINKER in our musl gcc patches.

Thanks to these patches:

$ ./host/usr/bin/mipsel-linux-readelf -a ./target/bin/busybox
[...]
      [Requesting program interpreter: /lib/ld-musl-mipsel-sf.so.1]
[...]
Quoted 6 lines

gcc 5.x doesn't need any fix because the musl patches already use the right value.

Fixes bug #7562.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard