Skip to content

Commit cafefe0

Browse files
committed
[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
1 parent ebae562 commit cafefe0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ def get_required_attr(config, attr_name):
4343
elif config.host_os == 'Darwin':
4444
base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.osx.a ")
4545
config.substitutions.append( ("%librt ", base_lib + ' -lSystem ') )
46+
elif config.host_os == 'Windows':
47+
base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.builtins%s.a"
48+
% config.target_suffix)
49+
if sys.platform in ['win32'] and execute_external:
50+
# Don't pass dosish path separator to msys bash.exe.
51+
base_lib = base_lib.replace('\\', '/')
52+
config.substitutions.append( ("%librt ", base_lib + ' -lmingw32 -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 ') )
4653
else:
4754
base_lib = os.path.join(config.compiler_rt_libdir, "libclang_rt.builtins%s.a"
4855
% config.target_suffix)

0 commit comments

Comments
 (0)