path: root/toolchain/toolchain-external
diff options
authorGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2018-07-04 23:42:57 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2018-08-21 22:11:51 +0200
commitd67cebcda0edb4ed598c0ed800d0425c4ae14c02 (patch)
treeb233ab8467c10d64970c7fe9dc064135b290d51e /toolchain/toolchain-external
parentb1db9038ddaf89c4abf69e17993eb13646da7e8d (diff)
toolchain: improve musl check to support static toolchains
The check_musl function currently builds a program and verifies if the program interpreter starts with /lib/ld-musl. While this works fine for dynamically linked programs, this obviously doesn't work for a purely static musl toolchain such as [1]. There is no easy way to identify a toolchain as using the musl C library. For glibc, dynamic linking is always supported, so we look at the dynamic linker name. For uClibc, there is a distinctive uClibc_config.h header file. There is no such distinctive feature in musl. We end up resorting to looking for the string MUSL_LOCPATH, which is used by musl locale_map.c source file. This string has been present in musl since 2014. It certainly isn't a very stable or convincing solution to identify the C library as being musl, but it's the best we could find. Note that we are sure there is a libc.a file, because the check_unusable_toolchain function checks that there is a such a file. [1] http://autobuild.buildroot.net/toolchains/tarballs/br-arm-musl-static-2018.05.tar.bz2 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Diffstat (limited to 'toolchain/toolchain-external')
1 files changed, 1 insertions, 2 deletions
diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk
index 8b2c283654..02d992531d 100644
--- a/toolchain/toolchain-external/pkg-toolchain-external.mk
+++ b/toolchain/toolchain-external/pkg-toolchain-external.mk
@@ -557,8 +557,7 @@ define $(2)_CONFIGURE_CMDS
$$(call check_uclibc,$$$${SYSROOT_DIR}) ; \
elif test "$$(BR2_TOOLCHAIN_EXTERNAL_MUSL)" = "y" ; then \
$$(call check_musl,\
else \
$$(call check_glibc,$$$${SYSROOT_DIR}) ; \