From e1ac5c3e1c379bd02bf44d6635820853be7739f1 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Mon, 27 Oct 2025 12:01:07 +0800 Subject: [PATCH] build with meson (cherry picked from commit 04f247e1403f50228e8f9aeb263a202e57c675f9) --- ...-fix-missing-fstack-protector-strong.patch | 26 ---------- ...Various-fixes-for-the-Meson-build-of.patch | 52 +++++++++++++++++++ libtraceevent.spec | 37 +++++++------ 3 files changed, 72 insertions(+), 43 deletions(-) delete mode 100644 0001-fix-missing-fstack-protector-strong.patch create mode 100644 backport-libtraceevent-build-Various-fixes-for-the-Meson-build-of.patch diff --git a/0001-fix-missing-fstack-protector-strong.patch b/0001-fix-missing-fstack-protector-strong.patch deleted file mode 100644 index ef85098..0000000 --- a/0001-fix-missing-fstack-protector-strong.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/Makefile b/Makefile -index 41ad866..20ae048 100644 ---- a/Makefile -+++ b/Makefile -@@ -127,7 +127,7 @@ export LIBTRACEEVENT_STATIC LIBTRACEEVENT_SHARED EP_HEADERS_DIR - ifdef EXTRA_CFLAGS - CFLAGS := $(EXTRA_CFLAGS) - else -- CFLAGS := -g -Wall -+ CFLAGS := -g -Wall -fstack-protector-strong - endif - - LIBS ?= -ldl -diff --git a/plugins/Makefile b/plugins/Makefile -index 4c8cb17..56b5646 100644 ---- a/plugins/Makefile -+++ b/plugins/Makefile -@@ -68,7 +68,7 @@ INCLUDES = -I. -I.. -I../src -I $(srctree)/include -I $(EP_HEADERS_DIR) $(CONFIG - ifdef EXTRA_CFLAGS - CFLAGS := $(EXTRA_CFLAGS) - else -- CFLAGS := -g -Wall -+ CFLAGS := -g -Wall -fstack-protector-strong - endif - - # Append required CFLAGS diff --git a/backport-libtraceevent-build-Various-fixes-for-the-Meson-build-of.patch b/backport-libtraceevent-build-Various-fixes-for-the-Meson-build-of.patch new file mode 100644 index 0000000..19a22c1 --- /dev/null +++ b/backport-libtraceevent-build-Various-fixes-for-the-Meson-build-of.patch @@ -0,0 +1,52 @@ +From 60ed6c392121f5cd9992c7130abc99e673e57358 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Mon, 11 Mar 2024 12:11:40 +0100 +Subject: libtraceevent: build: Various fixes for the Meson build of + libtraceevent + +- Make the plugin directory the same as the Makefiles +- Install the plugins as modules not static and versioned shared libraries + +Link: https://lore.kernel.org/linux-trace-devel/20240311111140.1789879-1-alex@linutronix.de + +Signed-off-by: Ross Burton +Signed-off-by: Alexander Kanavin +Signed-off-by: Steven Rostedt (Google) +--- + meson.build | 2 +- + plugins/meson.build | 3 +-- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/meson.build b/meson.build +index 40ce38c..1eb7912 100644 +--- a/meson.build ++++ b/meson.build +@@ -25,7 +25,7 @@ htmldir = join_paths(prefixdir, get_option('htmldir')) + libdir = join_paths(prefixdir, get_option('libdir')) + plugindir = get_option('plugindir') + if plugindir == '' +- plugindir = join_paths(libdir, 'libtraceevent/plugins') ++ plugindir = join_paths(libdir, 'traceevent/plugins') + endif + + add_project_arguments( +diff --git a/plugins/meson.build b/plugins/meson.build +index 74ad664..4919be4 100644 +--- a/plugins/meson.build ++++ b/plugins/meson.build +@@ -19,11 +19,10 @@ plugins = [ + + pdeps = [] + foreach plugin : plugins +- pdeps += library( ++ pdeps += shared_module( + plugin.replace('.c', ''), + plugin, + name_prefix: '', +- version: library_version, + dependencies: [libtraceevent_dep], + include_directories: [incdir], + install: true, +-- +cgit 1.2.3-korg + diff --git a/libtraceevent.spec b/libtraceevent.spec index 27c1418..7d000b1 100644 --- a/libtraceevent.spec +++ b/libtraceevent.spec @@ -1,17 +1,17 @@ -Name: libtraceevent -Version: 1.8.2 -Release: 2 -License: LGPLv2+ and GPLv2+ -Summary: Library to parse raw trace event formats +Name: libtraceevent +Version: 1.8.2 +Release: 3 +License: LGPL-2.1-only AND LGPL-2.1-or-later AND GPL-2.0-only AND GPL-2.0-or-later +Summary: Library to parse raw trace event formats -URL: https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ -Source0: https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/libtraceevent-%{version}.tar.gz +URL: https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ +Source0: https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/libtraceevent-%{version}.tar.gz +Patch6001: backport-libtraceevent-build-Various-fixes-for-the-Meson-build-of.patch -Patch0000: 0001-fix-missing-fstack-protector-strong.patch - -BuildRequires: gcc -BuildRequires: xmlto -BuildRequires: asciidoc +BuildRequires: meson +BuildRequires: gcc +BuildRequires: xmlto +BuildRequires: asciidoc Conflicts: perf < 6.2.0 @@ -31,13 +31,13 @@ Development headers of %{name}-libs %autosetup -n %{name}-%{version} -p1 %build -MANPAGE_DOCBOOK_XSL=`rpm -ql docbook-style-xsl | grep manpages/docbook.xsl` -# Parallel build does not work -make -O -j1 V=1 VERBOSE=1 CFLAGS="%{build_cflags}" LDFLAGS="%{build_ldflags}" prefix=%{_prefix} libdir=%{_libdir} MANPAGE_XSL=%{MANPAGE_DOCBOOK_XSL} all doc +%meson +%meson_build +%meson_build docs %install -%make_install prefix=%{_prefix} libdir=%{_libdir} install doc-install -rm -rf %{buildroot}/%{_libdir}/libtraceevent.a +%meson_install +rm -f %{buildroot}%{_libdir}/*.a %files %license LICENSES/LGPL-2.1 @@ -57,6 +57,9 @@ rm -rf %{buildroot}/%{_libdir}/libtraceevent.a %{_libdir}/pkgconfig/libtraceevent.pc %changelog +* Mon Oct 27 2025 Funda Wang - 1.8.2-3 +- build with meson + * Wed Dec 25 2024 xu_ping <707078654@qq.com> - 1.8.2-2 - add conflict perf version. -- Gitee