Skip to content

Commit c1e6977

Browse files
committed
configure: Use -print-libgcc-file-name first to detect compiler runtime
This uses compiler to provide the path to its default runtime library libgcc/compiler-rt, when using clang we can set CC="clang --rtlib={compiler-rt|libgcc}" and it will find the right compiler runtime when autodetecting it Signed-off-by: Khem Raj <[email protected]>
1 parent d994690 commit c1e6977

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,10 @@ tryldflag LDFLAGS_AUTO -Wl,--exclude-libs=ALL
615615
tryldflag LDFLAGS_AUTO -Wl,--dynamic-list="$srcdir/dynamic.list"
616616

617617
# Find compiler runtime library
618-
test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
619-
test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
620618
test -z "$LIBCC" && try_libcc=`$CC -print-libgcc-file-name 2>/dev/null` \
621619
&& tryldflag LIBCC "$try_libcc"
620+
test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh
621+
test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt
622622
test -z "$LIBCC" && try_libcc=`$CC -print-file-name=libpcc.a 2>/dev/null` \
623623
&& tryldflag LIBCC "$try_libcc"
624624
printf "using compiler runtime libraries: %s\n" "$LIBCC"

0 commit comments

Comments
 (0)