From: Bernd Edlinger Date: Fri, 6 Sep 2024 06:08:28 +0000 (+0200) Subject: Fix the build-id option for GCC default configuration X-Git-Tag: gdb-16-branchpoint~987 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f83ca9c7cca4ab7a2d7352104a37932474320410;p=thirdparty%2Fbinutils-gdb.git 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 --- 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" }