[PATCH] Fix the build-id option for GCC default configuration
Bernd Edlinger
bernd.edlinger@hotmail.de
Fri Sep 6 07:13:52 GMT 2024
It is possible that the compiler is configured to do
so automatically, but at least for GCC the configure option
--enable-linker-build-id is not enabled by default.
So the option -Wl,--build-id should be used regardless
of which compiler is used.
---
This prevents the following test failures when
GCC is used in default configuration:
FAIL: gdb.base/build-id-seqno.exp: find debuginfo with a single build-id file: debuginfo was read via build-id
FAIL: gdb.base/build-id-seqno.exp: find debuginfo with 4 build-id files: debuginfo was read via build-id
FAIL: gdb.base/build-id-seqno.exp: find debuginfo, first build-id file is bad: debuginfo was read via build-id
FAIL: gdb.base/build-id-seqno.exp: find debuginfo, first 2 build-id files are bad: debuginfo was read via build-id
FAIL: gdb.base/build-id-seqno.exp: find debuginfo, last build-id file is good: debuginfo was read via build-id
FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: at least one file was created
FAIL: gdb.base/index-cache.exp: test_cache_enabled_miss: couldn't get executable build id
FAIL: gdb.base/index-cache.exp: test_cache_enabled_hit: check index-cache stats
FAIL: gdb.base/index-cache.exp: couldn't remove files in temporary cache dir
FAIL: gdb.base/sysroot-debug-lookup.exp: lookup_via_build_id: sysroot_prefix=: ensure debug information was found
FAIL: gdb.base/sysroot-debug-lookup.exp: lookup_via_build_id: sysroot_prefix=: debug symbols read from correct file
FAIL: gdb.base/sysroot-debug-lookup.exp: lookup_via_build_id: sysroot_prefix=target:: ensure debug information was found
FAIL: gdb.base/sysroot-debug-lookup.exp: lookup_via_build_id: sysroot_prefix=ta
FAIL: gdb.dwarf2/per-bfd-sharing.exp: couldn't remove files in temporary cache dir
gdb/testsuite/lib/gdb.exp | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index d4d4acb2313..f58174de843 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -5633,10 +5633,11 @@ proc gdb_compile {source dest type options} {
}
# If the 'build-id' option is used, then ensure that we generate a
- # build-id. GCC does this by default, but Clang does not, so
- # enable it now.
- if {[lsearch -exact $options build-id] > 0
- && [test_compiler_info "clang-*"]} {
+ # build-id. It is possible that the compiler is configured to do
+ # so automatically, but at least for GCC the configure option
+ # --enable-linker-build-id is not enabled by default.
+ # So to be sure, enable it explicitly.
+ if {[lsearch -exact $options build-id] > 0} {
lappend new_options "ldflags=-Wl,--build-id"
}
--
2.39.2
More information about the Gdb-patches
mailing list