]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix the build-id option for GCC default configuration
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 6 Sep 2024 06:08:28 +0000 (08:08 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 6 Sep 2024 14:32:16 +0000 (16:32 +0200)
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>
gdb/testsuite/lib/gdb.exp

index d4d4acb2313c12b36fb16ef4d2fe4064f3c69e21..f58174de8437874d2a63e26da6bc6ea9be90283b 100644 (file)
@@ -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"
     }