!14 [sync] PR-13: Support build with clang

From: @openeuler-sync-bot 
Reviewed-by: @caodongxia 
Signed-off-by: @caodongxia
This commit is contained in:
openeuler-ci-bot 2024-03-29 03:00:43 +00:00 committed by Gitee
commit 01a6558fb9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From e190d749ee2d77acea0feadd628a793f9648c2c8 Mon Sep 17 00:00:00 2001
From: luofeng <luofeng13@huawei.com>
Date: Thu, 28 Mar 2024 16:29:04 +0800
Subject: [PATCH] support clang build
---
src/gcore.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gcore.mk b/src/gcore.mk
index 9f3d56e..7da33c5 100644
--- a/src/gcore.mk
+++ b/src/gcore.mk
@@ -112,11 +112,11 @@ gcore.so: gcore.c $(INCDIR)/defs.h
echo "gcore: architecture not supported"; \
else \
make -f gcore.mk $(GCORE_OFILES) && \
- gcc $(RPM_OPT_FLAGS) $(CFLAGS) $(TARGET_CFLAGS) $(COMMON_CFLAGS) $(ARCH_CFLAGS) -nostartfiles -shared -rdynamic $(GCORE_OFILES) -Wl,-soname,$@ -o $@ $< ; \
+ $(CC) $(RPM_OPT_FLAGS) $(CFLAGS) $(TARGET_CFLAGS) $(COMMON_CFLAGS) $(ARCH_CFLAGS) -nostartfiles -shared -rdynamic $(GCORE_OFILES) -Wl,-soname,$@ -o $@ $< ; \
fi;
%.o: %.c $(INCDIR)/defs.h
- gcc $(RPM_OPT_FLAGS) $(CFLAGS) $(TARGET_CFLAGS) $(COMMON_CFLAGS) $(ARCH_CFLAGS) -c -o $@ $<
+ $(CC) $(RPM_OPT_FLAGS) $(CFLAGS) $(TARGET_CFLAGS) $(COMMON_CFLAGS) $(ARCH_CFLAGS) -c -o $@ $<
clean:
rm -f gcore.so
--
2.19.1

View File

@ -1,7 +1,7 @@
%global reponame crash-gcore %global reponame crash-gcore
Name: crash-gcore-command Name: crash-gcore-command
Version: 1.6.4 Version: 1.6.4
Release: 2 Release: 3
Summary: Command of Gcore for Crash utility Summary: Command of Gcore for Crash utility
License: GPLv2 License: GPLv2
@ -17,6 +17,7 @@ Patch1: 0001-add-stdbool.h-to-fix-build-error.patch
%ifarch riscv64 %ifarch riscv64
Patch2: 0002-add-riscv64-support.patch Patch2: 0002-add-riscv64-support.patch
%endif %endif
Patch3: 0003-support-clang-build.patch
%description %description
The crash-gcore-command packages contain an extension module for the crash utility The crash-gcore-command packages contain an extension module for the crash utility
@ -38,6 +39,9 @@ install -D %{_builddir}/%{reponame}-%{version}/src/gcore.so %{buildroot}%{_libdi
%{_libdir}/crash/extensions/gcore.so %{_libdir}/crash/extensions/gcore.so
%changelog %changelog
* Fri Mar 1 2024 luofeng <luofeng13@huawei.com> - 1.6.4-3
- support clang build
* Wed Jul 12 2023 EastDong <xudong23@iscas.ac.cn> - 1.6.4-2 * Wed Jul 12 2023 EastDong <xudong23@iscas.ac.cn> - 1.6.4-2
- add riscv64 support - add riscv64 support