Skip to content

[Clang] sysroot and /winsysroot doesn't work on cross compilation #149707

@mccakit

Description

@mccakit

Currently I can't cross compile from WSL to Windows, by passing the Windows SDK dir as --sysroot with clang or passing Windows Build Tools dir as /winsysroot with **clang-cl **.

I face errors such as these
lld-link: error: could not open 'kernel32.lib': No such file or directory

And when I manually provide link directories like this

link_directories(/mnt/c/dev/sysroots/WinSDK/10/Lib/10.0.26100.0/um/x64)
link_directories(/mnt/c/dev/sysroots/WinSDK/10/Lib/10.0.26100.0/spectre/x64)
link_directories(/mnt/c/dev/sysroots/WinSDK/10/Lib/10.0.26100.0/ucrt/x64)
include_directories(/mnt/c/dev/sysroots/WinSDK/10/Include/10.0.26100.0/um)
include_directories(/mnt/c/dev/sysroots/WinSDK/10/Include/10.0.26100.0/ucrt)

I face other sets of errors.

I just want to provide a sdk and optionally manually link libc++ if I build it. That's it, I don't want to do anything else.
Please comfirm if this is an issue, if not please provide me with information what I'm doing wrong, I already checked the clang manual and didn't find a solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions