From patchwork Tue Apr 24 15:23:23 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: 134120 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp2385271lji; Tue, 24 Apr 2018 08:37:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpm1R10tIUVRldvT3DiOlhK++uP/FeHv0LBvFcrH6EHfV4fw0iBnP1Xw8YHs7U0SKbO1Lv6 X-Received: by 10.12.198.14 with SMTP id v14mr2380148qvi.82.1524584245180; Tue, 24 Apr 2018 08:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524584245; cv=none; d=google.com; s=arc-20160816; b=vIPQNUG8XSxi+oTHa9BIQeTDlgL36o9yFKjyybC6hhtQRhAhah6zCbaJzLhPHj7GtO rkpkUkYaVNjmBiAhwuisf8dWWSsJoChtWgIA9TjPCGDt1PKah2uM9dhhtZoRWolyqIRr oH+vK/NBJJmM52MVP2PXlk1g/PILgsBRsoHKV/au/G8LrQ70D3QfgXdDncKPvDlm65F5 X9hS0bYn64eHpYi8iLqbz5rb3vAbSj31pLnJvciRfcmcmhag1q6OCTQI4u/741ZBLo7b EdnwMvtFHzvH/xHIEEeVMlnKpuaVi3u+uI8tlfx2OpHuU3xZSVzU/oBsAjetGqH9QCmD OpCA== 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=IB5C4dS0bHjiqh31smXTu+c1pHUMqLt854R8HBwdxgw=; b=aHEhiMUPlb6lBMpuQslCqaLsNN+sKzzjm225zsuV5d7cdIUHuMHS5gKMeFsKUTKh2a BJ+tP/IVDulWhTOo46jA64jAz/4f09twIvCORb3aO1xmJM/J9bdIa3Ejp+TeWpCqbpE9 7mdgXQV8QGcENYsNHGfQM1jTVispO+v3B9/cyfguDfox3jSmw4wqGNd7NoK0qorN9E4O Ik/MQ3YH6OE0OfrHz8AIdol5rQEzLLQ8j5R4/HarSUNy1M/RMaWebAL7MVuJqwgpLhbr 2nbicNJf/hb38zZP4Vw4VJuZI1E9qGHUpGl6DJuMbHfRpEVhomaBEyGoBCPWm043Vswp PR1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Rxy/B15c; 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 c127si819061qkf.74.2018.04.24.08.37.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 24 Apr 2018 08:37:25 -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=Rxy/B15c; 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]:59143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fB00S-0007x5-Hu for patch@linaro.org; Tue, 24 Apr 2018 11:37:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fAznk-0006Xh-E4 for qemu-devel@nongnu.org; Tue, 24 Apr 2018 11:24:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fAzng-0005Ne-67 for qemu-devel@nongnu.org; Tue, 24 Apr 2018 11:24:16 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:53498) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fAznf-0005Lc-U8 for qemu-devel@nongnu.org; Tue, 24 Apr 2018 11:24:12 -0400 Received: by mail-wm0-x243.google.com with SMTP id 66so1795805wmd.3 for ; Tue, 24 Apr 2018 08:24:11 -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=IB5C4dS0bHjiqh31smXTu+c1pHUMqLt854R8HBwdxgw=; b=Rxy/B15cqUrqTL/QriG13HG7EAYpsIieK9GoTd/Z+x8dJDs2/mdf/wsgaka+VBgROR YZWOKDR6lRxaxN/v01yM6oT7LHsM47ZFhwCPlhE8BEz7KKVL66IvWHCzoS2UmG4ge2Vb HwPrjRpi+ZpkMUuklEMRNs2lo5HLJ02wTWegQ= 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=IB5C4dS0bHjiqh31smXTu+c1pHUMqLt854R8HBwdxgw=; b=Dv8+97Z1w0T2zTMKcuKDxN+vSjhfeXJc+spslPDH3+lgtOSh8ouquX5nUFsGyMCK4U tJqWvpk19zZtRXsRSD6hU6wnLo1TLjSsMBoKI1kewBxJ7Lj5k4qQ7ftN4dyLoda6hwjB LIQNqUpAya3w5jTna9d8rzr9Vg138bxcDrwRdgrNqjRhX0TWHHYEozvUfkqzqz5cSOFM +feGN73IYIH155FpBBEpWf4q+hsiOp2uW6J3aOnOpwfqN6DJ+bmogDXk7iTEP92pV/08 4nRNx8guKTKSgKVXTFcTK0aXlV2MOFlFzD7ZBwWf+wOe0HV70aw+LZOqbeY3oWJ8tVBl dIog== X-Gm-Message-State: ALQs6tAeLnKG0ps4pWH8FB7ZYQsmXC/OQ9HLKEMFy1gZbDiYA57eO/Bd zGRcTtizlRYoySeajFPHhz6N9g== X-Received: by 10.28.202.26 with SMTP id a26mr10938071wmg.126.1524583450885; Tue, 24 Apr 2018 08:24:10 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c18sm12854012wmd.13.2018.04.24.08.24.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Apr 2018 08:24:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id AD6903E0587; Tue, 24 Apr 2018 16:24:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Tue, 24 Apr 2018 16:23:23 +0100 Message-Id: <20180424152405.10304-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180424152405.10304-1-alex.bennee@linaro.org> References: <20180424152405.10304-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:c09::243 Subject: [Qemu-devel] [PATCH v3 04/46] 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org 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é --- v2 - drop using system x86_64 compiler for i386 compiles v3 - fix cross_cc_i386 when on i386 --- configure | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) -- 2.17.0 Reviewed-by: Richard Henderson diff --git a/configure b/configure index caa838a0d0..ffd96d930f 100755 --- a/configure +++ b/configure @@ -284,7 +284,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="" @@ -457,6 +456,8 @@ docker="no" cross_cc_aarch64="aarch64-linux-gnu-gcc" cross_cc_arm="arm-linux-gnueabihf-gcc" cross_cc_powerpc="powerpc-linux-gnu-gcc" +cross_cc_i386="i386-pc-linux-gnu-gcc" +cross_cc_cflags_i386="" enabled_cross_compilers="" @@ -687,12 +688,10 @@ case "$cpu" in i386|i486|i586|i686|i86pc|BePC) cpu="i386" supported_cpu="yes" - cross_cc_i386=gcc ;; x86_64|amd64) cpu="x86_64" supported_cpu="yes" - cross_cc_x86_64=gcc ;; armv*b|armv*l|arm) cpu="arm" @@ -1435,7 +1434,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. @@ -1443,12 +1443,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 @@ -6675,7 +6677,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 @@ -6794,6 +6795,7 @@ case "$target" in esac target_compiler="" +target_compiler_cflags="" mkdir -p $target_dir echo "# Automatically generated by configure - do not modify" > $config_target_mak @@ -6811,6 +6813,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_cflags_i386 ;; x86_64) TARGET_BASE_ARCH=i386 @@ -6987,7 +6990,7 @@ int main(void) { } EOF - if ! do_compiler $target_compiler -o $TMPE $TMPC -static ; then + if ! do_compiler $target_compiler $target_compiler_cflags -o $TMPE $TMPC -static ; then target_compiler="" else enabled_cross_compilers="${enabled_cross_compilers} ${target_compiler}" @@ -7071,8 +7074,13 @@ fi if test -n "$target_compiler"; then echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak + + 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=""