From cafefe01604c12db7f860a29419b5940e0c993ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Storsj=C3=B6?= Date: Thu, 30 Mar 2023 15:46:56 +0300 Subject: [PATCH] [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 --- compiler-rt/test/builtins/Unit/lit.cfg.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler-rt/test/builtins/Unit/lit.cfg.py b/compiler-rt/test/builtins/Unit/lit.cfg.py index fa6dc86..e3602a9 100644 --- a/compiler-rt/test/builtins/Unit/lit.cfg.py +++ b/compiler-rt/test/builtins/Unit/lit.cfg.py @@ -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) -- 2.7.4