qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Ani Sinha" <anisinha@redhat.com>
Subject: [PATCH v2 2/9] edk2: update build script
Date: Fri, 28 Nov 2025 09:45:09 +0100	[thread overview]
Message-ID: <20251128084524.363989-3-kraxel@redhat.com> (raw)
In-Reply-To: <20251128084524.363989-1-kraxel@redhat.com>

sync with https://gitlab.com/kraxel/edk2-build-config/

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 roms/edk2-build.py | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/roms/edk2-build.py b/roms/edk2-build.py
index e564765aaa71..c4bfbae4cffb 100755
--- a/roms/edk2-build.py
+++ b/roms/edk2-build.py
@@ -51,7 +51,17 @@ def get_toolchain(cfg, build):
         return cfg[build]['tool']
     if cfg.has_option('global', 'tool'):
         return cfg['global']['tool']
-    return 'GCC5'
+    return 'GCC'
+
+def get_hostarch():
+    mach = os.uname().machine
+    if mach == 'x86_64':
+        return 'X64'
+    if mach == 'aarch64':
+        return 'AARCH64'
+    if mach == 'riscv64':
+        return 'RISCV64'
+    return 'UNKNOWN'
 
 def get_version(cfg, silent = False):
     coredir = get_coredir(cfg)
@@ -137,7 +147,7 @@ def build_run(cmdline, name, section, silent = False, nologs = False):
             print(f'### exit code: {result.returncode}')
         else:
             secs = int(time.time() - start)
-            print(f'### OK ({int(secs/60)}:{secs%60:02d})')
+            print(f'### OK ({int(secs)}sec)')
     else:
         print(cmdline, flush = True)
         result = subprocess.run(cmdline, check = False)
@@ -191,7 +201,10 @@ def build_one(cfg, build, jobs = None, silent = False, nologs = False):
     if jobs:
         cmdline += [ '-n', jobs ]
     for arch in b['arch'].split():
-        cmdline += [ '-a', arch ]
+        if arch == 'HOST':
+            cmdline += [ '-a', get_hostarch() ]
+        else:
+            cmdline += [ '-a', arch ]
     if 'opts' in b:
         for name in b['opts'].split():
             section = 'opts.' + name
@@ -235,7 +248,7 @@ def build_one(cfg, build, jobs = None, silent = False, nologs = False):
 
 def build_basetools(silent = False, nologs = False):
     build_message('building: BaseTools', silent = silent)
-    basedir = os.environ['EDK_TOOLS_PATH']
+    basedir = os.environ['EDK_TOOLS_PATH'] + '/Source/C'
     cmdline = [ 'make', '-C', basedir ]
     build_run(cmdline, 'BaseTools', 'build.basetools', silent, nologs)
 
-- 
2.52.0



  parent reply	other threads:[~2025-11-28  8:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-28  8:45 [PATCH v2 0/9] edk2: update to edk2-stable202511 Gerd Hoffmann
2025-11-28  8:45 ` [PATCH v2 1/9] tests/acpi: enable updates Gerd Hoffmann
2025-11-28  8:45 ` Gerd Hoffmann [this message]
2025-11-28 13:00   ` [PATCH v2 2/9] edk2: update build script Philippe Mathieu-Daudé
2025-11-28  8:45 ` [PATCH v2 3/9] edk2: update submodule to edk2-stable202511 Gerd Hoffmann
2025-11-28 12:59   ` Philippe Mathieu-Daudé
2025-11-28  8:45 ` [PATCH v2 4/9] edk2: drop 32-bit build config (ia32 and arm), update aarch64 vars Gerd Hoffmann
2025-11-28 12:59   ` Philippe Mathieu-Daudé
2025-11-28  8:45 ` [PATCH v2 7/9] edk2: rename risc-v firmware builds Gerd Hoffmann
2025-11-28 12:52   ` Philippe Mathieu-Daudé
2025-11-28  8:45 ` [PATCH v2 8/9] tests/acpi: update expected data files Gerd Hoffmann
2025-11-28  8:45 ` [PATCH v2 9/9] tests/acpi: disable updates Gerd Hoffmann
     [not found] ` <20251128084524.363989-6-kraxel@redhat.com>
2025-11-28 12:57   ` [PATCH v2 5/9] edk2: drop 32-bit binaries (ia32 and arm) Philippe Mathieu-Daudé
2025-11-28 13:33 ` [PATCH v2 0/9] edk2: update to edk2-stable202511 Igor Mammedov
2025-11-28 13:34   ` Igor Mammedov

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-all 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=20251128084524.363989-3-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=anisinha@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).