All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] toolchain-external: fix musl dynamic loader link
@ 2017-04-10 12:09 Ilya Kuzmich
  0 siblings, 0 replies; only message in thread
From: Ilya Kuzmich @ 2017-04-10 12:09 UTC (permalink / raw)
  To: buildroot

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

TOOLCHAIN_EXTERNAL_MUSL_LD_LINK @ pkg-toolchain-external.mk assumes that
there is a /lib/libc.so. This is not a case for ct-ng musl toolchain.
Ct-ng places libc.so at sysroot/usr/lib

Signed-off-by: Ilya Kuzmich <ilya.kuzmich@gmail.com>
---
 toolchain/toolchain-external/pkg-toolchain-external.mk | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index 9670350..438d714 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -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
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-10 12:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-10 12:09 [Buildroot] [PATCH 1/1] toolchain-external: fix musl dynamic loader link Ilya Kuzmich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.