diff --git a/libunwind-no-dl-iterate-phdr.patch b/libunwind-no-dl-iterate-phdr.patch new file mode 100644 index 0000000000000000000000000000000000000000..b236065c76e6867f8bd3822f255824b977cfd3ff --- /dev/null +++ b/libunwind-no-dl-iterate-phdr.patch @@ -0,0 +1,25 @@ +This patch disables building of the (effectively empty) +dl-iterate-phdr.c source file. Symbols generated by annobin confuse +the run-check-namespace test because nm -g prints hidden weak symbols +in DSOs (they are considered external): + + ERROR: Extraneous symbols: +000000000000de51 W dl_iterate_phdr.c.a8d8d212 + ERROR: Extraneous symbols: +00000000000120b0 W dl_iterate_phdr.c.a8d8d212 + +This patch is downstream-specific due to annobin. + +diff --git a/src/Makefile.am b/src/Makefile.am +index 2b5b02959e99eb8f..e5ff21515c36d30f 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -147,7 +147,7 @@ libunwind_la_SOURCES_local = \ + $(libunwind_la_SOURCES_local_unwind) + + noinst_HEADERS += os-linux.h +-libunwind_la_SOURCES_os_linux = os-linux.c dl-iterate-phdr.c ++libunwind_la_SOURCES_os_linux = os-linux.c + + libunwind_la_SOURCES_os_hpux = os-hpux.c + diff --git a/libunwind-skip-no-coredump.patch b/libunwind-skip-no-coredump.patch new file mode 100644 index 0000000000000000000000000000000000000000..313fdc998d5ca03340aa4b46af3caf40b1c77c95 --- /dev/null +++ b/libunwind-skip-no-coredump.patch @@ -0,0 +1,28 @@ +From fedff5ac77c945fc0c5df534074163a784bfa5b3 Mon Sep 17 00:00:00 2001 +From: Florian Weimer +Date: Wed, 7 Sep 2022 14:01:36 +0200 +Subject: [PATCH] tests/run-coredump-unwind: Skip test if no coredump has been + created + +In some build environments, coredumps are not created even if the +corresponding ulimit is positive. This change skips the test if +the coredump is missing. +--- + tests/run-coredump-unwind | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/tests/run-coredump-unwind b/tests/run-coredump-unwind +index ddaac6a43..690362bda 100755 +--- a/tests/run-coredump-unwind ++++ b/tests/run-coredump-unwind +@@ -48,6 +48,10 @@ fi + ./crasher backing_files + ) 2>/dev/null + COREFILE=$TEMPDIR/core* ++if ! test -f "$COREFILE"; then ++ echo "crasher process did not produce coredump, test skipped" ++ exit 77 ++fi + + # magic option -testcase enables checking for the specific contents of the stack + ./test-coredump-unwind $COREFILE -testcase `cat $TEMPDIR/backing_files` diff --git a/libunwind.spec b/libunwind.spec index 3434f59dc60e2590cfc7fe833cf1df0a88061b6d..c6832fa3b3a8623342dc5c5ce6dd026dc6cfad3e 100644 --- a/libunwind.spec +++ b/libunwind.spec @@ -7,10 +7,14 @@ License: BSD URL: http://savannah.nongnu.org/projects/libunwind Source: http://download-mirror.savannah.gnu.org/releases/libunwind/libunwind-%{version}.tar.gz +Patch1: libunwind-skip-no-coredump.patch +Patch2: libunwind-no-dl-iterate-phdr.patch + ExclusiveArch: aarch64 x86_64 BuildRequires: automake libtool autoconf texlive-latex2man BuildRequires: make +BuildRequires: gcc-c++ # host != target would cause REMOTE_ONLY build even if building i386 on x86_64. %global _host %{_target_platform} @@ -35,7 +39,7 @@ The libunwind-devel package includes the libraries and header files for libunwind. %prep -%setup -q +%autosetup -p1 %build %global optflags %{optflags} -fcommon @@ -65,13 +69,16 @@ touch -r NEWS $RPM_BUILD_ROOT%{_includedir}/libunwind.h %generate_compatibility_deps %check -%if 0%{?_with_check:1} || 0%{?_with_testsuite:1} echo ====================TESTING========================= -make check || true -echo ====================TESTING END===================== +%ifarch aarch64 +echo echo ====================SKIP TEST===================== %else -echo ====================TESTSUITE DISABLED========================= + if ! make check ; then + echo echo ====================FAILED TESTS===================== + cat tests/test-suite.log || true + fi %endif +echo ====================TESTING END===================== %ldconfig_scriptlets @@ -94,8 +101,10 @@ echo ====================TESTSUITE DISABLED========================= %{_includedir}/libunwind*.h %changelog -* Thu Sep 29 2022 mgb01105731 - 1.6.2-3 +* Thu Feb 2 2023 Ziyang Zhang - 1.6.2-3 - add abi/api files +- enable self-tests while building. Skip tests for aarch64 since some tests + may fail * Thu Sep 29 2022 mgb01105731 - 1.6.2-2 - add doc package