summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-07-31 10:36:44 +0200
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-07-31 10:36:44 +0200
commit30fe594557b10531d7b5c79c9429b246248a4619 (patch)
tree7e50ce0e52d5c691724848271aec5cc2f0b62d66
parent87c09b7cf5d0bbc6a4f17a62fb7a4d32d629e40b (diff)
parentf6edc2a2beed395162bb7f5db3b8f539251999af (diff)
downloadmullvadvpn-30fe594557b10531d7b5c79c9429b246248a4619.tar.xz
mullvadvpn-30fe594557b10531d7b5c79c9429b246248a4619.zip
Merge branch 'support-16kb-mempage-droid-1351'
-rw-r--r--android/CHANGELOG.md1
-rw-r--r--android/app/build.gradle.kts7
-rw-r--r--wireguard-go-rs/build.rs7
3 files changed, 13 insertions, 2 deletions
diff --git a/android/CHANGELOG.md b/android/CHANGELOG.md
index 5a583365fd..468a4de13e 100644
--- a/android/CHANGELOG.md
+++ b/android/CHANGELOG.md
@@ -24,6 +24,7 @@ Line wrap the file at 100 chars. Th
## [Unreleased]
### Added
- Add list of recent server selections in the select location view.
+- Add support for devices with 16KB page size.
## [android/2025.6-beta2] - 2025-07-18
diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts
index 470f23cd97..f679193ba6 100644
--- a/android/app/build.gradle.kts
+++ b/android/app/build.gradle.kts
@@ -293,6 +293,13 @@ cargo {
if (getBooleanProperty("mullvad.app.build.replaceRustPathPrefix"))
spec.environment("RUSTFLAGS", generateRemapArguments())
+
+ // Support 16KB page sizes
+ // https://developer.android.com/guide/practices/page-sizes#other-build-systems
+ spec.environment(
+ "RUST_ANDROID_GRADLE_CC_LINK_ARG",
+ "-Wl,-z,max-page-size=16384,-soname,lib${libname}.so",
+ )
}
}
diff --git a/wireguard-go-rs/build.rs b/wireguard-go-rs/build.rs
index c1aaf71485..5682118b19 100644
--- a/wireguard-go-rs/build.rs
+++ b/wireguard-go-rs/build.rs
@@ -492,8 +492,11 @@ fn build_android_dynamic_lib(out_dir: &str) -> anyhow::Result<()> {
.env("ANDROID_ABI", android_abi(target))
.env("ANDROID_ARCH_NAME", android_arch_name(target))
.env("GOPATH", &go_path)
- // Note: -w -s results in a stripped binary
- .env("LDFLAGS", format!("-L{out_dir} -w -s"))
+ // Note: -w -s results in a stripped binary.
+ // Note: -Wl -z and max-page-size is added to support 16KB page size.
+ // See the link below for more information.
+ // https://developer.android.com/guide/practices/page-sizes#other-build-systems
+ .env("LDFLAGS", format!("-L{out_dir} -w -s -Wl -z max-page-size=16384"))
// Note: the build container overrides CARGO_TARGET_DIR, which will cause problems
// since we will spawn another cargo process as part of building maybenot (which we
// link into libwg). A work around is to simply override the overridden value, and we