From 0a886fcacaab0fbce1306c0f99d482f940a8f705 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 11 Sep 2025 12:36:12 +0100 Subject: [PATCH] perf: Fix reproducibility issue Perf's build process generates two copies of its internal headers, one at tools/lib/perf/include/internal and one at libperf/include/internal with files like xyarray.h. Although the files are identical, the binaries including them would see them at different paths and have different debuginfo data. To avoid this, build libperf.a first, which will ensure the libperf headers directory exists. This is used in preference to the other by the build process and results in consistent binaries. Signed-off-by: Richard Purdie --- meta/recipes-kernel/perf/perf.bb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb index b142b090b5..e1915207ee 100644 --- a/meta/recipes-kernel/perf/perf.bb +++ b/meta/recipes-kernel/perf/perf.bb @@ -171,6 +171,10 @@ do_compile() { sed -i -e 's|\$(libdir)/traceevent/plugins|\$(libdir)/traceevent_${KERNEL_VERSION}/plugins|g' ${S}/tools/lib/traceevent/plugins/Makefile test -e ${S}/tools/perf/Makefile.config && \ 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 + oe_runmake ${B}/libperf/libperf.a oe_runmake all } -- 2.47.3