libtraceevent: build with Meson
PATCH 1/1 libtraceevent: build with Meson
From: Ross Burton <[email protected]>
After what I presume is the recent kernel upgrade, perf started to fail to configure. This was actually due to libtraceevent racing during its build and failing to put one of the .o files into the .so (reminder:
Make is terrible). This doesn't cause the libtraceevent build to fail so once the broken .so is in sstate, it causes all future perf builds to fail.
Instead of rewriting the Makefile rules to fix this race it's easier to switch to Meson which doesn't have this sort of problem. However the Meson support is pretty new and has some rough edges, so we need a patch to make it do the right thing.
I will submit the libtraceevent fixes upstream shortly.
[ YOCTO #15201 ]
--- ...not-preserve-ownership-in-cp-command.patch | 40 ---------- .../libtraceevent/libtraceevent/meson.patch | 74 +++++++++++++++++++ .../libtraceevent/libtraceevent_1.7.3.bb | 10 +-- 3 files changed, 77 insertions(+), 47 deletions(-) delete mode 100644 meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch create mode 100644 meta/recipes-kernel/libtraceevent/libtraceevent/meson.patch
meta/recipes-kernel/libtraceevent/libtraceevent/0001-makefile-Do-not-preserve-ownership-in-cp-command.patch deleted +0 -40
@@ -1,40 +0,0 @@ -From ed0a31000305d937abe47c44d705b5b52bb36f79 Mon Sep 17 00:00:00 2001 -From: Khem Raj <[email protected]> -Date: Thu, 22 Dec 2022 18:32:17 -0800 -Subject: [PATCH] makefile: Do not preserve ownership in cp command - -Fixes - -ERROR: libtraceevent-1.7.0-r0 do_package_qa: QA Issue: libtraceevent: /usr/lib/libtraceevent.a is owned by uid 1000, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated] - -Upstream-Status: Pending -Signed-off-by: Khem Raj <[email protected]> ---- - Makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Makefile b/Makefile -index 965ff47..0e782cb 100644 ---- a/Makefile -+++ b/Makefile -@@ -287,7 +287,7 @@ $(BUILD_PREFIX): force - $(Q)$(call build_prefix,$(prefix)) - - define do_make_pkgconfig_file -- cp -f ${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE}; \ -+ install -m 0644 ${PKG_CONFIG_SOURCE_FILE}.template ${PKG_CONFIG_FILE}; \ - sed -i "s|INSTALL_PREFIX|${1}|g" ${PKG_CONFIG_FILE}; \ - sed -i "s|LIB_VERSION|${EVENT_PARSE_VERSION}|g" ${PKG_CONFIG_FILE}; \ - sed -i "s|LIB_DIR|${libdir_relative}|g" ${PKG_CONFIG_FILE}; \ -@@ -335,7 +335,7 @@ install: install_libs install_plugins - - install_libs: libs install_headers install_pkgconfig - $(Q)$(call do_install,$(LIBTRACEEVENT_SHARED),$(libdir_SQ)); \ -- cp -fpR $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ) -+ cp --no-preserve=ownership --recursive $(LIB_INSTALL) $(DESTDIR)$(libdir_SQ) - $(Q)$(call install_ld_config) - - install_pkgconfig: $(PKG_CONFIG_FILE) --- -2.39.0 -
meta/recipes-kernel/libtraceevent/libtraceevent/meson.patch new file +74 -0
74 lines not on this page · raw message
meta/recipes-kernel/libtraceevent/libtraceevent_1.7.3.bb +3 -7
@@ -10,17 +10,13 @@ SECTION = "libs" SRCREV = "dd148189b74da3e2f45c7e536319fec97cb71213" SRC_URI = "git://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git;branch=${BPN};protocol=https \ - file://0001-makefile-Do-not-preserve-ownership-in-cp-command.patch" + file://meson.patch" S = "${WORKDIR}/git" -export EXTRA_CFLAGS = "${CFLAGS}" +inherit meson pkgconfig -inherit pkgconfig - -do_install() { - oe_runmake install DESTDIR=${D} pkgconfig_dir=${libdir}/pkgconfig -} +EXTRA_OEMESON = "-Ddocs=false" PACKAGES += "${PN}-plugins"
Signature · 1 line
2.34.1
Hello,
Quoted 14 lines · On Sun, 27 Aug 2023 20:57:44 +0100 "Ross Burton" <[email protected]> wrote:
From: Ross Burton <[email protected]>
After what I presume is the recent kernel upgrade, perf started to fail to configure. This was actually due to libtraceevent racing during its build and failing to put one of the .o files into the .so (reminder:
Make is terrible). This doesn't cause the libtraceevent build to fail so once the broken .so is in sstate, it causes all future perf builds to fail.Instead of rewriting the
Makefilerules to fix this race it's easier to switch to Meson which doesn't have this sort of problem. However the Meson support is pretty new and has some rough edges, so we need a patch to make it do the right thing.
Quoted 5 lines
I will submit the libtraceevent fixes upstream shortly.
[ YOCTO #15201 ]
Signed-off-by Ross Burton <[email protected]>
The build I had run and that had been consistently failing has succeeded after applying this patch!
Signature · 3 lines
Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com