Skip to content

Commit

Permalink
configure: Diagnose broken linkers directly
Browse files Browse the repository at this point in the history
Currently if the user's compiler works for creating .o files but
their linker is broken such that compiling an executable from a
C file does not work, we will report a misleading error message
about the compiler not supporting __thread (since that happens
to be the first test we run which requires a working linker).
Explicitly check that compile_prog works as well as compile_object,
so that people whose toolchain setup is broken get a more helpful
error message.

Signed-off-by: Peter Maydell <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
pm215 authored and Michael Tokarev committed Dec 4, 2015
1 parent e0df8f1 commit 0ef74c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1428,6 +1428,9 @@ if compile_object ; then
else
error_exit "\"$cc\" either does not exist or does not work"
fi
if ! compile_prog ; then
error_exit "\"$cc\" cannot build an executable (is your linker broken?)"
fi

# Check that the C++ compiler exists and works with the C compiler
if has $cxx; then
Expand Down

0 comments on commit 0ef74c7

Please sign in to comment.