From patchwork Mon Nov 30 08:46:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 106444 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.28750.1796028476762304728 for ; Mon, 30 Nov 2026 00:47:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20260707 header.b=caL/O8Us; spf=pass (domain: gmail.com, ip: 209.85.210.175, mailfrom: raj.khem@gmail.com) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-8c20d68c83fso5796508b3a.0 for ; Mon, 30 Nov 2026 00:47:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796028476; x=1796633276; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=bUnQj6O9BUF9XURlHexF+EzpzKbwzLPb7JdQxL/gaBM=; b=caL/O8Ush2gQADdYm3Py7JY4IYUgqYm0ylIVU8gmvL4AYkhHjP3hWDPd9TFvtFSG5q TMQ/Er/Qx+nYbwsthC88Y28G7FZCAAhAeArKlsej+ODnAoGfDjSCLLOUSF7+oqwnnf3B wfjXGBvBY0iiMzUBnabbCRG/zl+5Eh0dUXavn/bNyyHr4LfpwGgFXXFgKxJUDksJGMR2 dygDkX0oFGruaaAwBZ5lrGKrBaqKyZMJVkfUUb+MKKkxYDtLQtZWUMaXyFPWqUBpEKEW DlXstRr2FzzKsIFrfFzGS8L8q2iEHunRgECV8Cy0UVkdo6pL0gQU+SBa2bVJAdpiQqxX QCCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796028476; x=1796633276; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=bUnQj6O9BUF9XURlHexF+EzpzKbwzLPb7JdQxL/gaBM=; b=I21D4+V3EqcMryEEmVbxi52ET0f35rTPOezN60dM1a5wNS5zAneeCo4raBoeILfUxZ 5DaTaGF61mxBm8J2atNMF1hyqqw1fYH2RAWWareRoIlQjXpfsysFRrCr68PplDmLiNKu DJ7Bxt/cL4z4CEJBSnaLWnjmMzWT8zVqJ22aNnnzljIos2jyRV/D4xKPBAVsyq6C3ZmN xukyRwFqRh9YGtDEpQU1WR2LPT94NCpHeoT89uxa34LFzIsIbTqEG0TTyINRxinnN5Y5 WDTGd6v+Xkg15e6gll6S33I5+/GriM8sA9a2jZ8Cb6d9fX/iUb3DZ0v+X9RyaPKAKMng HsVQ== X-Gm-Message-State: APuU4Z/CUPiFk76T/BQMcq+FbT2B5qtpEHVpul4pe2OMwZP3qkis7R6K +QxqJ0iPx+A+/s6M3Mt8y1Rn4Y8pUnvu31A6eNQDfLOsITg5LycccIfBu5pjn2zE X-Gm-Gg: AZFdTZfC3MuFCyHGygMYEyeOunV5IYy6ODcDBggoBvH2xOyN/KZ8cZsSC7X3wg9sPGb 7rklFBQLjqMeNXmORD/q/osL7RmF2PEgHHKYSzQuJxD9LnO91Sv+cD27EXCP3r3MBZhZ11z9O6N qVhAR7k1UW6OTDkdq4ON40Su++PHMRxMjU4KKktNst7UCotM0xUddZCQ59Vs2V9HDp5uiUBvyq+ 4AbXwCEnncFhMnWpiD2L3YRdyMTkXzE968YZzRD3hkizGxiI7v6edt4CtYdIzm40wKhWDiwwRXZ Jwq7vrzEbNNbDHUwo7ONlUv8fZJwETJze8wNdbbFe+8DGBAgqIS7sZo8iW37WEKHDQgeIkKX4ew N1pGLwZgRfPEd8ZTrO6f9U+cbYjjeoU5lU61aHh1zoymx1mQckpH14UxG/8x3bagk8yyPnHneoS XLaXv03izlj2gY8sU3Bq5UXdKoxYjE4z71Z2dWqzGNTa/WHZjdcgH4MQa5/HtoOIaoi1m93rHGj QmAlQpV3gIRnAAyx51ViV7kqiE8IA8Q9tBaXdV2je+k/G+BpsRTIHdevSGHTukNwe/lqSy5C9LY jN0spxZBuZOiTPXSlauVtguaqfmBBI1e8+82Pd4HPdtSvt0wu5DQP4CX4h4EodlBG+uSz2wl7IR 35jj5PyDEHIL+LLFwS/d46Iyy6hRpEXk7FACaZ7HyHU7U6XImbE7oGtcE0SKOiQYVkTCJ66K9Hd akxzqTNFfTKmKHWFp30NGxzrfcoR4wD97rVrD0mCYMu2IkYLzFYer9N00zjvx+lPTQfdOef0DkP QoK4vAkdSv+zH/SgMDc3tbUfm99Ogc2ERTtOtEm9U8FU8PuQMVwr3ozRo+HjgiSDAw43mEAFRSJ ExtZ X-Received: by 2002:a05:6a00:b90:b0:884:831e:d0e3 with SMTP id d2e1a72fcca58-8c87cc43678mr22863387b3a.17.1796028476027; Mon, 30 Nov 2026 00:47:56 -0800 (PST) Return-Path: Received: from apollo.tail3ccdd3.ts.net ([147.160.63.35]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c872e45eccsm17553649b3a.31.2026.11.30.00.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 00:47:55 -0800 (PST) From: Khem Raj X-Google-Original-From: Khem Raj To: openembedded-devel@lists.openembedded.org Cc: Khem Raj Subject: [meta-oe][PATCH 69/72] coremark-pro: Fix races in parallel builds Date: Mon, 30 Nov 2026 00:46:40 -0800 Message-ID: <20261130084643.1500716-70-khem.raj@oss.qualcomm.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261130084643.1500716-1-khem.raj@oss.qualcomm.com> References: <20261130084643.1500716-1-khem.raj@oss.qualcomm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Mon, 30 Nov 2026 08:48:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/133506 The harness objects and the benchmark sub-builds are written into directories that are only sibling prerequisites of what gets built in them, so with make -j they can run first: Fatal error: can't create al/src/th_al.o: No such file or directory Make the directories order-only prerequisites. Reproduced with PARALLEL_MAKE = "-j 32 --shuffle=reverse", which fails without the patch and builds with it. AI-Generated: Uses Claude Code Signed-off-by: Khem Raj --- .../0002-Fix-races-in-parallel-builds.patch | 152 ++++++++++++++++++ .../coremark-pro/coremark-pro_git.bb | 4 +- 2 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-benchmark/coremark-pro/coremark-pro/0002-Fix-races-in-parallel-builds.patch diff --git a/meta-oe/recipes-benchmark/coremark-pro/coremark-pro/0002-Fix-races-in-parallel-builds.patch b/meta-oe/recipes-benchmark/coremark-pro/coremark-pro/0002-Fix-races-in-parallel-builds.patch new file mode 100644 index 0000000000..31a90196a6 --- /dev/null +++ b/meta-oe/recipes-benchmark/coremark-pro/coremark-pro/0002-Fix-races-in-parallel-builds.patch @@ -0,0 +1,152 @@ +From ab3a92769eaf6bcd0fd0580e057af579b5cf31e4 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 29 Nov 2026 08:21:49 -0800 +Subject: [PATCH] Fix races in parallel builds + +Object files and benchmark sub-builds are written into directories that +are only listed as sibling prerequisites of done.build or of the image, +so make -j can run them before the directories exist: + + Fatal error: can't create al/src/th_al.o: No such file or directory + cd .../obj/bench/core: No such file or directory + +Make the directories order-only prerequisites of what is built in them. +Reproducible with "make TARGET=linux64 -j16 --shuffle=reverse build". + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + mith/Makefile | 5 ++++- + workloads/cjpeg-rose7-preset/Makefile | 2 +- + workloads/core/Makefile | 2 +- + workloads/linear_alg-mid-100x100-sp/Makefile | 2 +- + workloads/loops-all-mid-10k-sp/Makefile | 2 +- + workloads/nnet_test/Makefile | 2 +- + workloads/parser-125k/Makefile | 2 +- + workloads/radix2-big-64k/Makefile | 2 +- + workloads/sha-test/Makefile | 2 +- + workloads/zip-test/Makefile | 2 +- + 10 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/mith/Makefile b/mith/Makefile +index faeaea1..4aa4066 100644 +--- a/mith/Makefile ++++ b/mith/Makefile +@@ -54,4 +54,7 @@ print-%: + @echo $* = $($*) + @echo [Defined at $(origin $*)] + +-$(TH_OBJS) : $(TH_HDRS) +\ No newline at end of file ++$(TH_OBJS) : $(TH_HDRS) ++ ++# Objects are written into $(MYDIRS); create them first for parallel builds ++$(TH_OBJS) $(TH_EXTRA_OBJS): | $(MYDIRS) +diff --git a/workloads/cjpeg-rose7-preset/Makefile b/workloads/cjpeg-rose7-preset/Makefile +index 8d09b49..8f44ecb 100644 +--- a/workloads/cjpeg-rose7-preset/Makefile ++++ b/workloads/cjpeg-rose7-preset/Makefile +@@ -67,6 +67,6 @@ $(IMAGE): $(MYDIRS) $(MYOBJD) $(LIB_TH) + $(MYDIRS): + $(MDIR) $@ + +-$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) ++$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) | $(DIR_BENCH)/% + cd $(DIR_BENCH)/$* && $(MAKE) -f $(TOPDIR)benchmarks/$*/$(KMPATH)Makefile build + +diff --git a/workloads/core/Makefile b/workloads/core/Makefile +index 4c1aedf..9da6f8b 100644 +--- a/workloads/core/Makefile ++++ b/workloads/core/Makefile +@@ -63,6 +63,6 @@ $(IMAGE): $(MYDIRS) $(MYOBJD) $(LIB_TH) + $(MYDIRS): + $(MDIR) $@ + +-$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) ++$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) | $(DIR_BENCH)/% + cd $(DIR_BENCH)/$* && $(MAKE) -f $(TOPDIR)benchmarks/$*/$(KMPATH)Makefile build + +diff --git a/workloads/linear_alg-mid-100x100-sp/Makefile b/workloads/linear_alg-mid-100x100-sp/Makefile +index df5d77d..910647f 100644 +--- a/workloads/linear_alg-mid-100x100-sp/Makefile ++++ b/workloads/linear_alg-mid-100x100-sp/Makefile +@@ -67,6 +67,6 @@ $(IMAGE): $(MYDIRS) $(MYOBJD) $(LIB_TH) + $(MYDIRS): + $(MDIR) $@ + +-$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) ++$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) | $(DIR_BENCH)/% + cd $(DIR_BENCH)/$* && $(MAKE) -f $(TOPDIR)benchmarks/$*/$(KMPATH)Makefile build + +diff --git a/workloads/loops-all-mid-10k-sp/Makefile b/workloads/loops-all-mid-10k-sp/Makefile +index 38113d0..a9557cf 100644 +--- a/workloads/loops-all-mid-10k-sp/Makefile ++++ b/workloads/loops-all-mid-10k-sp/Makefile +@@ -67,6 +67,6 @@ $(IMAGE): $(MYDIRS) $(MYOBJD) $(LIB_TH) + $(MYDIRS): + $(MDIR) $@ + +-$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) ++$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) | $(DIR_BENCH)/% + cd $(DIR_BENCH)/$* && $(MAKE) -f $(TOPDIR)benchmarks/$*/$(KMPATH)Makefile build + +diff --git a/workloads/nnet_test/Makefile b/workloads/nnet_test/Makefile +index 8f1b5ee..f3442d7 100644 +--- a/workloads/nnet_test/Makefile ++++ b/workloads/nnet_test/Makefile +@@ -63,6 +63,6 @@ $(IMAGE): $(MYDIRS) $(MYOBJD) $(LIB_TH) + $(MYDIRS): + $(MDIR) $@ + +-$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) ++$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) | $(DIR_BENCH)/% + cd $(DIR_BENCH)/$* && $(MAKE) -f $(TOPDIR)benchmarks/$*/$(KMPATH)Makefile build + +diff --git a/workloads/parser-125k/Makefile b/workloads/parser-125k/Makefile +index 2152a03..01ed094 100644 +--- a/workloads/parser-125k/Makefile ++++ b/workloads/parser-125k/Makefile +@@ -63,6 +63,6 @@ $(IMAGE): $(MYDIRS) $(MYOBJD) $(LIB_TH) + $(MYDIRS): + $(MDIR) $@ + +-$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) ++$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) | $(DIR_BENCH)/% + cd $(DIR_BENCH)/$* && $(MAKE) -f $(TOPDIR)benchmarks/$*/$(KMPATH)Makefile build + +diff --git a/workloads/radix2-big-64k/Makefile b/workloads/radix2-big-64k/Makefile +index 5856d73..a70db0e 100644 +--- a/workloads/radix2-big-64k/Makefile ++++ b/workloads/radix2-big-64k/Makefile +@@ -67,6 +67,6 @@ $(IMAGE): $(MYDIRS) $(MYOBJD) $(LIB_TH) + $(MYDIRS): + $(MDIR) $@ + +-$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) ++$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) | $(DIR_BENCH)/% + cd $(DIR_BENCH)/$* && $(MAKE) -f $(TOPDIR)benchmarks/$*/$(KMPATH)Makefile build + +diff --git a/workloads/sha-test/Makefile b/workloads/sha-test/Makefile +index 475d9b9..a977d52 100644 +--- a/workloads/sha-test/Makefile ++++ b/workloads/sha-test/Makefile +@@ -63,6 +63,6 @@ $(IMAGE): $(MYDIRS) $(MYOBJD) $(LIB_TH) + $(MYDIRS): + $(MDIR) $@ + +-$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) ++$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) | $(DIR_BENCH)/% + cd $(DIR_BENCH)/$* && $(MAKE) -f $(TOPDIR)benchmarks/$*/$(KMPATH)Makefile build + +diff --git a/workloads/zip-test/Makefile b/workloads/zip-test/Makefile +index d7744f0..cafb92a 100644 +--- a/workloads/zip-test/Makefile ++++ b/workloads/zip-test/Makefile +@@ -63,6 +63,6 @@ $(IMAGE): $(MYDIRS) $(MYOBJD) $(LIB_TH) + $(MYDIRS): + $(MDIR) $@ + +-$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) ++$(DIR_BENCH)/%/done.build: $(FORCE_REBUILD) | $(DIR_BENCH)/% + cd $(DIR_BENCH)/$* && $(MAKE) -f $(TOPDIR)benchmarks/$*/$(KMPATH)Makefile build + diff --git a/meta-oe/recipes-benchmark/coremark-pro/coremark-pro_git.bb b/meta-oe/recipes-benchmark/coremark-pro/coremark-pro_git.bb index e20708ece6..fde4303201 100644 --- a/meta-oe/recipes-benchmark/coremark-pro/coremark-pro_git.bb +++ b/meta-oe/recipes-benchmark/coremark-pro/coremark-pro_git.bb @@ -10,7 +10,9 @@ SRCREV = "4832cc67b0926c7a80a4b7ce0ce00f4640ea6bec" UPSTREAM_CHECK_COMMITS = "1" # Apply patch to allow cross-compilation -SRC_URI += "file://0001-allow-toolchain-override.patch" +SRC_URI += "file://0001-allow-toolchain-override.patch \ + file://0002-Fix-races-in-parallel-builds.patch \ + " inherit pkgconfig