Skip to content

Commit 3857567

Browse files
committed
build: add Android 16KB page size flags to Makefile
1 parent 7cdf976 commit 3857567

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ IOS_BUILD_DIR := $(MOBILE_BUILD_DIR)/ios
2222
IOS_BUILD := $(IOS_BUILD_DIR)/Lndmobile.xcframework
2323
ANDROID_BUILD_DIR := $(MOBILE_BUILD_DIR)/android
2424
ANDROID_BUILD := $(ANDROID_BUILD_DIR)/Lndmobile.aar
25+
# For Android, set max page size to 16KB to support devices using 16KB memory pages.
26+
# Reference: https://developer.android.com/guide/practices/page-sizes
27+
ANDROID_MAX_PAGE_SIZE := 16384
28+
ANDROID_EXTLDFLAGS := -extldflags '-Wl,-z,max-page-size=$(ANDROID_MAX_PAGE_SIZE)'
2529

2630
COMMIT := $(shell git describe --tags --dirty)
2731

@@ -494,7 +498,7 @@ macos: mobile-rpc
494498
android: mobile-rpc
495499
@$(call print, "Building Android library ($(ANDROID_BUILD)).")
496500
mkdir -p $(ANDROID_BUILD_DIR)
497-
$(GOMOBILE_BIN) bind -target=android -androidapi 21 -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" -ldflags "$(RELEASE_LDFLAGS)" -v -o $(ANDROID_BUILD) $(MOBILE_PKG)
501+
$(GOMOBILE_BIN) bind -target=android -androidapi 21 -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" -ldflags "$(RELEASE_LDFLAGS) $(ANDROID_EXTLDFLAGS)" -v -o $(ANDROID_BUILD) $(MOBILE_PKG)
498502

499503
#? mobile: Build mobile RPC stubs and project templates for iOS and Android
500504
mobile: ios android

0 commit comments

Comments
 (0)