buildroot/toolchain
Thomas Petazzoni d67cebcda0 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>
2018-08-21 22:11:51 +02:00
..
toolchain pkg-cmake: install CMake files as part of a package 2018-03-25 17:35:26 +02:00
toolchain-buildroot toolchain/buildroot: fix default of C library choice 2018-05-13 22:09:34 +02:00
toolchain-external toolchain: improve musl check to support static toolchains 2018-08-21 22:11:51 +02:00
Config.in toolchain: add BR2_TOOLCHAIN_SUPPORTS_ALWAYS_LOCKFREE_ATOMIC_INTS hidden option 2018-08-18 14:32:07 +02:00
helpers.mk toolchain: improve musl check to support static toolchains 2018-08-21 22:11:51 +02:00
toolchain-wrapper.c toolchain-wrapper: use -ffp-contract=off on MIPS Xburst for gcc >= 4.6 2018-04-01 16:23:33 +02:00
toolchain-wrapper.mk toolchain-wrapper: use -ffp-contract=off on MIPS Xburst for gcc >= 4.6 2018-04-01 16:23:33 +02:00
toolchain.mk toolchain/toolchain.mk: fix code style 2018-04-01 08:47:18 +02:00