configure: Diagnose broken linkers directly

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.

Backports commit 0ef74c7496fd3c526b2259f86326eca4b3a03b78 from qemu
This commit is contained in:
Peter Maydell 2018-03-09 12:26:19 -05:00 committed by Lioncash
parent 91de4878f7
commit 9601f82746
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

3
qemu/configure vendored
View file

@ -704,6 +704,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
if test "$bogus_os" = "yes"; then
# Now that we know that we're not printing the help and that