diff mbox

[PULL,3/9] configure: Diagnose broken linkers directly

Message ID 0ef74c7496fd3c526b2259f86326eca4b3a03b78.1449211229.git.mjt@msgid.tls.msk.ru
State New
Headers show

Commit Message

Michael Tokarev Dec. 4, 2015, 6:57 a.m. UTC
From: Peter Maydell <peter.maydell@linaro.org>

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 <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 configure | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/configure b/configure
index 67801b0..2e8a672 100755
--- a/configure
+++ b/configure
@@ -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