Skip to content

Commit

Permalink
Add support for 16k pages in library builder
Browse files Browse the repository at this point in the history
  • Loading branch information
grendello committed Jul 10, 2024
1 parent 1c83e87 commit b8fba62
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tasks/LibraryBuilder/LibraryBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ private string BuildAndroidLibrary(List<string> sources, List<string> libs, List
buildOptions.CompilerArguments.Add(IsSharedLibrary ? $"-shared -o {libraryName}" : $"-o {libraryName}");
buildOptions.IncludePaths.Add(MonoRuntimeHeaders);
buildOptions.LinkerArguments.Add($"--soname={libraryName}");

// Google requires all the native libraries to be aligned to 16 bytes (for 16k memory page size)
// This is required only for 64-bit binaries, but there's not much harm if it is also done for 32-bit ones.
buildOptions.LinkerArguments.Add($"-z,max-page-size=16384");
buildOptions.LinkerArguments.AddRange(linkerArgs);
buildOptions.NativeLibraryPaths.AddRange(libs);
buildOptions.Sources.AddRange(sources);
Expand Down

0 comments on commit b8fba62

Please sign in to comment.