From 7e3e9c4d3b5440591b54fefd5ecc2d6314040a50 Mon Sep 17 00:00:00 2001 From: Jonathan Nobels Date: Tue, 12 Aug 2025 13:58:14 -0400 Subject: [PATCH] Makefile: add gomobile bind -ldflags for 16Kb page support Adds ldflags to support 16kb pages sizes for NDK 23. Signed-off-by: Jonathan Nobels --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ea93133f77..685ea19073 100644 --- a/Makefile +++ b/Makefile @@ -181,9 +181,11 @@ build-unstripped-aar: tailscale.version $(GOBIN)/gomobile @echo "Output file: $(ABS_UNSTRIPPED_AAR)" mkdir -p $(dir $(ABS_UNSTRIPPED_AAR)) rm -f $(ABS_UNSTRIPPED_AAR) + # The -linkmode=external -extldflags=-Wl,-z,max-page-size=16384 is specific to NDK 23 + # to support 16kb page sizes. Your mileage may vary with other NDK versions. $(GOBIN)/gomobile bind -target android -androidapi 26 \ -tags "$$(./build-tags.sh)" \ - -ldflags "$$(./version-ldflags.sh)" \ + -ldflags "-linkmode=external -extldflags=-Wl,-z,max-page-size=16384 $$(./version-ldflags.sh)" \ -o $(ABS_UNSTRIPPED_AAR) ./libtailscale || { echo "gomobile bind failed"; exit 1; } @if [ ! -f $(ABS_UNSTRIPPED_AAR) ]; then \ echo "Error: $(ABS_UNSTRIPPED_AAR) was not created"; exit 1; \