-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[NativeAOT] Another attempt to prevent stripping exported symbols from executables when explicitly specified #86050
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
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsThis PR fixes a regression caused by #85293 which was reverted by #85601 ProblemThe issue with the initial approach is that we used the following However, executing this command produces a warning: This can be observed in the On the other hand, the job SolutionTo achieve the desired behaviour, it is needed to:
Fixes: #85600
|
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/cc: @lambdageek @SamMonoRT |
| <_IgnoreLinkerWarnings>false</_IgnoreLinkerWarnings> | ||
| <_IgnoreLinkerWarnings Condition="'$(_IsApplePlatform)' == 'true'">true</_IgnoreLinkerWarnings> | ||
| <StripFlag Condition="'$(_IsApplePlatform)' == 'true' and '$(NativeLib)' == 'Shared'">-x</StripFlag> <!-- keep global symbols in dylib --> | ||
| <_StripFlag Condition="'$(_IsApplePlatform)' == 'true' and ('$(NativeLib)' == 'Shared' or '$(IlcExportUnmanagedEntrypoints)' == 'true')">-x</_StripFlag> <!-- keep global symbols in dylib (or if it is explicitly specified) --> |
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.
| <_StripFlag Condition="'$(_IsApplePlatform)' == 'true' and ('$(NativeLib)' == 'Shared' or '$(IlcExportUnmanagedEntrypoints)' == 'true')">-x</_StripFlag> <!-- keep global symbols in dylib (or if it is explicitly specified) --> | |
| <_StripFlag Condition="'$(_IsApplePlatform)' == 'true' and '$(IlcExportUnmanagedEntrypoints)' == 'true'">-x</_StripFlag> <!-- keep global symbols --> |
We set IlcExportUnmanagedEntrypoints for Shared lnative libs by default.
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.
I missed that, thank you. Fixed.
|
/azp run runtime-extra-platforms |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This PR fixes a regression caused by #85293 which was reverted by #85601
Problem
The issue with the initial approach is that we used the following
stripcommand to keep only the symbols exported by the compiler:However, executing this command produces a warning:
This can be observed in the
runtimeCI lane: https://dev.azure.com/dnceng-public/public/_build/results?buildId=258886&view=logs&j=66dceaa3-58e2-55af-b0bc-5748606ebc0e&t=2c1c2642-0b2e-5086-de47-1b8a1c2ab601&l=637On the other hand, the job
osx-x64 Release NativeAOT_Libsin theruntime-extra-platformsCI lane, treats warnings as errors, which results with a build failure when stripping is attempted: https://dev.azure.com/dnceng-public/public/_build/results?buildId=257857&view=logs&j=1b7517dc-3493-5614-db19-9039ca700e8e&t=30be22c2-1ac3-5d1e-cae6-35f9adc3d580&l=6564Solution
To achieve the desired behaviour, it is needed to:
runtime/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
Line 315 in d8cf33b
Fixes: #85600