Skip to content

Support for kernel driver compilation using clang-cl from VS 2026 - #42

Open
nullbytepl wants to merge 2 commits into
SergiusTheBest:masterfrom
us4useu:master
Open

Support for kernel driver compilation using clang-cl from VS 2026#42
nullbytepl wants to merge 2 commits into
SergiusTheBest:masterfrom
us4useu:master

Conversation

@nullbytepl

Copy link
Copy Markdown

This PR adds support for compiling a WDF kernel driver using clang-cl.

We currently use this setup internally to compile our WDF-based us4oem driver written in C with clang-cl as available in VS 2026.

cc @pjarosik

@SergiusTheBest

Copy link
Copy Markdown
Owner

Oh, that's interesting! Thanks for the PR.

seiftnesse added a commit to seiftnesse/FindWDK that referenced this pull request Jul 23, 2026
@seiftnesse

Copy link
Copy Markdown

Hi everyone,
Looks like I'm not the only one using clang for compilation. I've put together a git patch for my own repo (I originally wanted to submit a proper pull request, but given all the workarounds that clang-cl requires here, I decided against it - but as it turns out, there are like-minded people 😁). This provides full support for building with clang-cl (starting from 19.1.7 using llvm-project). If anyone is able to improve my "patch", I'd really appreciate it.

@nullbytepl

nullbytepl commented Jul 23, 2026

Copy link
Copy Markdown
Author

Hi everyone, Looks like I'm not the only one using clang for compilation. I've put together a git patch for my own repo (I originally wanted to submit a proper pull request, but given all the workarounds that clang-cl requires here, I decided against it - but as it turns out, there are like-minded people 😁). This provides full support for building with clang-cl (starting from 19.1.7 using llvm-project). If anyone is able to improve my "patch", I'd really appreciate it.

@seiftnesse Hi! First of all, thank you for your work! It's clear you know more about these topics than I do 😅. It would likely be impossible for us to transition to fully unifed compiler across our monorepo without it! Using your work, it only took me less than a day of "hacking around" to get it to function properly for our VS+clang-cl-based project with a Windows userspace library, WDF-based driver and userspace/kernel, OS agnostic hardware access library. Guess you can now say you've contributed something to the field of ultrasound research 😀

As for your patch, I'll definitely take a deeper look at it and integrate it into our PR whenever I find free time at the office. I'm guessing our changes diverge when it comes to the linker flags because we use the MSVC linker and not lld-link, so I'll try to accommodate for that too.

@nullbytepl

Copy link
Copy Markdown
Author

@seiftnesse your new patch mentions "wdk_smoke_check_no_sse.cmake" but it seems to be missing from the commit, could you add that somewhere?

@seiftnesse

Copy link
Copy Markdown

Hi there,

Guess you can now say you've contributed something to the field of ultrasound research 😀

I'm glad to hear that!

@seiftnesse your new patch mentions "wdk_smoke_check_no_sse.cmake" but it seems to be missing from the commit, could you add that somewhere?

My bad, forgot to include it. wdk_smoke_check_no_sse.cmake is just a small tool that catches SSE/AVX instructions and self-recursive functions. I'll push it right now.

seiftnesse added a commit to seiftnesse/FindWDK that referenced this pull request Jul 24, 2026
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.

3 participants