[PATCH] D147647: [compiler-rt] [test] [builtins] Pass the right parameters for linking with -nodefaultlibs on mingw targets
Martin Storsjö via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 5 11:49:00 PDT 2023
mstorsjo created this revision.
mstorsjo added reviewers: phosek, alvinhochun, vitalybuka.
Herald added subscribers: Enna1, dberris.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D147647
Files:
compiler-rt/test/builtins/Unit/lit.cfg.py
Index: compiler-rt/test/builtins/Unit/lit.cfg.py
===================================================================
--- compiler-rt/test/builtins/Unit/lit.cfg.py
+++ compiler-rt/test/builtins/Unit/lit.cfg.py
@@ -43,6 +43,13 @@
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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147647.511174.patch
Type: text/x-patch
Size: 1016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230405/c1637d0c/attachment.bin>
More information about the llvm-commits
mailing list