fix detection of LIBCC for compiler-rt with clang
authorMatúš Olekšák <oleksak.matus@gmail.com>
Wed, 21 Feb 2018 17:03:04 +0000 (12:03 -0500)
committerRich Felker <dalias@aerifal.cx>
Wed, 21 Feb 2018 17:07:16 +0000 (12:07 -0500)
Maintainer's note: at one point, -lcompiler_rt apparently worked, and
may still work and be preferable if one has manually installed the
library in a public lib directory. but with current versions of clang,
the full pathname to the library file is needed. the original patch
removed the -lcompiler_rt check; I have left it in place in case there
are users depending on it, and since, when it does work, it's
preferable so as not to code a dependency on the specific compiler
version and paths in config.mak.

configure

index 501a721..1e59c46 100755 (executable)
--- a/configure
+++ b/configure
@@ -598,6 +598,8 @@ tryldflag LDFLAGS_AUTO -Wl,-Bsymbolic-functions
 # Find compiler runtime library
 test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
 test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
+test -z "$LIBCC" && try_libcc=`$CC -print-libgcc-file-name 2>/dev/null` \
+                 && tryldflag LIBCC "$try_libcc"
 test -z "$LIBCC" && try_libcc=`$CC -print-file-name=libpcc.a 2>/dev/null` \
                  && tryldflag LIBCC "$try_libcc"
 printf "using compiler runtime libraries: %s\n" "$LIBCC"