Skip to content

Commit f7f67bb

Browse files
authored
Remove _init and _fini exports from NAOT and update android docs (#100755)
1 parent 91d3051 commit f7f67bb

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/coreclr/nativeaot/docs/android-bionic.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ For an example of a Native AOT shared library invoked through JNI from Java see
2929

3030
## Known issues
3131

32-
If you hit `error : version script assignment of 'V1.0' to symbol '_init' failed: symbol not defined` - this is a known issue https://github.com/dotnet/runtime/issues/92272, you can add following lines to your csproj to work around:
32+
If you hit `error : version script assignment of 'V1.0' to symbol '_init' failed: symbol not defined` - this is a known issue with .NET 8 release https://github.com/dotnet/runtime/issues/92272, you can add following lines to your csproj to work around:
3333

3434
```xml
35-
<ItemGroup Condition="'$(RuntimeIdentifier)' == 'linux-bionic'">
36-
<LinkerArg Include="-Wl,--defsym,_init=__libc_init" />
37-
<LinkerArg Include="-Wl,--defsym,_fini=__libc_fini" />
35+
<ItemGroup Condition="$(RuntimeIdentifier.StartsWith('linux-bionic'))">
36+
<LinkerArg Include="-Wl,--undefined-version" />
3837
</ItemGroup>
3938
```
4039

src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ExportsFileWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void EmitExportedMethods()
5151
else
5252
{
5353
streamWriter.WriteLine("V1.0 {");
54-
streamWriter.WriteLine(" global: _init; _fini;");
54+
streamWriter.WriteLine(" global:");
5555
foreach (string symbol in _exportSymbols)
5656
streamWriter.WriteLine($" {symbol};");
5757
foreach (var method in _methods)

0 commit comments

Comments
 (0)