-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Handle 'lib' variants in ModuleNameVariations to generate DirectPInvokes #118285
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where the ILC (ILCompiler) wasn't recognizing library names with the 'lib' prefix when generating DirectPInvokes. The fix enhances the ModuleNameVariations
method to handle library name variations that include the common 'lib' prefix.
Key changes:
- Added logic to detect and handle the 'lib' prefix in library names
- Generate additional name variations by stripping the 'lib' prefix
- Handle cases where both 'lib' prefix and shared library extensions are present
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
Co-authored-by: Copilot <[email protected]>
Drop the lib prefixes in https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets#L151 to make the msbuild targets simpler? |
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
Outdated
Show resolved
Hide resolved
…e.targets Co-authored-by: Jan Kotas <[email protected]>
…ot during evaluation
In ILC, when a DirectPInvokes item was prefixed with 'lib', it wouldn't recognize the library and wouldn't generate a direct pinvoke. There are a lot of places within the repo (and I assume other codebases) that use the 'lib' prefix in DirectPInvokes, so it seems to make more sense to handle that case rather than remove the prefix from all usages.
fixes #118284