32
32
"extract_debuginfo_test" ,
33
33
)
34
34
load ("@local_host_values//:local_host_values_set.bzl" , "NUM_CPUS" )
35
+ load ("@evergreen_variables//:evergreen_variables.bzl" , "UNSAFE_COMPILE_VARIANT" , "UNSAFE_VERSION_ID" )
35
36
36
37
# These will throw an error if the following condition is not met:
37
38
# (libunwind == on && os == linux) || libunwind == off || libunwind == auto
@@ -814,6 +815,9 @@ def _mongo_cc_binary_and_test(
814
815
"//bazel/config:thin_lto_enabled" : ["-Wl,--threads=" + str (NUM_CPUS )],
815
816
"//bazel/config:bolt_enabled" : ["-Wl,--threads=" + str (NUM_CPUS )],
816
817
"//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" : [],
817
821
}),
818
822
"linkstatic" : LINKSTATIC_ENABLED ,
819
823
"local_defines" : MONGO_GLOBAL_DEFINES + local_defines ,
@@ -822,6 +826,9 @@ def _mongo_cc_binary_and_test(
822
826
"features" : SKIP_ARCHIVE_FEATURE + ["-pic" , "pie" ] + features + select ({
823
827
"//bazel/config:windows_debug_symbols_enabled" : ["generate_pdb_file" ],
824
828
"//conditions:default" : [],
829
+ }) + select ({
830
+ "//bazel/config:simple_build_id_enabled" : ["-build_id" ],
831
+ "//conditions:default" : [],
825
832
}),
826
833
"dynamic_deps" : select ({
827
834
"//bazel/config:linkstatic_disabled" : deps ,
0 commit comments