compilers: Pass vs_module_defs
with /DEF:
to LLD-LINK
#13998
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently, it is possible to install Clang with Visual Studio Installer. By default this Clang has a MSVC target, and invokes the Microsoft Linker; if
-fuse-ld=lld
is specified, it will invoke LLD-LINK. Both linkers take MSVC-style arguments, and take DEF files with/DEF:<path>
.Previously DEF files were passed in the GNU way, directly on the linker command line like an object file, which caused errors like
lld-link: error: ..\my.def: unknown file type
While Clang-CL takes Unix-style options, it actually passes MSVC-style options to LINK or LLD-LINK with
-Wl,
. There is already a check for both linkers inlinker_to_compiler_args()
, so it's necessary to do the same ingen_vs_module_defs_args()
.This commit closes #13988.