return -1
}
-if { [gdb_compile "$sourcetmp" "$binfile" executable {debug}] != "" } {
+if { [gdb_compile "$sourcetmp" "$binfile" executable {debug build-id}] != "" } {
untested "failed to compile"
return -1
}
-if { [gdb_compile "$sourcetmp" "${binfile}2" executable {debug}] != "" } {
+if { [gdb_compile "$sourcetmp" "${binfile}2" executable {debug build-id}] != "" } {
fail "compile"
return -1
}
# - macros: Add the required compiler flag to include macro information in
# debug information
# - text_segment=addr: Tell the linker to place the text segment at ADDR.
+# - build-id: Ensure the final binary includes a build-id.
#
# And here are some of the not too obscure options understood by DejaGnu that
# influence the compilation:
}
}
+ # 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-*"]} {
+ lappend new_options "additional_flags=-Wl,--build-id"
+ }
+
# Treating .c input files as C++ is deprecated in Clang, so
# explicitly force C++ language.
if { !$getting_compiler_info