Skip to contentSkip to conversation

Fix musl-based builds on ARMhf platforms.

PATCH New Vicente Bergas 2 participants 2 messages Sep 27, 2015 – Sep 28, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix musl-based builds on ARMhf platforms.

When ARCH is arm and the hard-floating-point option is on executables expect to find the dynamic linker at /lib/ld-musl-armhf.so.1 and not /lib/ld-musl-arm.so.1
There are two ways of fixing this:
1) Changing the actual location of the dynamic linker.
2) Changing the expected location of the dynamic linker.
This patch uses option 1.
I don't know how to do option 2 and also don't know which option is better.

---
 toolchain/toolchain-external/toolchain-external.mk | 2 ++
 1 file changed, 2 insertions(+)
toolchain/toolchain-external/toolchain-external.mk +2 -0
index 61a5dba..79afdaa 100644
@@ -524,6 +524,8 @@ endef
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_MUSL),y)
 ifeq ($(BR2_i386),y)
 MUSL_ARCH = i386
+else ifeq ($(BR2_ARM_EABIHF),y)
+MUSL_ARCH = armhf
 else
 MUSL_ARCH = $(ARCH)
 endif
Signature · 1 line
2.5.3
#1 lore raw

PATCH 1/1 Fix musl-based builds on ARMhf platforms.

Dear Vicente Bergas,

Quoted 9 lines · Vicente Bergas

When ARCH is arm and the hard-floating-point option is on executables expect to find the dynamic linker at /lib/ld-musl-armhf.so.1 and not /lib/ld-musl-arm.so.1
There are two ways of fixing this:
1) Changing the actual location of the dynamic linker.
2) Changing the expected location of the dynamic linker.
This patch uses option 1.
I don't know how to do option 2 and also don't know which option is better.

Quoted 4 lines
---
 toolchain/toolchain-external/toolchain-external.mk | 2 ++
 1 file changed, 2 insertions(+)

I've slightly tweaked the commit log and applied. In fact your explanation about "two ways of fixing this" is not completely correct:
the dynamic linker in musl is part of the C library itself. So all what Buildroot is doing is create a symbolic link with the name of the dynamic linker encoded into the executables, which points to the musl C library. So all what your patch is doing is adjusting the logic that calculates the name of this symbolic link.

Thanks for this contribution!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com