[compiler-rt] e424a35 - [X86] Explicitly initialize __cpu_features2 global in compiler-rt to 0.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 18:31:00 PDT 2020


Author: Craig Topper
Date: 2020-06-12T18:30:34-07:00
New Revision: e424a3526a9a86b176b38bf7191cf28f648e2708

URL: https://github.com/llvm/llvm-project/commit/e424a3526a9a86b176b38bf7191cf28f648e2708
DIFF: https://github.com/llvm/llvm-project/commit/e424a3526a9a86b176b38bf7191cf28f648e2708.diff

LOG: [X86] Explicitly initialize __cpu_features2 global in compiler-rt to 0.

Seems like this may be needed in order for the linker to find the
symbol. At least on my Mac.

Added: 
    

Modified: 
    compiler-rt/lib/builtins/cpu_model.c

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/builtins/cpu_model.c b/compiler-rt/lib/builtins/cpu_model.c
index 270eb88ebcaf..2bbab567d008 100644
--- a/compiler-rt/lib/builtins/cpu_model.c
+++ b/compiler-rt/lib/builtins/cpu_model.c
@@ -646,7 +646,7 @@ struct __processor_model {
 #ifndef _WIN32
 __attribute__((visibility("hidden")))
 #endif
-unsigned int __cpu_features2;
+unsigned int __cpu_features2 = 0;
 
 // A constructor function that is sets __cpu_model and __cpu_features2 with
 // the right values.  This needs to run only once.  This constructor is


        


More information about the llvm-commits mailing list