go icon indicating copy to clipboard operation
go copied to clipboard

x/mobile: compatibility with Android 15

Open TikBai opened this issue 1 year ago • 2 comments

How to adapt to Android 15? android : https://developer.android.google.cn/guide/practices/page-sizes?hl=zh-cn#build WechatIMG16047

TikBai avatar Aug 07 '24 03:08 TikBai

The English version of that page: https://developer.android.google.cn/guide/practices/page-sizes#build

@hyangah is this something you know?

dr2chase avatar Aug 07 '24 17:08 dr2chase

I've solved this problem here, and before I can execute gomobile, I need to execute the environment variables below. export CGO_LDFLAGS="-Wl,-z,max-page-size=16384"

TikBai avatar Aug 26 '24 08:08 TikBai

I've solved this problem here, and before I can execute gomobile, I need to execute the environment variables below. export CGO_LDFLAGS="-Wl,-z,max-page-size=16384"

NDK version r28 and higher compile 16 KB-aligned by default so just update ndk to r28

a365344743s avatar Dec 06 '24 12:12 a365344743s

I've solved this problem here, and before I can execute gomobile, I need to execute the environment variables below. export CGO_LDFLAGS="-Wl,-z,max-page-size=16384"

NDK version r28 and higher compile 16 KB-aligned by default so just update ndk to r28

I did that, but it did not solve the problem. Although the resulting binary was claimed to be aligned by the check_elf_aligment script, in practice the library was still having a 4KB LOAD section alignment.

This was only resolved by (also) setting export CGO_LDFLAGS="-Wl,-z,max-page-size=16384".

arjenveenhuizen avatar Aug 19 '25 15:08 arjenveenhuizen