3232 "extract_debuginfo_test" ,
3333)
3434load ("@local_host_values//:local_host_values_set.bzl" , "NUM_CPUS" )
35+ load ("@evergreen_variables//:evergreen_variables.bzl" , "UNSAFE_COMPILE_VARIANT" , "UNSAFE_VERSION_ID" )
3536
3637# These will throw an error if the following condition is not met:
3738# (libunwind == on && os == linux) || libunwind == off || libunwind == auto
@@ -814,6 +815,9 @@ def _mongo_cc_binary_and_test(
814815 "//bazel/config:thin_lto_enabled" : ["-Wl,--threads=" + str (NUM_CPUS )],
815816 "//bazel/config:bolt_enabled" : ["-Wl,--threads=" + str (NUM_CPUS )],
816817 "//conditions:default" : [],
818+ }) + select ({
819+ "//bazel/config:simple_build_id_enabled" : ["-Wl,--build-id=0x%x%x" % (hash (name ), hash (str (UNSAFE_VERSION_ID ) + str (UNSAFE_COMPILE_VARIANT )))],
820+ "//conditions:default" : [],
817821 }),
818822 "linkstatic" : LINKSTATIC_ENABLED ,
819823 "local_defines" : MONGO_GLOBAL_DEFINES + local_defines ,
@@ -822,6 +826,9 @@ def _mongo_cc_binary_and_test(
822826 "features" : SKIP_ARCHIVE_FEATURE + ["-pic" , "pie" ] + features + select ({
823827 "//bazel/config:windows_debug_symbols_enabled" : ["generate_pdb_file" ],
824828 "//conditions:default" : [],
829+ }) + select ({
830+ "//bazel/config:simple_build_id_enabled" : ["-build_id" ],
831+ "//conditions:default" : [],
825832 }),
826833 "dynamic_deps" : select ({
827834 "//bazel/config:linkstatic_disabled" : deps ,
0 commit comments