Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

symlink sdk/lib/<sdkversion> to sdk/lib and sdk/include/<sdkversion> to sdk/include #44

Closed
Qyriad opened this issue May 13, 2022 · 3 comments · Fixed by #47
Closed

symlink sdk/lib/<sdkversion> to sdk/lib and sdk/include/<sdkversion> to sdk/include #44

Qyriad opened this issue May 13, 2022 · 3 comments · Fixed by #47

Comments

@Qyriad
Copy link
Contributor

Qyriad commented May 13, 2022

clang-cl supports /winsdkdir <dir> and /vctoolsdir <dir> in lieu of passing all of the various /imsvc <dir> and /libpath: <dir> options to get all of the nested directories for the correct architecture. However, clang's detection of this assumes that sdk/lib and sdk/dir include directories for all of the various Windows SDK versions one could have installed (i.e. sdk/lib/10.0.20348/um/x64), as this is the layout that Visual Studio uses.

Would it be possible to add two additional symlinks in the sdk directory for the Windows SDK version, which just points back to that sdk directory? This would allow compilation command lines to be as simple as clang-cl --target=x86_64-pc-windows-msvc -fuse-ld=lld-link /winsdkdir /xwin/sdk /vctoolsdir /xwin/crt, which I think would be a huge convenience win.

Confusingly, these symlinks should probably be created even with --disable-symlinks so this functionality can still be used on case insensitive file systems.

If you're open to adding this functionality, I'm willing to implement and PR it myself.

@Jake-Shadle
Copy link
Owner

Oh cool, didn't know those existed! Yes a PR would be very welcome!

@Ununnilium
Copy link

clang-cl version 14 expects "x64" instead "x86_64" for the following three directories:

sdk/lib/um/x86_64
sdk/lib/ucrt/x86_64
crt/lib/x86_64

With for d in `find xwin_output -name x86_64 -type d`; do pushd $d/.. && ln -s x86_64 x64 && popd; done symlinks can be created. Then, clang-cl works like this:

clang-cl --target=x86_64-pc-windows-msvc -fuse-ld=lld-link /winsdkdir "xwin_output/sdk" /vctoolsdir "xwin_output/crt" hello.c

These symlinks could also be added to xwin, but I don't know how to do it.

@Jake-Shadle
Copy link
Owner

#71 (comment)

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 a pull request may close this issue.

3 participants