Skip to content

Commit 200412d

Browse files
committed
Support 16 KB page sizes
1 parent 5259fd3 commit 200412d

File tree

5 files changed

+31
-5
lines changed

5 files changed

+31
-5
lines changed

.github/workflows/build-android-toolchain.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ jobs:
184184
~/curl/arm
185185
~/curl/x86_64
186186
~/curl/x86
187-
key: curl-7_88_1-r12
187+
key: curl-7_88_1-r13
188188
- name: Install dependencies
189189
if: steps.cache-curl.outputs.cache-hit != 'true'
190190
run: ./build/000-install-dependencies-nobel.sh
@@ -250,7 +250,7 @@ jobs:
250250
~/libxml/arm
251251
~/libxml/x86_64
252252
~/libxml/x86
253-
key: libxmlv2.13.5-r4
253+
key: libxmlv2.13.5-r5
254254
- name: Install dependencies
255255
if: steps.cache-libxml.outputs.cache-hit != 'true'
256256
run: ./build/000-install-dependencies-nobel.sh

build/042-build-curl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ HOST=linux-x86_64
2626
TOOLCHAIN=$ANDROID_NDK/toolchains/llvm/prebuilt/$HOST
2727

2828
export CFLAGS="-O3 -g -DNDEBUG -fpic -ffunction-sections -fdata-sections -fstack-protector-strong -funwind-tables -no-canonical-prefixes"
29-
export LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
29+
export LDFLAGS="$LDFLAGS -Wl,--build-id=sha1 -Wl,-z,max-page-size=16384"
3030

3131
for arch in ${archs[*]}
3232
do

build/043-build-libxml.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ HOST=linux-x86_64
2525
TOOLCHAIN=$ANDROID_NDK/toolchains/llvm/prebuilt/$HOST
2626

2727
export CFLAGS="-O3 -g -DNDEBUG -fno-semantic-interposition -fpic -ffunction-sections -fdata-sections -fstack-protector-strong -funwind-tables -no-canonical-prefixes"
28-
export LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
28+
export LDFLAGS="$LDFLAGS -Wl,--build-id=sha1 -Wl,-z,max-page-size=16384"
2929

3030
for arch in ${archs[*]}
3131
do

build/common-flags.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ set(CMAKE_Swift_FLAGS
1414
"-tools-directory $ENV{ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin \
1515
-sdk $ENV{ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot \
1616
-resource-dir $ENV{ANDROID_NDK}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/swift \
17-
-Xlinker --build-id=sha1"
17+
-Xlinker --build-id=sha1 \
18+
-Xlinker -z -Xlinker max-page-size=16384"
1819
CACHE STRING "")
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 4943ffce5edf11eb99b594f34cd946a63c3a9a71 Mon Sep 17 00:00:00 2001
2+
From: Andrew Druk <[email protected]>
3+
Date: Fri, 16 May 2025 22:40:01 +0300
4+
Subject: [PATCH] Add 16Kb page sizes support
5+
6+
---
7+
stdlib/cmake/modules/AddSwiftStdlib.cmake | 2 ++
8+
1 file changed, 2 insertions(+)
9+
10+
diff --git a/stdlib/cmake/modules/AddSwiftStdlib.cmake b/stdlib/cmake/modules/AddSwiftStdlib.cmake
11+
index 88c09e534e6..477f0ef00ca 100644
12+
--- a/stdlib/cmake/modules/AddSwiftStdlib.cmake
13+
+++ b/stdlib/cmake/modules/AddSwiftStdlib.cmake
14+
@@ -2466,6 +2466,8 @@ function(add_swift_target_library name)
15+
list(APPEND swiftlib_link_flags_all "-Wl,-soname,lib${name}.so")
16+
# Add the build-id flag to ensure a unique identifier is included in the output binary.
17+
list(APPEND swiftlib_link_flags_all "-Wl,--build-id")
18+
+ # Ensure compatibility with Android 15+ devices using 16KB memory pages.
19+
+ list(APPEND swiftlib_link_flags_all "-Wl,-z,max-page-size=16384")
20+
endif()
21+
22+
if (SWIFTLIB_BACK_DEPLOYMENT_LIBRARY)
23+
--
24+
2.46.0
25+

0 commit comments

Comments
 (0)