From: "Martin Hundebøll" <martin@geanix.com>
To: openembedded-core@lists.openembedded.org
Cc: "Alexander Kanavin" <alex.kanavin@gmail.com>,
"Khem Raj" <raj.khem@gmail.com>,
"Randy MacLeod" <randy.macleod@windriver.com>,
"Martin Hundebøll" <martin@geanix.com>
Subject: [PATCH 4/5] qemu: enable parallel builds when using the jobserver class
Date: Wed, 3 Apr 2024 09:02:03 +0200 [thread overview]
Message-ID: <20240403070204.367470-5-martin@geanix.com> (raw)
In-Reply-To: <20240403070204.367470-1-martin@geanix.com>
If the jobserver class is enabled, the PARALLEL_MAKE variable is unset in
favor of configuring a shared jobserver in the MAKEFLAGS variable. However,
the qemu makefile translates the missing `-j<N>` argument to `-j1` when
calling into meson / ninja. Add a patch to make the qemu makefile
consider the --jobserver-auth option too.
Signed-off-by: Martin Hundebøll <martin@geanix.com>
---
meta/recipes-devtools/qemu/qemu.inc | 1 +
...e-jobserver-auth-argument-when-calli.patch | 37 +++++++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 meta/recipes-devtools/qemu/qemu/0013-Makefile-preserve-jobserver-auth-argument-when-calli.patch
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 4501f84c2b..1f86bf5a44 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -39,6 +39,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
file://0003-linux-user-Add-strace-for-shmat.patch \
file://0004-linux-user-Rewrite-target_shmat.patch \
file://0005-tests-tcg-Check-that-shmat-does-not-break-proc-self-.patch \
+ file://0013-Makefile-preserve-jobserver-auth-argument-when-calli.patch \
file://CVE-2023-6683.patch \
file://qemu-guest-agent.init \
file://qemu-guest-agent.udev \
diff --git a/meta/recipes-devtools/qemu/qemu/0013-Makefile-preserve-jobserver-auth-argument-when-calli.patch b/meta/recipes-devtools/qemu/qemu/0013-Makefile-preserve-jobserver-auth-argument-when-calli.patch
new file mode 100644
index 0000000000..33db8b7ddc
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/0013-Makefile-preserve-jobserver-auth-argument-when-calli.patch
@@ -0,0 +1,37 @@
+From 730530c5f01e00cdc3754ebb8f3d7ff995f3376e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Martin=20Hundeb=C3=B8ll?= <martin@geanix.com>
+Date: Thu, 21 Sep 2023 10:57:45 +0200
+Subject: [PATCH] Makefile: preserve --jobserver-auth argument when calling
+ ninja
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Qemu wraps its call to ninja in a Makefile. Since ninja, as opposed to
+make, utilizes all CPU cores by default, the qemu Makefile translates
+the absense of a `-jN` argument into `-j1`. This breaks jobserver
+functionality, so update the -jN mangling to take the --jobserver-auth
+argument into considerationa too.
+
+Signed-off-by: Martin Hundebøll <martin@geanix.com>
+Upstream-Status: Submitted [https://gitlab.com/qemu-project/qemu/-/issues/1898]
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 8f36990335..183756018f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -142,7 +142,7 @@ MAKE.k = $(findstring k,$(firstword $(filter-out --%,$(MAKEFLAGS))))
+ MAKE.q = $(findstring q,$(firstword $(filter-out --%,$(MAKEFLAGS))))
+ MAKE.nq = $(if $(word 2, $(MAKE.n) $(MAKE.q)),nq)
+ NINJAFLAGS = $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \
+- $(filter-out -j, $(lastword -j1 $(filter -l% -j%, $(MAKEFLAGS)))) \
++ $(or $(filter -l% -j%, $(MAKEFLAGS)), $(if $(filter --jobserver-auth=%, $(MAKEFLAGS)),, -j1)) \
+ -d keepdepfile
+ ninja-cmd-goals = $(or $(MAKECMDGOALS), all)
+ ninja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g))
+--
+2.44.0
+
--
2.44.0
next prev parent reply other threads:[~2024-04-03 7:02 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 7:01 [PATCH 0/5] Jobserver support Martin Hundebøll
2024-04-03 7:02 ` [PATCH 1/5] classes: jobserver: support gnu make fifo jobserver Martin Hundebøll
2024-04-04 7:56 ` [OE-core] " Andreas Helbech Kleist
2024-04-04 7:58 ` Martin Hundebøll
2024-04-03 7:02 ` [PATCH 2/5] scripts: build-env: allow passing JOBSERVER_FIFO from environment Martin Hundebøll
2024-04-03 7:02 ` [PATCH 3/5] ninja: build modified version with GNU Make jobserver support Martin Hundebøll
2024-04-03 7:26 ` Patchtest results for " patchtest
2024-04-03 15:58 ` Alexander Kanavin
2024-04-03 19:08 ` Martin Hundebøll
2024-04-08 21:39 ` Randy MacLeod
2024-05-18 7:13 ` Martin Hundebøll
2024-04-03 7:02 ` Martin Hundebøll [this message]
2024-04-03 7:02 ` [PATCH 5/5] contrib: add python service and systemd unit to run shared jobserver Martin Hundebøll
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=20240403070204.367470-5-martin@geanix.com \
--to=martin@geanix.com \
--cc=alex.kanavin@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=raj.khem@gmail.com \
--cc=randy.macleod@windriver.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.