From 0c2bc80926a1b7c30be34a5e1026ef4a4bac2c08 Mon Sep 17 00:00:00 2001 From: zhouwenpei Date: Fri, 30 Jul 2021 12:39:18 +0800 Subject: [PATCH] fix build with -fno-common --- fix-build-with-fno-common.patch | 44 +++++++++++++++++++++++++++++++++ lttng-ust.spec | 6 ++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 fix-build-with-fno-common.patch diff --git a/fix-build-with-fno-common.patch b/fix-build-with-fno-common.patch new file mode 100644 index 0000000..fd2905d --- /dev/null +++ b/fix-build-with-fno-common.patch @@ -0,0 +1,44 @@ +From 21a934df4c683e73e0a66a9afca33573fcf9d789 Mon Sep 17 00:00:00 2001 +From: Michael Jeanson +Date: Thu, 16 Jan 2020 10:59:14 -0500 +Subject: [PATCH] Fix: build with -fno-common + +GCC 10 will default to building with -fno-common, this inhibits the +linker from merging multiple tentative definitions of a symbol in an +archive. Keep only the declaration in the libustsnprintf.la convenience +library. + +Signed-off-by: Michael Jeanson +Signed-off-by: Mathieu Desnoyers +Change-Id: I8fb7c72811ce7e62f10342f55fcabeeabfdd4c67 +--- + liblttng-ust-ctl/ustctl.c | 2 -- + liblttng-ust-fd/lttng-ust-fd.c | 2 -- + 2 files changed, 4 deletions(-) + +diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c +index 949ece17a..c2b761a1b 100644 +--- a/liblttng-ust-ctl/ustctl.c ++++ b/liblttng-ust-ctl/ustctl.c +@@ -77,8 +77,6 @@ extern void lttng_ring_buffer_client_discard_exit(void); + extern void lttng_ring_buffer_client_discard_rt_exit(void); + extern void lttng_ring_buffer_metadata_client_exit(void); + +-volatile enum ust_loglevel ust_loglevel; +- + int ustctl_release_handle(int sock, int handle) + { + struct ustcomm_ust_msg lum; +diff --git a/liblttng-ust-fd/lttng-ust-fd.c b/liblttng-ust-fd/lttng-ust-fd.c +index 863f0618a..4818e02ed 100644 +--- a/liblttng-ust-fd/lttng-ust-fd.c ++++ b/liblttng-ust-fd/lttng-ust-fd.c +@@ -28,8 +28,6 @@ + #include + #include "usterr-signal-safe.h" + +-volatile enum ust_loglevel ust_loglevel; +- + static int (*__lttng_ust_fd_plibc_close)(int fd); + static int (*__lttng_ust_fd_plibc_fclose)(FILE *stream); + \ No newline at end of file diff --git a/lttng-ust.spec b/lttng-ust.spec index 4efa1e5..d927d6b 100644 --- a/lttng-ust.spec +++ b/lttng-ust.spec @@ -1,6 +1,6 @@ Name: lttng-ust Version: 2.10.1 -Release: 9 +Release: 10 Summary: LTTng Userspace Tracer library License: LGPLv2 and GPLv2 and MIT URL: https://lttng.org @@ -8,6 +8,7 @@ URL: https://lttng.org Source0: https://lttng.org/files/lttng-ust/%{name}-%{version}.tar.bz2 Patch0: Fix-namespace-our-gettid-wrapper.patch Patch1: lttng-gen-tp-shebang.patch +patch2: fix-build-with-fno-common.patch BuildRequires: libuuid-devel autoconf automake libtool BuildRequires: userspace-rcu-devel >= 0.8.0 @@ -60,6 +61,9 @@ make check %{_docdir}/%{name}/* %changelog +* Fri Jul 30 2021 zhouwenpei - 2.10.1-10 +- fix build with -fno-common + * Mon Nov 02 2020 xinghe - 2.10.1-9 - fix lttng-gen-tp command