From 5933590dad978f4252830ae7d8de62368f84bb8a Mon Sep 17 00:00:00 2001 From: zhoujing Date: Wed, 27 Sep 2023 17:08:45 +0800 Subject: [PATCH] fix core_stacktrace test fail when using clang --- ...uit-core_stacktrace-fail-using-clang.patch | 29 +++++++++++++++++++ satyr.spec | 7 ++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 fix-test-suit-core_stacktrace-fail-using-clang.patch diff --git a/fix-test-suit-core_stacktrace-fail-using-clang.patch b/fix-test-suit-core_stacktrace-fail-using-clang.patch new file mode 100644 index 0000000..7c9e7c2 --- /dev/null +++ b/fix-test-suit-core_stacktrace-fail-using-clang.patch @@ -0,0 +1,29 @@ +From 675c206efeeb2aa29c4ad0dcb4944893c593f2e1 Mon Sep 17 00:00:00 2001 +From: Alex <1132174766@qq.com> +Date: Thu, 21 Sep 2023 16:59:22 +0800 +Subject: [PATCH] Fix test suit core_stacktrace fail using clang + +Use predefined macros`__clang__` to distinguish between clang and gcc to make sure the correct optimization attribute. +--- + tests/dump_core.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tests/dump_core.c b/tests/dump_core.c +index c22f57e..82314e1 100644 +--- a/tests/dump_core.c ++++ b/tests/dump_core.c +@@ -15,7 +15,11 @@ + + static char const *prefix = "/tmp/satyr.core"; + ++#if __clang__ ++__attribute__((optnone)) ++#else + __attribute__((optimize((0)))) ++#endif + int + dump_core(int depth, + char **name) +-- +2.27.0 + diff --git a/satyr.spec b/satyr.spec index 49600fd..bec24d0 100644 --- a/satyr.spec +++ b/satyr.spec @@ -2,12 +2,14 @@ Name: satyr Version: 0.42 -Release: 1 +Release: 2 Summary: Tools to create anonymous, machine-friendly problem reports License: GPLv2+ URL: https://github.com/abrt/satyr Source0: https://github.com/abrt/%{name}/archive/%{version}.tar.gz +Patch01: fix-test-suit-core_stacktrace-fail-using-clang.patch + Requires: json-c nettle glib2 >= 2.43.4 BuildRequires: elfutils-devel elfutils-libelf-devel binutils-devel rpm-devel BuildRequires: doxygen pkgconfig automake gcc-c++ git libtool @@ -103,6 +105,9 @@ make check|| { %{_mandir}/* %changelog +* Wed Sep 27 2023 zhoujing - 0.42-2 +- fix core_stacktrace test fail when using clang + * Mon Jul 17 2023 zhangpan - 0.42-1 - update to 0.42 -- Gitee