diff options
| author | LIU Hao <lh_mouse@126.com> | 2024-12-16 12:04:37 +0800 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-12-19 12:38:22 -0500 |
| commit | 6eac0158cd4e62ec835a5fa38fd619d6f3958353 (patch) | |
| tree | 74596071687cbe5666621115426b4dc99aeefea1 /data/syntax-highlighting/vim/syntax | |
| parent | 1f1a6d3a45ab968bbc28854c4733dc1303abb176 (diff) | |
| download | meson-6eac0158cd4e62ec835a5fa38fd619d6f3958353.tar.gz | |
compilers: Do not pass `-fuse-ld=lld` via `-Wl,`
`-fuse-ld=` is a driver option for selection of a linker; it shall not be
passed to a linker with `-Wl,`.
For the Microsoft compiler and linker, the options for the compiler and those
for the linker are separated by `/LINK`, which looks like `cl /cl-options ...
/link /link-options ...`. Formally, they are passed in the same command line.
When Clang is invoking the Microsoft linker or a Microsoft-style linker (that
is, LLD-LINK), every linker option has to prefixed by `-Wl,` or `-Xlink`.
Previously, using Clang-CL and LLD-LINK, given:
cc = meson.get_compiler('c')
assert(cc.has_link_argument('/LTCG'))
This code failed to detect the `/LTCG` option, because `-fuse-ld=lld` was
passed to the linker, as an invalid option:
Command line: `clang E:\lh_mouse\Desktop\t\build\meson-private\tmpg0221fee\testfile.c -o E:\lh_mouse\Desktop\t\build\meson-private\tmpg0221fee\output.exe -D_FILE_OFFSET_BITS=64 -O0 -Werror=implicit-function-declaration -Wl,-WX -Wl,/LTCG -Wl,-fuse-ld=lld` -> 4044
stdout:
LINK : warning LNK4044: unrecognized option '/fuse-ld=lld'; ignored
LINK : error LNK1218: warning treated as error; no output file generated
However, it should be noted that not all LINK options can be passed with
`-Wl,`. The `/subsystem:windows,6.1` option has a comma, which would be
converted to a space. Therefore, this option must be passed as
`-Xlinker -subsystem:windows,6.1`. This issue is not addressed in this commit.
Signed-off-by: LIU Hao <lh_mouse@126.com>
Diffstat (limited to 'data/syntax-highlighting/vim/syntax')
0 files changed, 0 insertions, 0 deletions
