From patchwork Tue Nov 24 14:55:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 57257 Delivered-To: patches@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2138236lbb; Tue, 24 Nov 2015 06:55:48 -0800 (PST) X-Received: by 10.28.53.130 with SMTP id c124mr3229062wma.16.1448376947534; Tue, 24 Nov 2015 06:55:47 -0800 (PST) Return-Path: Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id jo10si27298796wjb.237.2015.11.24.06.55.47 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 24 Nov 2015 06:55:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1a1F0U-0002kz-Jl; Tue, 24 Nov 2015 14:55:46 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-trivial@nongnu.org Subject: [PATCH] configure: Diagnose broken linkers directly Date: Tue, 24 Nov 2015 14:55:46 +0000 Message-Id: <1448376946-10572-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 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 --- configure | 3 +++ 1 file changed, 3 insertions(+) -- 1.9.1 diff --git a/configure b/configure index 71d6cbc..21a8536 100755 --- a/configure +++ b/configure @@ -1426,6 +1426,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