]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Build libbacktrace and 19_diagnostics/stacktrace with -funwind-tables...
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 29 May 2024 08:08:07 +0000 (10:08 +0200)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 29 May 2024 08:08:07 +0000 (10:08 +0200)
Several of the 19_diagnostics/stacktrace tests FAIL on Solaris/SPARC (32
and 64-bit), Solaris/x86 (32-bit only), and several other targets:

FAIL: 19_diagnostics/stacktrace/current.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/current.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/entry.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/entry.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/output.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/output.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/stacktrace.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/stacktrace.cc  -std=gnu++26 execution test

As it turns out, both the copy of libbacktrace in libstdc++ and the
testcases proper need to compiled with -funwind-tables, as is done for
libbacktrace itself.

This isn't an issue on Linux/x86_64 and Solaris/amd64 since 64-bit x86
always defaults to -funwind-tables.  32-bit x86 does, too, when
-fomit-frame-pointer is enabled as on Linux/i686, but unlike
Solaris/i386.

So this patch always enables the option both for the libbacktrace copy
and the testcases.

Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

2024-05-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libstdc++-v3:
PR libstdc++/111641
* src/libbacktrace/Makefile.am (AM_CFLAGS): Add -funwind-tables.
* src/libbacktrace/Makefile.in: Regenerate.

* testsuite/19_diagnostics/stacktrace/current.cc (dg-options): Add
-funwind-tables.
* testsuite/19_diagnostics/stacktrace/entry.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/hash.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/output.cc: Likewise.
* testsuite/19_diagnostics/stacktrace/stacktrace.cc: Likewise.

libstdc++-v3/src/libbacktrace/Makefile.am
libstdc++-v3/src/libbacktrace/Makefile.in
libstdc++-v3/testsuite/19_diagnostics/stacktrace/current.cc
libstdc++-v3/testsuite/19_diagnostics/stacktrace/entry.cc
libstdc++-v3/testsuite/19_diagnostics/stacktrace/hash.cc
libstdc++-v3/testsuite/19_diagnostics/stacktrace/output.cc
libstdc++-v3/testsuite/19_diagnostics/stacktrace/stacktrace.cc

index a2e786712593dbc703c229a6a6572fbdc75662df..82205db46de386becaceab3b2fb6c0324d49d687 100644 (file)
@@ -51,7 +51,7 @@ C_WARN_FLAGS = $(WARN_FLAGS) -Wstrict-prototypes -Wmissing-prototypes -Wold-styl
 CXX_WARN_FLAGS = $(WARN_FLAGS) -Wno-unused-parameter
 AM_CFLAGS = \
        $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
-       $(C_WARN_FLAGS)
+       $(C_WARN_FLAGS) -funwind-tables
 AM_CFLAGS += $(EXTRA_CFLAGS)
 AM_CXXFLAGS = \
        $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
index b5713b0c616ee1cb981d8446f9320bdf68b251f8..51c8092335a840945e5418efe23a7d498bb9305e 100644 (file)
@@ -473,7 +473,7 @@ libstdc___libbacktrace_la_CPPFLAGS = \
 C_WARN_FLAGS = $(WARN_FLAGS) -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wno-unused-but-set-variable
 CXX_WARN_FLAGS = $(WARN_FLAGS) -Wno-unused-parameter
 AM_CFLAGS = $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
-       $(C_WARN_FLAGS) $(EXTRA_CFLAGS)
+       $(C_WARN_FLAGS) -funwind-tables $(EXTRA_CFLAGS)
 AM_CXXFLAGS = $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \
        $(CXX_WARN_FLAGS) -fno-rtti -fno-exceptions $(EXTRA_CXXFLAGS)
 obj_prefix = std_stacktrace
index b1af5f74fb2f5902d199a3cb0f167d9dd219d6a8..cdebd5f1daaf2ed024469ad64bdc47b9d64717ee 100644 (file)
@@ -1,4 +1,4 @@
-// { dg-options "-lstdc++exp" }
+// { dg-options "-funwind-tables -lstdc++exp" }
 // { dg-do run { target c++23 } }
 // { dg-require-cpp-feature-test __cpp_lib_stacktrace }
 
index bb348ebef8fd8fabe85ed2351e92c54c7abd6f9b..90671e68f8bf6c2790bb6bf857d7afac41196091 100644 (file)
@@ -1,4 +1,4 @@
-// { dg-options "-lstdc++exp" }
+// { dg-options "-funwind-tables -lstdc++exp" }
 // { dg-do run { target c++23 } }
 // { dg-require-cpp-feature-test __cpp_lib_stacktrace }
 
index 2176596ae5c90868bb99f87334fc91f1eb835871..3c296a6469fdf77a14a1b4d3f9d04bab9f028119 100644 (file)
@@ -1,4 +1,4 @@
-// { dg-options "-lstdc++exp" }
+// { dg-options "-funwind-tables -lstdc++exp" }
 // { dg-do run { target c++23 } }
 // { dg-require-cpp-feature-test __cpp_lib_stacktrace }
 
index e27aea1f5089f7b599925e2fda5145835a3c0cd1..ea9da7fa248675e1b4f3e37f2f78462df68f36da 100644 (file)
@@ -1,4 +1,4 @@
-// { dg-options "-lstdc++exp" }
+// { dg-options "-funwind-tables -lstdc++exp" }
 // { dg-do run { target c++23 } }
 // { dg-require-cpp-feature-test __cpp_lib_stacktrace }
 // { dg-add-options no_pch }
index a49cddfef26839ac5e17a07e35e1e3011b90adfb..6bb22eacd92c2c057c0ebc939a852a74b4e115bb 100644 (file)
@@ -1,4 +1,4 @@
-// { dg-options "-lstdc++exp" }
+// { dg-options "-funwind-tables -lstdc++exp" }
 // { dg-do run { target c++23 } }
 // { dg-require-cpp-feature-test __cpp_lib_stacktrace }