-
Notifications
You must be signed in to change notification settings - Fork 546
[CoreCLR] link app native runtime/library statically #9938
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
Draft
grendello
wants to merge
41
commits into
main
Choose a base branch
from
dev/grendel/clr-host-static-link
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
e21e634
to
4e02da2
Compare
e15ccf6
to
9026080
Compare
4aff532
to
0b7bb8c
Compare
96d8326
to
39031e6
Compare
7cdfb21
to
86691d0
Compare
jonpryor
pushed a commit
that referenced
this pull request
Apr 29, 2025
Context: #9938 PR #9938 is an attempt to build `libnet-android.Debug.so` and `libnet-android.Release.so` so that CoreCLR is *statically linked* in to `libnet-android*.so`. This reduces the number of native libraries that must be placed into the `.apk`, and allows the `.apk` to be smaller, as the native linker can remove unused code. *Note*: CoreCLR is ***not*** yet statically linked into `libnet-android*.so`. This is *preliminary* work to support that. This iteration of static linking also requires that *all* symbols be resolvable, by requiring `lld --no-undefined` by default. This in turn requires that we ship *copies* of `libc.so` et al, so that *all* symbols needed by `libnet-android*.so` can be resolved, including those from the Android NDK. Update `build-tools/xaprepare` to extract required native libraries from the NDK, and add those to the .NET for Android Workload packs. Update `Xamarin.Android.Build.Tasks.dll` to cleanup and refactor `ld` invocation, so that `libnet-android*.so` is built with `ld --no-undefined`. This makes it easier to maintain and update the linker code in the future, as well as ensures that we use consistent linking flags across the board. Updates the LLVM IR code generator bits, also extracted from #9938, which aren't strictly related to native linking, but they are placed here in order to make #9938 smaller.
96649e1
to
75e6902
Compare
cc485b0
to
7059443
Compare
The NativeLinker helper and the LinkNativeRuntime tasks need to be modified slightly to allow more control over order of link items on the linker command line.
29ac51a
to
bfc4af0
Compare
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.
No description provided.