From a6bb7644c80f8f2ae476c96172dfc996079a1422 Mon Sep 17 00:00:00 2001 From: wangqiang Date: Tue, 3 Sep 2024 15:45:14 +0800 Subject: [PATCH] Support for specified CC (cherry picked from commit b6e518e1a310e63051f4643fdc0a0d0db08cb3ee) --- fix-check-static-when-build-by-clang.patch | 11 +++++++++++ pcp.spec | 16 +++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 fix-check-static-when-build-by-clang.patch diff --git a/fix-check-static-when-build-by-clang.patch b/fix-check-static-when-build-by-clang.patch new file mode 100644 index 0000000..bdf96f6 --- /dev/null +++ b/fix-check-static-when-build-by-clang.patch @@ -0,0 +1,11 @@ +diff -Nur a/src/libpcp/src/check-statics b/src/libpcp/src/check-statics +--- a/src/libpcp/src/check-statics 2024-09-03 16:45:00.384830188 +0800 ++++ b/src/libpcp/src/check-statics 2024-09-03 16:46:04.184830354 +0800 +@@ -254,6 +254,7 @@ + ?__emutls_v.curcontext # thread private (*BSD, MinGW) + ?__emutls_t.curr_ctxp # thread private (*BSD, MinGW) + ?__emutls_t.curr_handle # thread private (*BSD, MinGW) ++ __pmDumpContext # llvm + + derive_fetch.o + ?promote # const diff --git a/pcp.spec b/pcp.spec index 92f35fd..a283620 100644 --- a/pcp.spec +++ b/pcp.spec @@ -2,12 +2,13 @@ Name: pcp Version: 6.2.2 -Release: 2 +Release: 3 Summary: System-level performance monitoring and performance management License: GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0 URL: https://pcp.io Source0: https://github.com/performancecopilot/pcp/archive/refs/tags/%{version}.tar.gz +Patch0: fix-check-static-when-build-by-clang.patch # The additional linker flags break out-of-tree PMDAs. # https://bugzilla.redhat.com/show_bug.cgi?id=2043092 @@ -2095,7 +2096,10 @@ updated policy package. %prep -%autosetup -p1 +%setup -q +%if "%{?toolchain}" == "clang" +%patch0 -p1 +%endif %build # the buildsubdir macro gets defined in %%setup and is apparently only available in the next step (i.e. the %%build step) @@ -2106,7 +2110,10 @@ _build=`echo %{release} | sed -e 's/\..*$//'` sed -i "/PACKAGE_BUILD/s/=[0-9]*/=$_build/" VERSION.pcp export PYTHON=python%{?default_python} -%configure %{?_with_initd} %{?_with_doc} %{?_with_dstat} %{?_with_ib} %{?_with_statsd} %{?_with_perfevent} %{?_with_bcc} %{?_with_bpf} %{?_with_bpftrace} %{?_with_json} %{?_with_mongodb} %{?_with_snmp} %{?_with_nutcracker} %{?_with_python2} +%if "%{?toolchain}" == "clang" +export HOSTCC=clang +%endif +%configure %{?_with_initd} %{?_with_doc} %{?_with_dstat} %{?_with_ib} %{?_with_statsd} %{?_with_perfevent} %{?_with_bcc} %{?_with_bpf} %{?_with_bpftrace} %{?_with_json} %{?_with_mongodb} %{?_with_snmp} %{?_with_nutcracker} %{?_with_python3} make %{?_smp_mflags} default_pcp pushd src/pmdas/bpf/modules @@ -3178,6 +3185,9 @@ fi %changelog +* Tue Sep 03 2024 wangqiang - 6.2.2-3 +- Support to build with clang + * Wed Jun 05 2024 Wenlong Zhang - 6.2.2-2 - fix build error for loongarch64 -- Gitee