diff mbox series

perf: Improve build race/reproducibulity fixes

Message ID 20251013113416.511842-1-richard.purdie@linuxfoundation.org
State New
Headers show
Series perf: Improve build race/reproducibulity fixes | expand

Commit Message

Richard Purdie Oct. 13, 2025, 11:34 a.m. UTC
The include options shouldn't be needed with the make fix but issues still remained.
Looking at the logs, it looks like these are from other header directories and
we need to run "make install_headers" for all of the sub components before starting
the main build.

Update the workaround to do that for each component with internal header copies.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/recipes-kernel/perf/perf.bb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 3b9e52fdb84..1ac13e72690 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -105,7 +105,7 @@  EXTRA_OEMAKE = '\
     LDSHARED="${CC} -shared" \
     AR="${AR}" \
     LD="${LD}" \
-    EXTRA_CFLAGS="-ldw -I${S} -I${S}/libperf/include -I${S}/tools/lib/perf/include" \
+    EXTRA_CFLAGS="-ldw -I${S}" \
     YFLAGS='-y --file-prefix-map=${WORKDIR}=${TARGET_DBGSRC_DIR}' \
     EXTRA_LDFLAGS="${PERF_EXTRA_LDFLAGS}" \
     perfexecdir=${libexecdir} \
@@ -173,7 +173,11 @@  do_compile() {
             sed -i -e 's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/perf/Makefile.config
 	# There are two copies of internal headers such as:
 	# libperf/include/internal/xyarray.h and tools/lib/perf/include/internal/xyarray.h
-	# For reproducibile binaries, we need to find one copy, hence force libperf to be created first
+	# For reproducibile binaries, we need to find one copy, hence force libXXX to be created first
+	for i in api bpf subcmd symbol
+	do
+		oe_runmake -C ${S}/tools/lib/$i DESTDIR=${B}/lib$i prefix= install_headers V=1
+	done
 	oe_runmake ${B}/libperf/libperf.a V=1
 	oe_runmake all V=1
 }