From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.85.221.48, mailfrom: philmd@redhat.com) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by groups.io with SMTP; Wed, 10 Apr 2019 08:37:26 -0700 Received: by mail-wr1-f48.google.com with SMTP id w10so3522772wrm.4 for ; Wed, 10 Apr 2019 08:37:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Q1oJE3sUOXKcDbFbZqDDeux0mvVXoMxS9/SkxvUZsYE=; b=h76zEu7E1JsHkqPw7l01ExtenkGs6q4fmaF7JpCrUrZHEbY5zfZb8fx7b9zFweHTZJ iup2sOINyBjPrtmYVeKiZU53/M65ffjF3MzDvujRMIJr/52q8FBeMyTT+4yF13T7U7NQ acg3iP5pssLf1U6RmviQq7VCnIrlwg8/8O1lSD2NwNxteczhA0QW0OGzjI4LP1st3QDY Govc+7tID/MtcvOWPyWPf/DMxGtRIxOkE8EHv+3AT8ZEV1WprtEiXJCXJI14j/9R2al+ PaDNpXmm7lwMszbm7Xdp/pEpxDqCDsmDlhwdsDcBdFYWx92ffS2rr+wgrHGf9PVBS72v 2RQg== X-Gm-Message-State: APjAAAVjx9LVS/aupFzWMoARbPnxToNQlPhRmsWusJtn4MphIU8wZEWT IrL1IggIOpEdnTe1MlUaF17VTA== X-Google-Smtp-Source: APXvYqzMrZJbPCO0B23sc3izMGuoXQSkvAm24AYnvWtiWqvXRGem9U9Pz81Yln80WdUS6xKJ0p6P1w== X-Received: by 2002:a5d:4f11:: with SMTP id c17mr28995715wru.34.1554910644551; Wed, 10 Apr 2019 08:37:24 -0700 (PDT) Return-Path: Received: from [10.201.33.53] ([195.166.127.210]) by smtp.gmail.com with ESMTPSA id z74sm9379899wmc.2.2019.04.10.08.37.23 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 08:37:23 -0700 (PDT) Subject: Re: [edk2-devel] [PATCH 3/5] OvmfPkg/build.sh: Move automatic TARGET_TOOLS detection later To: devel@edk2.groups.io, jordan.l.justen@intel.com Cc: Laszlo Ersek , Ard Biesheuvel References: <20190410093424.20365-1-jordan.l.justen@intel.com> <20190410093424.20365-3-jordan.l.justen@intel.com> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Openpgp: id=89C1E78F601EE86C867495CBA2A3FD6EDEADC0DE; url=http://pgp.mit.edu/pks/lookup?op=get&search=0xA2A3FD6EDEADC0DE Message-ID: Date: Wed, 10 Apr 2019 17:37:22 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190410093424.20365-3-jordan.l.justen@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Hi Jordan, On 4/10/19 11:34 AM, Jordan Justen wrote: > If we are building for a non-native ARM, then we may need to select a > cross-compiler based on the -a paramter. I am sorry but I am non-native English and I have hard time to understand your comment. OVMF targets x86 hardware, which is obviously not ARM. And I'm not aware of another target architecture. Are you talking about the host where you build? I am trying your series on a Aarch64 host but I fail at passing the correct cross gcc. I set GCC5_IA32_PREFIX, GCC5_X64_PREFIX and GCC5_BIN env vars, but the build script still run '"gcc"' instead of my cross one. A more generic comment regarding your series: how do you use this script? Thanks, Phil. > Signed-off-by: Jordan Justen > --- > OvmfPkg/build.sh | 99 +++++++++++++++++++++++++----------------------- > 1 file changed, 51 insertions(+), 48 deletions(-) > > diff --git a/OvmfPkg/build.sh b/OvmfPkg/build.sh > index 217abae683..812441b9b1 100755 > --- a/OvmfPkg/build.sh > +++ b/OvmfPkg/build.sh > @@ -40,58 +40,11 @@ ARCH_X64=no > BUILDTARGET=DEBUG > BUILD_OPTIONS= > PLATFORMFILE= > +TARGET_TOOLS= > THREADNUMBER=1 > LAST_ARG= > RUN_QEMU=no > > -# > -# Pick a default tool type for a given OS > -# > -TARGET_TOOLS=MYTOOLS > -case `uname` in > - CYGWIN*) > - echo Cygwin not fully supported yet. > - ;; > - Darwin*) > - Major=$(uname -r | cut -f 1 -d '.') > - # Major is Darwin version, not OS X version. > - # OS X Yosemite 10.10.2 returns 14. > - case $Major in > - [156789]) > - echo OvmfPkg requires OS X Snow Leopard 10.6 or newer OS > - exit 1 > - ;; > - 10) > - TARGET_TOOLS=XCODE32 > - ;; > - 1[12]) > - TARGET_TOOLS=XCLANG > - ;; > - *) > - # Mavericks and future assume XCODE5 (clang + lldb) > - TARGET_TOOLS=XCODE5 > - ;; > - esac > - ;; > - Linux*) > - 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 > - exit 1 > - ;; > - 4.8.*) > - TARGET_TOOLS=GCC48 > - ;; > - 4.9.*|6.[0-2].*) > - TARGET_TOOLS=GCC49 > - ;; > - *) > - TARGET_TOOLS=GCC5 > - ;; > - esac > -esac > - > # > # Scan command line to override defaults > # > @@ -166,6 +119,56 @@ else > BUILD_ROOT_ARCH=X64 > fi > > +# > +# Pick a default tool type for a given OS > +# > +if [ -z "$TARGET_TOOLS" ]; then > + TARGET_TOOLS=MYTOOLS > + case `uname` in > + CYGWIN*) > + echo Cygwin not fully supported yet. > + ;; > + Darwin*) > + Major=$(uname -r | cut -f 1 -d '.') > + # Major is Darwin version, not OS X version. > + # OS X Yosemite 10.10.2 returns 14. > + case $Major in > + [156789]) > + echo OvmfPkg requires OS X Snow Leopard 10.6 or newer OS > + exit 1 > + ;; > + 10) > + TARGET_TOOLS=XCODE32 > + ;; > + 1[12]) > + TARGET_TOOLS=XCLANG > + ;; > + *) > + # Mavericks and future assume XCODE5 (clang + lldb) > + TARGET_TOOLS=XCODE5 > + ;; > + esac > + ;; > + Linux*) > + 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 > + exit 1 > + ;; > + 4.8.*) > + TARGET_TOOLS=GCC48 > + ;; > + 4.9.*|6.[0-2].*) > + TARGET_TOOLS=GCC49 > + ;; > + *) > + TARGET_TOOLS=GCC5 > + ;; > + esac > + esac > +fi > + > case $PROCESSOR in > IA32) > if [ -n "$QEMU_COMMAND" ]; then >