Skip to content

Conversation

@mochaaP
Copy link
Contributor

@mochaaP mochaaP commented Dec 9, 2025

See the expanded commit messages for explanations.

Before:

[binaries]
c = ['clang-cl', '--target=' + target, '-fuse-ld=lld', '/winsysroot', root]
cpp = ['clang-cl', '--target=' + target, '-fuse-ld=lld', '/winsysroot', root]
# c_ld not set
# cpp_ld not set

After:

[binaries]
c = ['clang-cl', '--target=' + target]
cpp = ['clang-cl', '--target=' + target]
c_ld = 'lld-link'
cpp_ld = 'lld-link'

The detect_vs_dep_prefix change needs more testing. I tested this on:

  • msvc-wine's wrapper
  • native windows msvc
  • clang-cl on linux

normal compilers does not rely on the position of this argument,
but MSVC-like compilers treat `/link` and any argument after that
as linker arguments. MSVC-like compiler's linker_to_compiler_args
inject `/link` before largs, resulting it being forwarded to link.exe
not the compiler driver.

fixes cross compiling with cc = clang-cl and c_ld = lld-link.
this function does not pass enough args from the compiler object to find
windows sdk without relying on environment variables.
including a file from the same directory removes the dependency on stdlib.
@mochaaP mochaaP force-pushed the mochaa/clang-cl-cross branch from da492cb to bd3e854 Compare December 9, 2025 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant