[SYCL][Driver] Blacklist known system library paths to exclude force link system libs#22712
Merged
Merged
Conversation
mdtoguchi
approved these changes
Jul 21, 2026
mdtoguchi
left a comment
Contributor
There was a problem hiding this comment.
Seems reasonable for exclusion. Of course, we can't stop folks from using those names for their non-system library paths.
…version
Under -fsycl-allow-device-image-dependencies on Windows, the driver scans
user .libs and force-loads them via /INCLUDE:__imp_<sym>, skipping system
libraries. isSystemLib() excluded a lib only if it lived under one exact
SDK/UCRT dir computed by clang, which is always the highest-installed
version. But the linker resolves bare names through the LIB env var in
order, so a system lib such as kernel32.lib can resolve against a different,
earlier-listed SDK version dir. That mismatched the exact-version prefix,
so the lib was treated as user-provided and wrongly force-loaded.
Match instead on the version- and location-agnostic Microsoft toolchain
directory markers ("Windows Kits", "Microsoft Visual Studio",
"Microsoft SDKs"), which cover the SDK/UCRT/NETFXSDK and VC/ATLMFC libs
regardless of which installed version resolves. The computed-dir prefix
check is kept as a fallback for clang's own resource lib dir, which carries
no such marker.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
uditagarwal97
force-pushed
the
private/udit/fixSysLibDetect
branch
from
July 22, 2026 03:34
123ac3e to
b807028
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Under
-fsycl-allow-device-image-dependencieson Windows, the driver scans user .libs and force-loads them via /INCLUDE:_imp, skipping system libraries.isSystemLib()excluded a lib only if it lived under one exact SDK/UCRT dir computed by clang, which is always the highest-installed version. But the linker resolves bare names through the LIB env var in order, so a system lib such as kernel32.lib can resolve against a different, earlier-listed SDK version dir.Match instead on the version- and location-agnostic Microsoft toolchain directory markers ("Windows Kits", "Microsoft Visual Studio", "Microsoft SDKs"), which cover the SDK/UCRT/NETFXSDK and VC/ATLMFC libs regardless of which installed version resolves.
Fixes CMPLRLLVM-76984
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com