build: add Android 16KB page size flags to Makefile
What changed, and why it matters
This commit changes the Android build settings for LND's mobile library so it works on newer Android devices that use 16KB memory pages. It is a compatibility/build fix, not a security patch. There is no indication it fixes a vulnerability.
No security action required. Treat as a normal build-compatibility update. If deploying the Android library, verify builds succeed on 16KB-page Android devices/emulators.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The Makefile change adds -extldflags '-Wl,-z,max-page-size=16384' to the gomobile Android build command. This aligns the compiled binary with Android’s 16KB page-size devices (per Google’s developer guidance). It does not modify LND logic, cryptography, networking, or access controls.
Changed components
MakefileAndroid mobile build targetInspect captured patch +5 / −1
diff --git a/Makefile b/Makefile
index aa98b4d..3ee1ee4 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,10 @@ IOS_BUILD_DIR := $(MOBILE_BUILD_DIR)/ios
IOS_BUILD := $(IOS_BUILD_DIR)/Lndmobile.xcframework
ANDROID_BUILD_DIR := $(MOBILE_BUILD_DIR)/android
ANDROID_BUILD := $(ANDROID_BUILD_DIR)/Lndmobile.aar
+# For Android, set max page size to 16KB to support devices using 16KB memory pages.
+# Reference: https://developer.android.com/guide/practices/page-sizes
+ANDROID_MAX_PAGE_SIZE := 16384
+ANDROID_EXTLDFLAGS := -extldflags '-Wl,-z,max-page-size=$(ANDROID_MAX_PAGE_SIZE)'
COMMIT := $(shell git describe --tags --dirty)
@@ -494,7 +498,7 @@ macos: mobile-rpc
android: mobile-rpc
@$(call print, "Building Android library ($(ANDROID_BUILD)).")
mkdir -p $(ANDROID_BUILD_DIR)
- $(GOMOBILE_BIN) bind -target=android -androidapi 21 -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" -ldflags "$(RELEASE_LDFLAGS)" -v -o $(ANDROID_BUILD) $(MOBILE_PKG)
+ $(GOMOBILE_BIN) bind -target=android -androidapi 21 -tags="mobile $(DEV_TAGS) $(RPC_TAGS)" -ldflags "$(RELEASE_LDFLAGS) $(ANDROID_EXTLDFLAGS)" -v -o $(ANDROID_BUILD) $(MOBILE_PKG)
#? mobile: Build mobile RPC stubs and project templates for iOS and Android
mobile: ios android
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.