Skip to content

Commit 18f1d14

Browse files
committed
Linking works as expected
The "hello world" apps size decrease: * ~2 meg for XA * ~1.8 meg for MAUI
1 parent 23252f8 commit 18f1d14

File tree

3 files changed

+8
-1610
lines changed

3 files changed

+8
-1610
lines changed

src/Xamarin.Android.Build.Tasks/Utilities/NativeRuntimeComponents.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ public ClangBuiltinsArchive (string clangAbi)
4444
class AndroidArchive : Archive
4545
{
4646
public AndroidArchive (string name)
47-
: base (name, wholeArchive: true)
47+
: base (name, wholeArchive: false)
4848
{}
4949
}
5050

5151
sealed class BclArchive : Archive
5252
{
53-
public BclArchive (string name, bool wholeArchive = true)
53+
public BclArchive (string name, bool wholeArchive = false)
5454
: base (name, wholeArchive: wholeArchive)
5555
{}
5656
}

src/Xamarin.Android.Build.Tasks/Utilities/PreservePinvokesNativeAssemblyGenerator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ void AddFindPinvoke<T> (LlvmIrModule module, List<Component> components, bool is
192192

193193
var func = new LlvmIrFunction (sig, MakeFindPinvokeAttributeSet (module)) {
194194
CallingConvention = LlvmIrCallingConvention.Fastcc,
195-
Linkage = LlvmIrLinkage.Internal,
196195
};
197196
LlvmIrLocalVariable retval = func.CreateLocalVariable (typeof(IntPtr), "retval");
198197
var state = new ConstructionState {
@@ -218,7 +217,7 @@ void AddFindPinvoke<T> (LlvmIrModule module, List<Component> components, bool is
218217
foreach (Component component in components) {
219218
Log.LogDebugMessage ($" {component.Name} (hash: 0x{component.NameHash:x}; {component.PInvokes.Count} p/invoke(s))");
220219

221-
string comment = $" {component.Name}";
220+
string comment = $" {component.Name} (p/invoke count: {component.PInvokes.Count})";
222221
LlvmIrFunctionLabelItem componentLabel = AddSwitchItem<T> (componentSwitch, component.NameHash, is64Bit, comment, null);
223222

224223
func.Body.Add (componentLabel, comment);

0 commit comments

Comments
 (0)