Skip to content

Commit f346725

Browse files
authored
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>
1 parent cc2f638 commit f346725

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,11 @@ build-unstripped-aar: tailscale.version $(GOBIN)/gomobile
181181
@echo "Output file: $(ABS_UNSTRIPPED_AAR)"
182182
mkdir -p $(dir $(ABS_UNSTRIPPED_AAR))
183183
rm -f $(ABS_UNSTRIPPED_AAR)
184+
# The -linkmode=external -extldflags=-Wl,-z,max-page-size=16384 is specific to NDK 23
185+
# to support 16kb page sizes. Your mileage may vary with other NDK versions.
184186
$(GOBIN)/gomobile bind -target android -androidapi 26 \
185187
-tags "$$(./build-tags.sh)" \
186-
-ldflags "$$(./version-ldflags.sh)" \
188+
-ldflags "-linkmode=external -extldflags=-Wl,-z,max-page-size=16384 $$(./version-ldflags.sh)" \
187189
-o $(ABS_UNSTRIPPED_AAR) ./libtailscale || { echo "gomobile bind failed"; exit 1; }
188190
@if [ ! -f $(ABS_UNSTRIPPED_AAR) ]; then \
189191
echo "Error: $(ABS_UNSTRIPPED_AAR) was not created"; exit 1; \

0 commit comments

Comments
 (0)