From 2b7588e49ff35223fca581f93952ffcaf1f6db3e Mon Sep 17 00:00:00 2001 From: luofeng14 Date: Thu, 28 Mar 2024 08:43:11 +0000 Subject: [PATCH] support clang build Signed-off-by: luofeng14 (cherry picked from commit 182f4ea456b0099ce8821bfa5f0cc3bf65519694) --- 0003-support-clang-build.patch | 30 ++++++++++++++++++++++++++++++ crash-gcore-command.spec | 6 +++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0003-support-clang-build.patch diff --git a/0003-support-clang-build.patch b/0003-support-clang-build.patch new file mode 100644 index 0000000..686b948 --- /dev/null +++ b/0003-support-clang-build.patch @@ -0,0 +1,30 @@ +From e190d749ee2d77acea0feadd628a793f9648c2c8 Mon Sep 17 00:00:00 2001 +From: luofeng +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 + diff --git a/crash-gcore-command.spec b/crash-gcore-command.spec index 773e69b..ca68400 100644 --- a/crash-gcore-command.spec +++ b/crash-gcore-command.spec @@ -1,7 +1,7 @@ %global reponame crash-gcore Name: crash-gcore-command Version: 1.6.4 -Release: 2 +Release: 3 Summary: Command of Gcore for Crash utility License: GPLv2 @@ -17,6 +17,7 @@ Patch1: 0001-add-stdbool.h-to-fix-build-error.patch %ifarch riscv64 Patch2: 0002-add-riscv64-support.patch %endif +Patch3: 0003-support-clang-build.patch %description 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 %changelog +* Fri Mar 1 2024 luofeng - 1.6.4-3 +- support clang build + * Wed Jul 12 2023 EastDong - 1.6.4-2 - add riscv64 support