Skip to content
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

[mono][aot] Preserve P/Invoked symbols when stripping #81530

Open
Tracked by #80905
kotlarmilos opened this issue Feb 2, 2023 · 3 comments
Open
Tracked by #80905

[mono][aot] Preserve P/Invoked symbols when stripping #81530

kotlarmilos opened this issue Feb 2, 2023 · 3 comments
Assignees
Milestone

Comments

@kotlarmilos
Copy link
Member

Enable Mono AOT compiler to generate a list of symbols which get P/Invoked, so they can get preserved during stripping phase, instead of relying on a custom linker steps in Xamarin or stripping non-global symbols in MonoAOTCompiler msbuild task.

#79721 could be extended to output the list of P/Invoked symbols and possibly strip more from the final binary.

@marek-safar
Copy link
Contributor

It'd also help us to check this feature does not regress

@ivanpovazan
Copy link
Member

ivanpovazan commented Feb 2, 2023

It seems WasmAppBuilder is doing something really similar (if not exactly what we need): https://github.com/dotnet/runtime/blob/main/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs
the feature also includes tests here: https://github.com/dotnet/runtime/blob/main/src/mono/wasm/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs

PS although it does load assemblies (once again) which can negatively impact the build time.

@kotlarmilos
Copy link
Member Author

kotlarmilos commented Feb 2, 2023

SOD difference for HelloiOS binary when non-global symbols are stripped vs. only P/Invokes are preserved - #81361 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants