]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
perf: Fix reproducibility issue
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 11 Sep 2025 11:36:12 +0000 (12:36 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 12 Sep 2025 09:30:50 +0000 (10:30 +0100)
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 <richard.purdie@linuxfoundation.org>
meta/recipes-kernel/perf/perf.bb

index b142b090b55a58ae0ca9d29227a89630a2694d20..e1915207eed2a0834a1fca62b6786f0784a27002 100644 (file)
@@ -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
 }