{"id":833259,"url":"http://patchwork.ozlabs.org/api/1.2/patches/833259/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20171102090906.30391-1-danielhb@linux.vnet.ibm.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.2/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20171102090906.30391-1-danielhb@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-11-02T09:09:06","name":"[v5] configure: check $CC available before verifying host CPU","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"03181fb032025e2880a24afe823d5a93cd8b3d65","submitter":{"id":64623,"url":"http://patchwork.ozlabs.org/api/1.2/people/64623/?format=json","name":"Daniel Henrique Barboza","email":"danielhb@linux.vnet.ibm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20171102090906.30391-1-danielhb@linux.vnet.ibm.com/mbox/","series":[{"id":11455,"url":"http://patchwork.ozlabs.org/api/1.2/series/11455/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=11455","date":"2017-11-02T09:09:06","name":"[v5] configure: check $CC available before verifying host CPU","version":5,"mbox":"http://patchwork.ozlabs.org/series/11455/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/833259/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/833259/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3ySK8J3Qqkz9sNw\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  2 Nov 2017 20:11:28 +1100 (AEDT)","from localhost ([::1]:59289 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1eABX4-00082O-F1\n\tfor incoming@patchwork.ozlabs.org; Thu, 02 Nov 2017 05:11:26 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47907)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <danielhb@linux.vnet.ibm.com>) id 1eABWB-0007rx-Af\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 05:10:32 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <danielhb@linux.vnet.ibm.com>) id 1eABW6-0000Gn-Rj\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 05:10:31 -0400","from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56196\n\thelo=mx0a-001b2d01.pphosted.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <danielhb@linux.vnet.ibm.com>)\n\tid 1eABW6-0007bv-LV\n\tfor qemu-devel@nongnu.org; Thu, 02 Nov 2017 05:10:26 -0400","from pps.filterd (m0098420.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tvA294AMQ093152\n\tfor <qemu-devel@nongnu.org>; Thu, 2 Nov 2017 05:09:20 -0400","from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2dywm30wdg-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Thu, 02 Nov 2017 05:09:20 -0400","from localhost\n\tby e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <danielhb@linux.vnet.ibm.com>;\n\tThu, 2 Nov 2017 03:09:19 -0600","from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16)\n\tby e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 2 Nov 2017 03:09:15 -0600","from b03ledav005.gho.boulder.ibm.com\n\t(b03ledav005.gho.boulder.ibm.com [9.17.130.236])\n\tby b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id vA299C8A6619602; Thu, 2 Nov 2017 02:09:15 -0700","from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 50FEFBE053;\n\tThu,  2 Nov 2017 03:09:15 -0600 (MDT)","from localhost.localdomain (unknown [9.85.172.126])\n\tby b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP id 03F0EBE03A;\n\tThu,  2 Nov 2017 03:09:13 -0600 (MDT)"],"From":"Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>","To":"qemu-devel@nongnu.org","Date":"Thu,  2 Nov 2017 07:09:06 -0200","X-Mailer":"git-send-email 2.13.6","X-TM-AS-GCONF":"00","x-cbid":"17110209-8235-0000-0000-00000C80B12D","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007996; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000239; SDB=6.00939991; UDB=6.00473960;\n\tIPR=6.00720248; \n\tBA=6.00005666; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017832;\n\tXFM=3.00000015; UTC=2017-11-02 09:09:18","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17110209-8236-0000-0000-00003E48A0F4","Message-Id":"<20171102090906.30391-1-danielhb@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-11-02_02:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tpriorityscore=1501\n\tmalwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0\n\tclxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0\n\tclassifier=spam adjust=0 reason=mlx scancount=1\n\tengine=8.0.1-1707230000\n\tdefinitions=main-1711020119","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]","X-Received-From":"148.163.158.5","Subject":"[Qemu-devel] [PATCH v5] configure: check $CC available before\n\tverifying host CPU","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"peter.maydell@linaro.org, mdroth@linux.vnet.ibm.com, f4bug@amsat.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"When executing 'configure' in a fresh QEMU clone, in a fresh\nOS install running in a ppc64le host, this is the error\nshown:\n\n-----\n\n../configure --enable-trace-backend=simple --enable-debug\n    --target-list=ppc64-softmmu\n\nERROR: Unsupported CPU = ppc64le, try --enable-tcg-interpreter\n\n-----\n\nThis isn't true, ppc64le host CPU is supported. This happens because,\nin a fresh install, we don't have a C compiler to autodetect\nthe $cpu variable to \"ppc64\".\n\nThis patch moves the CC available check up a bit, just before verifying\nthe host CPU. This ensures that we bail out with a $CC not available\nerror instead of unsupported CPU (the host CPU detection without\nthe compiler wouldn't work properly anyway). It also allows --help to\nkeep working without a C compiler. With this patch, in the same ppc64le\nhost without gcc:\n\n$ ../configure --enable-trace-backend=simple --enable-debug\n    --target-list=ppc64-softmmu\n\nERROR: \"cc\" either does not exist or does not work\n\n$ ../configure --help\n\nUsage: configure [options]\nOptions: [defaults in brackets after descriptions]\n\nStandard options:\n  --help                   print this message\n  --prefix=PREFIX          install in PREFIX [/usr/local]\n  --interp-prefix=PREFIX   where to find shared libraries, etc.\n(...)\n\nSigned-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>\n---\n configure | 25 ++++++++++++++-----------\n 1 file changed, 14 insertions(+), 11 deletions(-)","diff":"diff --git a/configure b/configure\nindex 285d123dbf..e78f07d5d9 100755\n--- a/configure\n+++ b/configure\n@@ -1572,6 +1572,20 @@ fi\n # Suppress writing compiled files\n python=\"$python -B\"\n \n+# Check that the C compiler works. Doing this here before testing\n+# the host CPU ensures that we had a valid CC to autodetect the\n+# $cpu var (and we should bail right here if that's not the case).\n+# It also allows the help message to be printed without a CC.\n+write_c_skeleton;\n+if compile_object ; then\n+  : C compiler works ok\n+else\n+    error_exit \"\\\"$cc\\\" either does not exist or does not work\"\n+fi\n+if ! compile_prog ; then\n+    error_exit \"\\\"$cc\\\" cannot build an executable (is your linker broken?)\"\n+fi\n+\n # Now we have handled --enable-tcg-interpreter and know we're not just\n # printing the help message, bail out if the host CPU isn't supported.\n if test \"$ARCH\" = \"unknown\"; then\n@@ -1593,17 +1607,6 @@ if test -z \"$werror\" ; then\n     fi\n fi\n \n-# check that the C compiler works.\n-write_c_skeleton;\n-if compile_object ; then\n-  : C compiler works ok\n-else\n-    error_exit \"\\\"$cc\\\" either does not exist or does not work\"\n-fi\n-if ! compile_prog ; then\n-    error_exit \"\\\"$cc\\\" cannot build an executable (is your linker broken?)\"\n-fi\n-\n if test \"$bogus_os\" = \"yes\"; then\n     # Now that we know that we're not printing the help and that\n     # the compiler works (so the results of the check_defines we used\n","prefixes":["v5"]}