From patchwork Thu Jun 21 06:25:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 139448 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1670089lji; Wed, 20 Jun 2018 23:26:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJxzimLM47Zvb8wPWadthGYNaAQRAFzFZM7cjxXVgHApqXQadPKW15QJvIUQBndrzBOBq79 X-Received: by 2002:ac8:1087:: with SMTP id a7-v6mr21865116qtj.269.1529562397719; Wed, 20 Jun 2018 23:26:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529562397; cv=none; d=google.com; s=arc-20160816; b=C2u6qQEUm+xmhQUHJX7LdV5d9y2wztXbm8ZTKPkhUEQFOV743pX/tAlU9n0g3RQrZv oKeYUFfcfnH6OXhwEcPhUSYiNL2IBZ3Y34qWWM5jIQ14BkZTw/wihqZ5+LH4H04c12ak 4nHC/I8541xz8aWkM/4J5za6lf+WM/AjniMpIQYpBodYO6tRQAp1co5u3jC2Ygl+pH1y Sz1dPO03Y6isx1XR/LYpB7dlKEwoJgycjxBV4tcPgqJju4fcFgOZbFRO4PHbtoTEhSuV JCGA9GfiXuOCmlWyPbTmij+4Elar7z9pyAex5GY+cAW6h118y5/RiQak8lt5HPFVzZxI UW/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=p34Pwd49K+n25CYiLBkTBkyMEQonU09occQ1cJ2DeMI=; b=GS+iMafODMc0EPuCq6AcLUctUmDqFqv/+U1iWxJyZsB2q2B94HCFrgGt3ErISBqk/v 5idtO3+DdbYZZGFqGSQWC1etxAvtpvrdmfkZbkGQPf7lwE4+X87x3d/lYNlRC3GW9ZZr O5RkZwzOS7DYqzHxwld0w6/+6rQsPJXv1gqDiFPE41SVzEWdNgDlnp444GN3Ge2z14GL 3WXJQ+t5+9EmaZnxG8McRnqijlSebBCgzYqCycIHv0ohAwNDpfi8/VHr+Tk4A/Itz7zH sVc7XuEctldQV1zDAhF6Xr1p9O865YjL7Nh9x6OJDWmKqP0uP3BXtQppyzlUTnk86JYe B7EQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YiERySGG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e26-v6si4167764qvb.180.2018.06.20.23.26.37 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 20 Jun 2018 23:26:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YiERySGG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVt3F-0000tH-2o for patch@linaro.org; Thu, 21 Jun 2018 02:26:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVt2p-0000ss-C3 for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:26:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVt2n-0000WP-FZ for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:26:11 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:35195) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVt2n-0000Vl-89 for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:26:09 -0400 Received: by mail-wr0-x242.google.com with SMTP id l8-v6so1830938wrr.2 for ; Wed, 20 Jun 2018 23:26:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p34Pwd49K+n25CYiLBkTBkyMEQonU09occQ1cJ2DeMI=; b=YiERySGG42KLEQIvP0P8szmvt++m4yatRVb9huWqyOigOHLUZyAaBfoaa/wf5MOIa1 UcA/ENFe2CHffnoJnJWI9pWddf6bXGPT5pxpJAdMJMHkbCatRT0EjiRPpoAF8QL1WYMa 3/PjUoPfqT7c1V2xLdhWVn+RSBCIWW8+FO/FI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p34Pwd49K+n25CYiLBkTBkyMEQonU09occQ1cJ2DeMI=; b=jh9g325s3HAafNE2iw17VuEx7yRe/+bh/4I5a6lrSdE2lU3II2C6PS12Z2AeLjynXt DSCfuYhyz3EU0PsehJnJ4zISUv0kAST831XH/znwZ8mUME7kqzWFBI4JndSuh0kzLuwP IRbs8fpwaBN+Ac71kgSXgXKnh73vVqfGU2ZgtuKOb4pZxFeWtleaXSUdj0giRC1aDSU3 wutLc855Af3Uo6jNX9gPL67NKU2yM2EMwRQybTLl6cMQ57oOcpFw03Hdx2Wki7JzWw04 ZiY8bX/BIQqGIWMkkg/flzH5RodoXourZOsLEFdg/JtmxxaJOExFxLTTGsKArJNyRpI7 FCtQ== X-Gm-Message-State: APt69E0SGZb/btgVOre02SAfnhJ83b7Cn9L41nSm9eyRsqMUopiOm8TE uagGVKZFIpM69ikpWpN0KBjZbg== X-Received: by 2002:adf:b053:: with SMTP id g19-v6mr20116027wra.128.1529562368178; Wed, 20 Jun 2018 23:26:08 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id u11-v6sm5208429wrq.68.2018.06.20.23.26.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 23:26:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 8B7CE3E031D; Thu, 21 Jun 2018 07:26:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Thu, 21 Jun 2018 07:25:11 +0100 Message-Id: <20180621062605.941-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180621062605.941-1-alex.bennee@linaro.org> References: <20180621062605.941-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PULL v2 03/57] configure: move i386_cc to cross_cc_i386 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: agraf@suse.de, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, qemu-devel@nongnu.org, f4bug@amsat.org, cota@braap.org, famz@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Also dont assume x86_64 compiler can build i386 binaries. Signed-off-by: Alex Bennée Tested-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson -- 2.17.1 diff --git a/configure b/configure index ab189067cb..a5676cf15f 100755 --- a/configure +++ b/configure @@ -289,7 +289,6 @@ libs_softmmu="" libs_tools="" audio_pt_int="" audio_win_int="" -cc_i386=i386-pc-linux-gnu-gcc libs_qga="" debug_info="yes" stack_protector="" @@ -461,6 +460,8 @@ docker="no" # cross compilers defaults, can be overridden with --cross-cc-ARCH cross_cc_aarch64="aarch64-linux-gnu-gcc" cross_cc_arm="arm-linux-gnueabihf-gcc" +cross_cc_i386="i386-pc-linux-gnu-gcc" +cross_cc_cflags_i386="" cross_cc_powerpc="powerpc-linux-gnu-gcc" enabled_cross_compilers="" @@ -1447,7 +1448,8 @@ case "$cpu" in i386) CPU_CFLAGS="-m32" LDFLAGS="-m32 $LDFLAGS" - cc_i386='$(CC) -m32' + cross_cc_i386=$cc + cross_cc_cflags_i386=$CPU_CFLAGS ;; x86_64) # ??? Only extremely old AMD cpus do not have cmpxchg16b. @@ -1455,12 +1457,14 @@ case "$cpu" in # runtime and generate the fallback to serial emulation. CPU_CFLAGS="-m64 -mcx16" LDFLAGS="-m64 $LDFLAGS" - cc_i386='$(CC) -m32' + cross_cc_x86_64=$cc + cross_cc_cflags_x86_64=$CPU_CFLAGS ;; x32) CPU_CFLAGS="-mx32" LDFLAGS="-mx32 $LDFLAGS" - cc_i386='$(CC) -m32' + cross_cc_i386=$cc + cross_cc_cflags_i386="-m32" ;; # No special flags required for other host CPUs esac @@ -6724,7 +6728,6 @@ echo "CC=$cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then echo "IASL=$iasl" >> $config_host_mak fi -echo "CC_I386=$cc_i386" >> $config_host_mak echo "HOST_CC=$host_cc" >> $config_host_mak echo "CXX=$cxx" >> $config_host_mak echo "OBJCC=$objcc" >> $config_host_mak @@ -6845,6 +6848,7 @@ esac target_compiler="" target_compiler_static="" +target_compiler_cflags="" mkdir -p $target_dir echo "# Automatically generated by configure - do not modify" > $config_target_mak @@ -6862,6 +6866,7 @@ case "$target_name" in i386) gdb_xml_files="i386-32bit.xml i386-32bit-core.xml i386-32bit-sse.xml" target_compiler=$cross_cc_i386 + target_compiler_cflags=$cross_cc_ccflags_i386 ;; x86_64) TARGET_BASE_ARCH=i386 @@ -7034,9 +7039,9 @@ if has $target_compiler; then write_c_skeleton - if ! do_compiler "$target_compiler" -o $TMPE $TMPC -static ; then + if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC -static ; then # For host systems we might get away with building without -static - if ! do_compiler "$target_compiler" -o $TMPE $TMPC ; then + if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC ; then target_compiler="" else enabled_cross_compilers="${enabled_cross_compilers} '${target_compiler}'" @@ -7129,8 +7134,13 @@ if test -n "$target_compiler"; then if test -n "$target_compiler_static"; then echo "CROSS_CC_GUEST_STATIC=$target_compiler_static" >> $config_target_mak fi + + if test -n "$target_compiler_cflags"; then + echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak + fi fi + # generate QEMU_CFLAGS/LDFLAGS for targets cflags=""