!121 [sync] PR-118: support building with clang

From: @openeuler-sync-bot 
Reviewed-by: @wk333 
Signed-off-by: @wk333
This commit is contained in:
openeuler-ci-bot 2024-09-03 11:08:32 +00:00 committed by Gitee
commit b8f49c962b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 24 additions and 3 deletions

View File

@ -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

View File

@ -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 <wangqiang1@kylinos.cn> - 6.2.2-3
- Support to build with clang
* Wed Jun 05 2024 Wenlong Zhang <zhangwenlong@loongson.cn> - 6.2.2-2
- fix build error for loongarch64