Skip to contentSkip to conversation

toolchain-external: dynamic loader symlink to actual location of musl libc.so

PATCH New Ilya Kuzmich 2 participants 3 messages May 18, 2017 – Jul 2, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toolchain-external: dynamic loader symlink to actual location of musl libc.so

Test whenever musl libc.so located at /lib or /usr/lib and create dynamic library loader symlink accordingly.

---
 toolchain/toolchain-external/pkg-toolchain-external.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
toolchain/toolchain-external/pkg-toolchain-external.mk +6 -1
index 9670350..438d714 100644
@@ -489,7 +489,12 @@ else
 MUSL_ARCH = $(ARCH)
 endif
 define TOOLCHAIN_EXTERNAL_MUSL_LD_LINK
-	ln -sf libc.so $(TARGET_DIR)/lib/ld-musl-$(MUSL_ARCH).so.1
+	if test -e $(STAGING_DIR)/usr/lib/libc.so; then \
+		LD_LINK_TARGET=../usr/lib/libc.so ;\
+	else \
+	    LD_LINK_TARGET=libc.so ;\
+	fi ;\
+	ln -sf "$${LD_LINK_TARGET}" $(TARGET_DIR)/lib/ld-musl-$(MUSL_ARCH).so.1 ;
 endef
 endif
 
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 toolchain-external: dynamic loader symlink to actual location of musl libc.so

ping?

Quoted 29 lines · Ilya Kuzmich

Test whenever musl libc.so located at /lib or /usr/lib and create dynamic library loader symlink accordingly.

---
 toolchain/toolchain-external/pkg-toolchain-external.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
toolchain/toolchain-external/pkg-toolchain-external.mk +6 -1
index 9670350..438d714 100644
@@ -489,7 +489,12 @@ else
 MUSL_ARCH = $(ARCH)
 endif
 define TOOLCHAIN_EXTERNAL_MUSL_LD_LINK
-	ln -sf libc.so $(TARGET_DIR)/lib/ld-musl-$(MUSL_ARCH).so.1
+	if test -e $(STAGING_DIR)/usr/lib/libc.so; then \
+		LD_LINK_TARGET=../usr/lib/libc.so ;\
+	else \
+	    LD_LINK_TARGET=libc.so ;\
+	fi ;\
+	ln -sf "$${LD_LINK_TARGET}" $(TARGET_DIR)/lib/ld-musl-$(MUSL_ARCH).so.1 ;
 endef
 endif
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/1 toolchain-external: dynamic loader symlink to actual location of musl libc.so

In reply to Ilya Kuzmich

Hello,

Quoted 4 lines · Ilya Kuzmich

Test whenever musl libc.so located at /lib or /usr/lib and create dynamic library loader symlink accordingly.

Thanks. However, after discussing this issue, we found that we could in fact entirely get rid of this TOOLCHAIN_EXTERNAL_MUSL_LD_LINK hook. See
https://patchwork.ozlabs.org/patch/783188/.

So I've marked your patch as "Superseded". Of course, my new proposal has been tested with a Crosstool-NG musl toolchain.

Best regards,

Thomas

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