aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/lib
diff options
context:
space:
mode:
authorBernd Edlinger <bernd.edlinger@hotmail.de>2024-09-06 08:08:28 +0200
committerBernd Edlinger <bernd.edlinger@hotmail.de>2024-09-06 16:32:16 +0200
commitf83ca9c7cca4ab7a2d7352104a37932474320410 (patch)
tree00386ee11390002cbfc4ef81aad0760ee2fd2bec /gdb/testsuite/lib
parent237df762d73a7fdf910277b0644df58688d2d87a (diff)
downloadbinutils-f83ca9c7cca4ab7a2d7352104a37932474320410.zip
binutils-f83ca9c7cca4ab7a2d7352104a37932474320410.tar.gz
binutils-f83ca9c7cca4ab7a2d7352104a37932474320410.tar.bz2
Fix the build-id option for GCC default configuration
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. Approved-By: Tom de Vries <tdevries@suse.de>
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r--gdb/testsuite/lib/gdb.exp9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index d4d4acb..f58174d 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"
}