From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: jordan.l.justen@intel.com) Received: from mga04.intel.com (mga04.intel.com []) by groups.io with SMTP; Wed, 10 Apr 2019 02:35:30 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2019 02:35:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,332,1549958400"; d="scan'208";a="222175354" Received: from askirtik-mobl1.amr.corp.intel.com (HELO jljusten-skl.amr.corp.intel.com) ([10.254.188.249]) by orsmga001.jf.intel.com with ESMTP; 10 Apr 2019 02:35:29 -0700 From: "Jordan Justen" To: devel@edk2.groups.io Cc: Laszlo Ersek , Ard Biesheuvel , Jordan Justen Subject: [PATCH 5/5] OvmfPkg/build.sh: Add a cross compiler prefix for AARCH64/ARM Date: Wed, 10 Apr 2019 02:34:24 -0700 Message-Id: <20190410093424.20365-5-jordan.l.justen@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190410093424.20365-1-jordan.l.justen@intel.com> References: <20190410093424.20365-1-jordan.l.justen@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Signed-off-by: Jordan Justen --- OvmfPkg/build.sh | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh index 9d787452b5..e1a708942b 100755 --- a/OvmfPkg/build.sh +++ b/OvmfPkg/build.sh @@ -103,9 +103,6 @@ do shift done -export GCC5_AARCH64_PREFIX=aarch64-linux-gnu- -export GCC5_ARM_PREFIX=arm-linux-gnueabihf- - if [[ "$ARCH_AARCH64" == "yes" ]]; then PROCESSOR=AARCH64 Processor=AArch64 @@ -138,6 +135,23 @@ else BUILD_ROOT_ARCH=X64 fi +GCC_CROSS_PREFIX= +gcc_machine=$(gcc -dumpmachine 2>&1 | awk -F - '{print $1}') +case $gcc_machine in + x86_64) + case $BUILD_ROOT_ARCH in + AARCH64) + GCC_CROSS_PREFIX=aarch64-linux-gnu- + ;; + ARM) + GCC_CROSS_PREFIX=arm-linux-gnueabihf- + ;; + esac + ;; +esac + +GCC=${GCC_CROSS_PREFIX}gcc + # # Pick a default tool type for a given OS # @@ -169,7 +183,7 @@ if [ -z "$TARGET_TOOLS" ]; then esac ;; Linux*) - gcc_version=$(gcc -v 2>&1 | tail -1 | awk '{print $3}') + gcc_version=$($GCC -v 2>&1 | tail -1 | awk '{print $3}') case $gcc_version in [1-3].*|4.[0-7].*) echo OvmfPkg requires GCC4.8 or later @@ -188,6 +202,10 @@ if [ -z "$TARGET_TOOLS" ]; then esac fi +if [ -n "${GCC_CROSS_PREFIX}" ]; then + export ${TARGET_TOOLS}_${BUILD_ROOT_ARCH}_PREFIX=${GCC_CROSS_PREFIX} +fi + case $PROCESSOR in AARCH64) if [ -z "$QEMU_COMMAND" ]; then -- 2.20.1