[llvm] [Support] Add LLVM_WINDOWS_AVOID_SHELL32_APIS for shell32-free path lookups (PR #209448)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 27 06:00:48 PDT 2026
ustachow wrote:
Adding the use case here, since it helps explain the need:
This isn't a standalone userland application being validated against the driver kit. It's a user-mode driver component. In our case it's an LLVM-based shader compiler that the graphics driver's D3D12/Vulkan user-mode components invoke to turn shaders into GPU code, shipped inside the driver package itself. Windows graphics drivers are Universal/DCH drivers, and Microsoft's universal-driver rules apply to the user-mode DLLs in the package too, so every binary in it, including the one embedding LLVM, has to stay within the universal API surface (enforced by the WDK ApiValidator as a Microsoft build requirement). shell32 isn't in that surface, so an SHGetKnownFolderPath import fails the build even though nothing ever calls it.
This likely generalizes beyond us: upstream already supports HLSL and other offloading languages, and sandboxed/hosted compilers (godbolt-style services, etc.) hit the same restricted-surface wall. So it's a fairly general need, and it scopes to "don't import shell32 in the normal Win32 build," with no Windows Store/UWP target required.
https://github.com/llvm/llvm-project/pull/209448
More information about the llvm-commits
mailing list