Skip to content

Commit acb9174

Browse files
committed
[dotnet] Handle prefix for P/Invokes for runtime native libraries
1 parent 4e5f5fe commit acb9174

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

tools/common/Target.cs

+6
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,15 @@ void GenerateIOSMain (StringWriter sw, Abi abi)
786786
else
787787
mono_native_lib = app.GetLibNativeName () + ".dylib";
788788
sw.WriteLine ();
789+
#if NET
790+
sw.WriteLine ($"\tmono_dllmap_insert (NULL, \"libSystem.Native\", NULL, \"{mono_native_lib}\", NULL);");
791+
sw.WriteLine ($"\tmono_dllmap_insert (NULL, \"libSystem.Security.Cryptography.Native.Apple\", NULL, \"{mono_native_lib}\", NULL);");
792+
sw.WriteLine ($"\tmono_dllmap_insert (NULL, \"libSystem.Net.Security.Native\", NULL, \"{mono_native_lib}\", NULL);");
793+
#else
789794
sw.WriteLine ($"\tmono_dllmap_insert (NULL, \"System.Native\", NULL, \"{mono_native_lib}\", NULL);");
790795
sw.WriteLine ($"\tmono_dllmap_insert (NULL, \"System.Security.Cryptography.Native.Apple\", NULL, \"{mono_native_lib}\", NULL);");
791796
sw.WriteLine ($"\tmono_dllmap_insert (NULL, \"System.Net.Security.Native\", NULL, \"{mono_native_lib}\", NULL);");
797+
#endif
792798
sw.WriteLine ();
793799
}
794800
}

tools/linker/MonoTouch.Tuner/ListExportedSymbols.cs

+3
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ void ProcessMethod (MethodDefinition method)
125125
DerivedLinkContext.RequiredSymbols.AddFunction (pinfo.EntryPoint).AddMember (method);
126126
break;
127127

128+
case "libSystem.Net.Security.Native":
128129
case "System.Net.Security.Native":
129130
#if NET
130131
if (DerivedLinkContext.App.Platform == ApplePlatform.TVOS) {
@@ -139,6 +140,7 @@ void ProcessMethod (MethodDefinition method)
139140

140141
goto case "System.Native";
141142
#endif
143+
case "libSystem.Native":
142144
case "System.Native":
143145
#if NET
144146
if (DerivedLinkContext.App.Platform == ApplePlatform.MacOSX) {
@@ -147,6 +149,7 @@ void ProcessMethod (MethodDefinition method)
147149
}
148150
goto case "System.Security.Cryptography.Native.Apple";
149151
#endif
152+
case "libSystem.Security.Cryptography.Native.Apple":
150153
case "System.Security.Cryptography.Native.Apple":
151154
Driver.Log (4, "Adding native reference to {0} in {1} because it's referenced by {2} in {3}.", pinfo.EntryPoint, pinfo.Module.Name, method.FullName, method.Module.Name);
152155
DerivedLinkContext.RequireMonoNative = true;

0 commit comments

Comments
 (0)