From patchwork Tue May 21 06:28:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 164687 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1223305ili; Mon, 20 May 2019 23:33:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9y2HVnznUMstQIme1BmoigxgQtsRWRq8cxTfMpN1qEMaJNpxXynovceCPMDOK6vC2vCDU X-Received: by 2002:a50:8903:: with SMTP id e3mr78919898ede.11.1558420409533; Mon, 20 May 2019 23:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558420409; cv=none; d=google.com; s=arc-20160816; b=ct0rvaVH2PqHE6MpFLswtEa6ei/xcqFKzNuK2vMWVbeJiglZH6K6u9P+F9YAnyun4r eDQFWC1k/7AH1w8lUxOXmLwGpR+i0B11TNIw3dBLho+QO9lPumxzLySXttjrMm5AE596 Z/MlExkdstln5v7AJJIqyFmeLBMCOjLsmiRpYabEmLZaVl+KgN9Z4lIZufI4pQBpgrOC gmXNrbeXoYvHL2RdMm+EWy1pcgpGYDZCF00SmOO4mTbAnjQvPRKQnxrrBSSXPd5V4Y8J vDIEnAknpfPPD6fFmr78pXfsMfoI2hkh0UuW+KPwe7RDQSjXsT1rho5uQW5TwR6Lb/Hv ifbg== 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; bh=9JaW319F3WMFcPzHzwcBZuNyA8WCze8WfJBXJ+/1WcU=; b=LpJnjr7ZRIT9xkNjJczp8X977KrQzn3G1pq2Bf2L66JTT24VOgwAKsLlDs6UGhnjvQ uavwaHTaQic+E07Y7yZ+4CG8a+Xjsox63FBTyGPKA9JSWv88Iix710I3mOFTTzWX2y2g Fh711NW+6tVKirBDn2c7WJbx8GwhbGbYtOdmyAI6Vth8u7DZHEgBnHPTVLzFBs858s/q sekUeNxZ9tGDv7bRU70NItTVost9ShnQ0BzvxtzAEK7qGr6SqxDAlLPYX4unwZzP/Ja8 Hlar8bnXyQ94j0JUOn75c5798SCuB76ziOkirX6nU9Lf4RHDTi26SWfWTAN6oUvzJpKJ 7j7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=GJQVEQdz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q21si4761883ejb.278.2019.05.20.23.33.29 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 May 2019 23:33:29 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=GJQVEQdz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:47346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSyL2-0000PH-D6 for patch@linaro.org; Tue, 21 May 2019 02:33:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSyHS-0005s6-Nm for qemu-devel@nongnu.org; Tue, 21 May 2019 02:29:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSyHR-0007gn-Da for qemu-devel@nongnu.org; Tue, 21 May 2019 02:29:46 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:49501) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSyHQ-0007Wq-03; Tue, 21 May 2019 02:29:45 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 457Qpf18Jhz9s9y; Tue, 21 May 2019 16:29:29 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1558420170; bh=K39eTPMxj78aP5BGFsBiRFak42glNHpHZQs21KFAfSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GJQVEQdzNuxyiEA4+lidqzofmYxQREANxMb1CgsBX2BDE89h2YM8PoSlV3aw9PVAx 4IUS6BcvhFwsF5cHbyuNhM5q7hVpnWxUEya27qVx0JiReNkQ9t4fKjxZRVUTYUloYO FrFOM1agWSUZPuJgZz93bdNdnMwCkurKVXLEM3cI= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 21 May 2019 16:28:48 +1000 Message-Id: <20190521062924.6930-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190521062924.6930-1-david@gibson.dropbear.id.au> References: <20190521062924.6930-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 02/38] configure: Distinguish ppc64 and ppc64le hosts 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: lvivier@redhat.com, gkurz@kaod.org, Richard Henderson , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson We cannot use the ppc64le host compiler to build ppc64(be) guest code. Clean up confusion between cross_cc_powerpc and cross_cc_ppc; make use of the cflags variable as well. Signed-off-by: Richard Henderson Message-Id: <20190501223819.8584-2-richard.henderson@linaro.org> Signed-off-by: David Gibson --- configure | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) -- 2.21.0 diff --git a/configure b/configure index d2fc346302..69402f18b8 100755 --- a/configure +++ b/configure @@ -198,7 +198,7 @@ supported_kvm_target() { i386:i386 | i386:x86_64 | i386:x32 | \ x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \ mips:mips | mipsel:mips | \ - ppc:ppc | ppc64:ppc | ppc:ppc64 | ppc64:ppc64 | \ + ppc:ppc | ppc64:ppc | ppc:ppc64 | ppc64:ppc64 | ppc64:ppc64le | \ s390x:s390x) return 0 ;; @@ -502,8 +502,11 @@ cross_cc_arm="arm-linux-gnueabihf-gcc" cross_cc_cflags_armeb="-mbig-endian" cross_cc_i386="i386-pc-linux-gnu-gcc" cross_cc_cflags_i386="" -cross_cc_powerpc="powerpc-linux-gnu-gcc" -cross_cc_powerpc="powerpc-linux-gnu-gcc" +cross_cc_ppc="powerpc-linux-gnu-gcc" +cross_cc_cflags_ppc="-m32" +cross_cc_ppc64="powerpc-linux-gnu-gcc" +cross_cc_cflags_ppc64="-m64" +cross_cc_ppc64le="powerpc64le-linux-gnu-gcc" enabled_cross_compilers="" @@ -700,7 +703,11 @@ elif check_define __sparc__ ; then fi elif check_define _ARCH_PPC ; then if check_define _ARCH_PPC64 ; then - cpu="ppc64" + if check_define _LITTLE_ENDIAN ; then + cpu="ppc64le" + else + cpu="ppc64" + fi else cpu="ppc" fi @@ -731,10 +738,14 @@ ARCH= # Note that this case should only have supported host CPUs, not guests. case "$cpu" in ppc|ppc64|s390|s390x|sparc64|x32|riscv32|riscv64) - cpu="$cpu" supported_cpu="yes" eval "cross_cc_${cpu}=\$host_cc" ;; + ppc64le) + ARCH="ppc64" + supported_cpu="yes" + cross_cc_ppc64le=$host_cc + ;; i386|i486|i586|i686|i86pc|BePC) cpu="i386" supported_cpu="yes" @@ -1538,8 +1549,8 @@ case "$cpu" in ppc) CPU_CFLAGS="-m32" LDFLAGS="-m32 $LDFLAGS" - cross_cc_powerpc=$cc - cross_cc_cflags_powerpc=$CPU_CFLAGS + cross_cc_ppc=$cc + cross_cc_cflags_ppc="$CPU_CFLAGS" ;; ppc64) CPU_CFLAGS="-m64" @@ -6164,7 +6175,7 @@ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \ fi done fi -if test "$cpu" = "ppc64" && test "$targetos" != "Darwin" ; then +if test "$ARCH" = "ppc64" && test "$targetos" != "Darwin" ; then roms="$roms spapr-rtas" fi @@ -7349,7 +7360,7 @@ if test "$linux" = "yes" ; then i386|x86_64|x32) linux_arch=x86 ;; - ppc|ppc64) + ppc|ppc64|ppc64le) linux_arch=powerpc ;; s390x) @@ -7510,7 +7521,8 @@ case "$target_name" in ;; ppc) gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" - target_compiler=$cross_cc_powerpc + target_compiler=$cross_cc_ppc + target_compiler_cflags="$cross_cc_cflags_ppc" ;; ppc64) TARGET_BASE_ARCH=ppc @@ -7518,6 +7530,7 @@ case "$target_name" in mttcg=yes gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" target_compiler=$cross_cc_ppc64 + target_compiler_cflags="$cross_cc_cflags_ppc64" ;; ppc64le) TARGET_ARCH=ppc64 @@ -7533,7 +7546,8 @@ case "$target_name" in TARGET_ABI_DIR=ppc echo "TARGET_ABI32=y" >> $config_target_mak gdb_xml_files="power64-core.xml power-fpu.xml power-altivec.xml power-spe.xml power-vsx.xml" - target_compiler=$cross_cc_ppc64abi32 + target_compiler=$cross_cc_ppc + target_compiler_cflags="$cross_cc_cflags_ppc" ;; riscv32) TARGET_BASE_ARCH=riscv