Skip to content

Commit 7fdf39f

Browse files
committed
Add support for -Bsymbolic
1 parent c153b63 commit 7fdf39f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Xamarin.Android.Build.Tasks/Tasks/LinkNativeRuntime.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ void LinkRuntime (ITaskItem abiItem)
7373
StripDebugSymbols = StripDebugSymbols,
7474
SaveDebugSymbols = SaveDebugSymbols,
7575
UseNdkLibraries = true,
76+
UseSymbolic = true,
7677
NdkRootPath = AndroidNdkDirectory,
7778
NdkApiLevel = AndroidApiLevel,
7879
};

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class NativeLinker
4747
public bool AllowUndefinedSymbols { get; set; } = false;
4848
public bool UseNdkLibraries { get; set; } = false;
4949
public bool TargetsCLR { get; set; }
50+
public bool UseSymbolic { get; set; }
5051
public string? NdkRootPath { get; set; }
5152
public string? NdkApiLevel { get; set; }
5253
public int ZipAlignmentPages { get; set; } = AndroidZipAlign.DefaultZipAlignment64Bit;
@@ -157,6 +158,10 @@ public bool Link (ITaskItem outputLibraryPath, List<ITaskItem> linkItems, List<I
157158
sw.WriteLine ("--eh-frame-hdr"); // CoreCLR needs it for its exception stack unwinding
158159
}
159160

161+
if (UseSymbolic) {
162+
sw.WriteLine ("-Bsymbolic");
163+
}
164+
160165
// This MUST go before extra args, since the NDK library path must take precedence over the path in extra args set in the ctor
161166
if (UseNdkLibraries) {
162167
sw.WriteLine ($"-L {MonoAndroidHelper.QuoteFileNameArgument (GetAbiNdkRootDir ())}");

0 commit comments

Comments
 (0)