mirror of
https://github.com/fluencelabs/musl
synced 2025-04-25 07:12:15 +00:00
build: fix musl-targeting toolchain test
the old test was broken in that it would never fail on a toolchains built without dynamic linking support, leading to the wrapper script possibly being installed on compilers that do not support it. in addition, the new test is portable across compilers: the old test only worked on GCC. the new test works by testing whether the toolchain libc defines __GLIBC__: most non-musl Linux libc's do define this for compatibility even when they are not glibc, so this is a safe bet to check for musl. in addition, the compiler runtime would need to have a somewhat glibc-compatible ABI in the first place, so any non-glibc compatible libc's compiler runtime might not work. it is safer to disable these cases by default and have the user enable the wrappers manually there using --enable-wrapper if they certain it works.
This commit is contained in:
parent
b3cd7d13fe
commit
f8db6f74b2
17
configure
vendored
17
configure
vendored
@ -237,17 +237,16 @@ echo "$cc_family"
|
|||||||
# Figure out toolchain wrapper to build
|
# Figure out toolchain wrapper to build
|
||||||
#
|
#
|
||||||
if test "$wrapper" = auto -o "$wrapper" = detect ; then
|
if test "$wrapper" = auto -o "$wrapper" = detect ; then
|
||||||
|
echo "#include <stdlib.h>" > "$tmpc"
|
||||||
|
echo "#if ! __GLIBC__" >> "$tmpc"
|
||||||
|
echo "#error no" >> "$tmpc"
|
||||||
|
echo "#endif" >> "$tmpc"
|
||||||
printf "checking for toolchain wrapper to build... "
|
printf "checking for toolchain wrapper to build... "
|
||||||
if test "$cc_family" = gcc ; then
|
if test "$wrapper" = auto && ! $CC -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
|
||||||
|
echo "none"
|
||||||
|
elif test "$cc_family" = gcc ; then
|
||||||
gcc_wrapper=yes
|
gcc_wrapper=yes
|
||||||
if test "$wrapper" = auto ; then
|
echo "gcc"
|
||||||
while read line ; do
|
|
||||||
case "$line" in */ld-musl-*) gcc_wrapper=no ;; esac
|
|
||||||
done <<EOF
|
|
||||||
$($CC -dumpspecs)
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
test "$gcc_wrapper" = yes && echo "gcc"
|
|
||||||
else
|
else
|
||||||
echo "none"
|
echo "none"
|
||||||
if test "$wrapper" = detect ; then
|
if test "$wrapper" = detect ; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user