public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Jordan Justen" <jordan.l.justen@intel.com>
To: Philippe Mathieu-Daudé <philmd@redhat.com>, devel@edk2.groups.io
Cc: Laszlo Ersek <lersek@redhat.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [edk2-devel] [PATCH 3/5] OvmfPkg/build.sh: Move automatic TARGET_TOOLS detection later
Date: Wed, 10 Apr 2019 12:56:53 -0700	[thread overview]
Message-ID: <155492621297.23894.2090961136853111355@jljusten-skl> (raw)
In-Reply-To: <d693b2dd-5167-0d5f-9987-32ce87289bcb@redhat.com>

On 2019-04-10 08:37:22, Philippe Mathieu-Daudé wrote:
> 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.

>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.
> 
> 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

  reply	other threads:[~2019-04-10 19:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-10  9:34 [PATCH 1/5] OvmfPkg/build.sh: Require QEMU 1.6 or newer and always enable flash Jordan Justen
2019-04-10  9:34 ` [PATCH 2/5] OvmfPkg/build.sh: Don't automatically -hda qemu parameter Jordan Justen
2019-04-10  9:34 ` [PATCH 3/5] OvmfPkg/build.sh: Move automatic TARGET_TOOLS detection later Jordan Justen
2019-04-10 15:37   ` [edk2-devel] " Philippe Mathieu-Daudé
2019-04-10 19:56     ` Jordan Justen [this message]
2019-04-10  9:34 ` [PATCH 4/5] OvmfPkg/build.sh: Add AARCH64/ARM build and qemu support Jordan Justen
2019-04-10  9:34 ` [PATCH 5/5] OvmfPkg/build.sh: Add a cross compiler prefix for AARCH64/ARM Jordan Justen
2019-04-10 14:16 ` [edk2-devel] [PATCH 1/5] OvmfPkg/build.sh: Require QEMU 1.6 or newer and always enable flash Laszlo Ersek
2019-04-10 20:18   ` Jordan Justen
2019-04-11  7:48     ` Laszlo Ersek
2019-04-10 14:45 ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=155492621297.23894.2090961136853111355@jljusten-skl \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox