mono / SkiaSharp

SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
MIT License
4.54k stars 543 forks source link

[FEATURE] <.NET9> contains a shared library 'libSkiaSharp.so' which is not correctly aligned. #3025

Open bcaceiro opened 1 month ago

bcaceiro commented 1 month ago

Is your feature request related to a problem?

Building a .net MAUI project with Skia gives these warnings

NuGet package 'SkiaSharp.NativeAssets.Android' version '3.0.0-preview.3.1' contains a shared library 'libSkiaSharp.so' which is not correctly aligned. See https://developer.android.com/guide/practices/page-sizes for more details

Describe the solution you would like

Alignment issues solved for .net 9

Describe alternatives you have considered

It's not ab locking issue, since it can compile, just to leave this into consideration

Additional context

No response

Code of Conduct

mattleibow commented 1 month ago

@jonathanpeppers any thoughts on what this means?

jonathanpeppers commented 1 month ago

This is the upcoming 16kb alignment requirement for Google Play, and probably Android 16 / API 36 next year.

@grendello were you looking at this for SkiaSharp?

grendello commented 1 month ago

@jonathanpeppers I tried to, but couldn't build it locally and then I got distracted by other tasks. I'll try to look into it soon.

mattleibow commented 1 month ago

Is there some compiler/linker flag? If this is a Google requirement, then I am sure the latest skia code will have it somewhere and I could find it with a code search and backport.

grendello commented 1 month ago

Is there some compiler/linker flag? If this is a Google requirement, then I am sure the latest skia code will have it somewhere and I could find it with a code search and backport.

If building with the NDK r28 (not yet released), the 16k alignment would be enabled automatically. With older NDK versions, one has to pass the -Wl,-z,max-page-size=16384 flag to the compiler when linking (or -z max-page-size=16384 when invoking the linker directly)

You can find more details here and here