[compiler-rt] [Profile][Windows] Fix flakyness when checking existence of binary id (PR #84196)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 09:02:03 PST 2024


================
@@ -96,9 +96,10 @@ ValueProfNode *EndVNode = &VNodesEnd;
 /* lld-link provides __buildid symbol which ponits to the 16 bytes build id when
  * using /build-id flag. https://lld.llvm.org/windows_support.html#lld-flags */
 #define BUILD_ID_LEN 16
-COMPILER_RT_WEAK uint8_t __buildid[BUILD_ID_LEN];
+COMPILER_RT_WEAK uint8_t __buildid[BUILD_ID_LEN] = {0};
 COMPILER_RT_VISIBILITY int __llvm_write_binary_ids(ProfDataWriter *Writer) {
-  if (*__buildid) {
+  uint8_t zeros[BUILD_ID_LEN] = {0};
----------------
zmodem wrote:

This could `static const`

https://github.com/llvm/llvm-project/pull/84196


More information about the llvm-commits mailing list