From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: jordan.l.justen@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Wed, 10 Apr 2019 12:56:54 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Apr 2019 12:56:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,334,1549958400"; d="scan'208";a="163172201" Received: from askirtik-mobl1.amr.corp.intel.com (HELO localhost) ([10.254.188.249]) by fmsmga001.fm.intel.com with ESMTP; 10 Apr 2019 12:56:53 -0700 MIME-Version: 1.0 In-Reply-To: References: <20190410093424.20365-1-jordan.l.justen@intel.com> <20190410093424.20365-3-jordan.l.justen@intel.com> To: Philippe Mathieu-Daudé , devel@edk2.groups.io From: "Jordan Justen" Cc: Laszlo Ersek , Ard Biesheuvel Subject: Re: [edk2-devel] [PATCH 3/5] OvmfPkg/build.sh: Move automatic TARGET_TOOLS detection later Message-ID: <155492621297.23894.2090961136853111355@jljusten-skl> User-Agent: alot/0.8 Date: Wed, 10 Apr 2019 12:56:53 -0700 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 2019-04-10 08:37:22, Philippe Mathieu-Daud=C3=A9 wrote: > Hi Jordan, >=20 > 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. >=20 > I am sorry but I am non-native English and I have hard time to > understand your comment. >=20 > OVMF targets x86 hardware, which is obviously not ARM. >>From OvmfPkg/README: "The Open Virtual Machine Firmware (OVMF) project aims to support firmware for Virtual Machines using the edk2 code base." This doesn't appear to indicate any particular architecture or VMM. Nevertheless, ArmVirtPkg was created, so in effect, you are correct. > And I'm not aware of another target architecture. Are you talking > about the host where you build? I mean the target. The patch looks for something like "-a AARCH64" on the command line. If found, we try to build ArmVirtPkg/ArmVirtQemu.dsc instead of OVMF. It's a bit of a hack in that it will try to build the dsc from another package. But, OvmfPkg/build.sh is a little more generic than one might expect. For example, when I want to build MdeModulePkg, I usually just run: OvmfPkg/build.sh -p MdeModulePkg/MdeModulePkg.dsc I find it convenient that the script sets up the build environment automatically, and after the script is done, no changes persist in my shell's environment. > 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. >=20 > A more generic comment regarding your series: how do you use this script? Yeah, you are right. The comments could be better. I'll try to improve them. Basically, these changes let me build ArmVirtPkg/ArmVirtQemu.dsc on x86_64 Linux by simply added "-a AARCH64" or "-a ARM" parameteres to this script. It also helped setup the qemu command line. Here are the 4 commands I used on x86_64 Linux to build and run ArmVirtPkg: $ OvmfPkg/build.sh -a AARCH64 $ OvmfPkg/build.sh -a AARCH64 qemu -m 1024 -cpu cortex-a57 -M virt -net none $ OvmfPkg/build.sh -a ARM $ OvmfPkg/build.sh -a ARM qemu -m 1024 -cpu cortex-a15 -M virt -net none I think the script might be usable on an ARM based build systems as well, but it might require further tweaks. Ideally, if the build system was AARCH64 based, then: * OvmfPkg/build.sh: (with no params) would cause AARCH64 ArmVirtPkg to be built using a native compiler. * OvmfPkg/build.sh -a ARM: would cause ARM ArmVirtPkg to be built using a cross compiler. * OvmfPkg/build.sh -a X64: would cause X64 OVMF to be built using a cross compiler. -Jordan