[compiler-rt] cafefe0 - [compiler-rt] [test] [builtins] Pass the right parameters for linking with -nodefaultlibs on mingw targets

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 02:11:37 PDT 2023


Author: Martin Storsjö
Date: 2023-04-13T12:11:17+03:00
New Revision: cafefe01604c12db7f860a29419b5940e0c993ae

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

LOG: [compiler-rt] [test] [builtins] Pass the right parameters for linking with -nodefaultlibs on mingw targets

The clang-cl/MSVC case is handled above, thus consider win32 && !is_msvc
to be mingw.

This matches the list of libraries passed by e.g. the libcxx build, when
using -nodefaultlibs.

Differential Revision: https://reviews.llvm.org/D147647

Added: 
    

Modified: 
    compiler-rt/test/builtins/Unit/lit.cfg.py

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/builtins/Unit/lit.cfg.py b/compiler-rt/test/builtins/Unit/lit.cfg.py
index fa6dc86783d3e..e3602a99087d6 100644
--- a/compiler-rt/test/builtins/Unit/lit.cfg.py
+++ b/compiler-rt/test/builtins/Unit/lit.cfg.py
@@ -43,6 +43,13 @@ def get_required_attr(config, attr_name):
 elif config.host_os  == 'Darwin':
   base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.osx.a ")
   config.substitutions.append( ("%librt ", base_lib + ' -lSystem ') )
+elif config.host_os  == 'Windows':
+  base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.builtins%s.a"
+                          % config.target_suffix)
+  if sys.platform in ['win32'] and execute_external:
+    # Don't pass dosish path separator to msys bash.exe.
+    base_lib = base_lib.replace('\\', '/')
+  config.substitutions.append( ("%librt ", base_lib + ' -lmingw32 -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 ') )
 else:
   base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.builtins%s.a"
                           % config.target_suffix)


        


More information about the llvm-commits mailing list