[compiler-rt] [test] [builtins] Pass the right parameters for linking with -nodefault...
authorMartin Storsjö <martin@martin.st>
Thu, 30 Mar 2023 12:46:56 +0000 (15:46 +0300)
committerMartin Storsjö <martin@martin.st>
Thu, 13 Apr 2023 09:11:17 +0000 (12:11 +0300)
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

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

index fa6dc86..e3602a9 100644 (file)
@@ -43,6 +43,13 @@ if is_msvc:
 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)