Makefile: add gomobile bind ldflags for 16Kb page support (#689)

Adds ldflags to support 16kb pages sizes for NDK 23.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
pull/691/head
Jonathan Nobels 4 months ago committed by GitHub
parent cc2f6386a6
commit f3467251fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -181,9 +181,11 @@ build-unstripped-aar: tailscale.version $(GOBIN)/gomobile
@echo "Output file: $(ABS_UNSTRIPPED_AAR)" @echo "Output file: $(ABS_UNSTRIPPED_AAR)"
mkdir -p $(dir $(ABS_UNSTRIPPED_AAR)) mkdir -p $(dir $(ABS_UNSTRIPPED_AAR))
rm -f $(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 \ $(GOBIN)/gomobile bind -target android -androidapi 26 \
-tags "$$(./build-tags.sh)" \ -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; } -o $(ABS_UNSTRIPPED_AAR) ./libtailscale || { echo "gomobile bind failed"; exit 1; }
@if [ ! -f $(ABS_UNSTRIPPED_AAR) ]; then \ @if [ ! -f $(ABS_UNSTRIPPED_AAR) ]; then \
echo "Error: $(ABS_UNSTRIPPED_AAR) was not created"; exit 1; \ echo "Error: $(ABS_UNSTRIPPED_AAR) was not created"; exit 1; \

Loading…
Cancel
Save