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 0000000000000000000000000000000000000000..bdf96f6c0fb4022432a69450fde46955f142d4e5 --- /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 92f35fd9340e8d88aa642ac9ea8bc9bfee582512..a283620a598993bd02aa81e80087f6005992170a 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