File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 66
77def options (opts ):
88 opts .Add (BoolVariable ("use_llvm" , "Use the LLVM compiler - only effective when targeting Linux" , False ))
9+ opts .Add (BoolVariable ("use_static_cpp" , "Link libgcc and libstdc++ statically for better portability" , True ))
910 opts .Add (BoolVariable ("use_ubsan" , "Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)" , False ))
1011 opts .Add (BoolVariable ("use_asan" , "Use LLVM/GCC compiler address sanitizer (ASAN)" , False ))
1112 opts .Add (BoolVariable ("use_lsan" , "Use LLVM/GCC compiler leak sanitizer (LSAN)" , False ))
@@ -43,6 +44,10 @@ def generate(env):
4344 env .Append (CCFLAGS = ["-march=rv64gc" ])
4445 env .Append (LINKFLAGS = ["-march=rv64gc" ])
4546
47+ # Link statically for portability
48+ if env ["use_static_cpp" ]:
49+ env .Append (LINKFLAGS = ["-static-libgcc" , "-static-libstdc++" ])
50+
4651 if env ["use_ubsan" ] or env ["use_asan" ] or env ["use_lsan" ] or env ["use_tsan" ] or env ["use_msan" ]:
4752 env .extra_suffix += ".san"
4853 env .Append (CCFLAGS = ["-DSANITIZERS_ENABLED" ])
You can’t perform that action at this time.
0 commit comments