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

Remove runtime dependencies on libstdc++ #76655

Closed
MichalStrehovsky opened this issue Oct 5, 2022 · 6 comments · Fixed by #76705
Closed

Remove runtime dependencies on libstdc++ #76655

MichalStrehovsky opened this issue Oct 5, 2022 · 6 comments · Fixed by #76705
Labels
area-NativeAOT-coreclr help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@MichalStrehovsky
Copy link
Member

MichalStrehovsky commented Oct 5, 2022

Transferred from dotnet/corert#3564.

NativeAOT runtime does not use any C++ features (exception handling, etc.), but it still depends on libstdc++ here and there for no good reason. Consider cleaning these up and remove dependency on libstdc++ to improve minimal footprint.

@MichalStrehovsky MichalStrehovsky added this to the 8.0.0 milestone Oct 5, 2022
@MichalStrehovsky MichalStrehovsky added the help wanted [up-for-grabs] Good issue for external contributors label Oct 5, 2022
@am11
Copy link
Member

am11 commented Oct 6, 2022

This removes the dependency from linux (clang, gcc) and osx (clang) main...am11:runtime:feature/nativeaot/nostdlib++.

I haven't tested on windows, but I am sure its support needs work.

@MichalStrehovsky
Copy link
Member Author

Neat! Thank you for looking into it! Could you please submit it as a pull request?

We probably don't need to worry about Windows - Windows doesn't distinguish between C and C++ runtime support - it's all in a single library that is present on all OSes. It's most interesting on Linux because the most minimal distros only come with a libc and C++ is an extra dependency one needs to install (as demonstrated here: https://github.com/eerhardt/Albums/blob/104ae182f72dccf522092ec33a340b8eb02529b7/AlbumsNetCore/Dockerfile#L2).

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Oct 6, 2022
@driver1998
Copy link

driver1998 commented Oct 10, 2022

We probably don't need to worry about Windows - Windows doesn't distinguish between C and C++ runtime support

Is it possible to only depend on UCRT on Windows?

@josephmoresena
Copy link
Contributor

Would this remove the libc++_shared.so library dependency on Android?

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Oct 13, 2022
@jkotas
Copy link
Member

jkotas commented Oct 13, 2022

Is it possible to only depend on UCRT on Windows?

We are statically linking the tiny bit of C++ runtime that we need on Windows already. We do not depend on any C++ runtime .dll on Windows.

@josephmoresena
Copy link
Contributor

@josephmoresena, this issue is for coreclr NativeAOT. Android NativeAOT is related to mono runtime (different sources and configurations). @lambdageek, do you know if libc++_shared.so dependency removal is feasible? I do not have a developer environment for Android, so it is hard to assess from reading the code. 😁

I actually talk about coreclr. @MichalStrehovsky made a branch to allow build it using the NDK.

Currently for some reason the upgrade of that branch is broken but it was usefull in order to create JNI libraries with pure C#.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-NativeAOT-coreclr help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants