Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android: Support 16K page sizes. #506

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions arch/android/Makefile.deps
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ LIBOGG_VERSION ?= 1.3.5
LIBVORBIS_VERSION ?= 1.3.7
WGET ?= wget
TAR ?= tar
PATCH ?= patch

DEPS := arch/android/deps
DEPS_BUILD := arch/android/deps/.build
Expand Down Expand Up @@ -52,6 +53,7 @@ ${DEPS}/SDL2-${SDL_VERSION}: | ${DEPS}
${RM} -f [email protected]
${WGET} https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz [email protected]
${TAR} -xzf [email protected] -C ${DEPS}/
${PATCH} -i ../../SDL2-page-sizes.patch -p1 -d ${DEPS}/SDL2-${SDL_VERSION}

${DEPS}/libogg-${LIBOGG_VERSION}: | ${DEPS}
$(if ${V},,@echo " WGET " $@)
Expand Down
4 changes: 4 additions & 0 deletions arch/android/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ CLANG_PRE := ${ANDROID_LIBS}
BINUTILS_PRE := ${ANDROID_LIBS}
ABI := arm64-v8a
SDK := 21
# https://developer.android.com/guide/practices/page-sizes
ARCH_LDFLAGS += -Wl,-z,max-page-size=16384
else

ifeq (${ANDROID_TARGET},i686)
Expand All @@ -110,6 +112,8 @@ CLANG_PRE := ${ANDROID_LIBS}
BINUTILS_PRE := ${ANDROID_LIBS}
ABI := x86_64
SDK := 21
# https://developer.android.com/guide/practices/page-sizes
ARCH_LDFLAGS += -Wl,-z,max-page-size=16384
else

ANDROID_LIBS := none
Expand Down
23 changes: 23 additions & 0 deletions arch/android/SDL2-page-sizes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff -Nrup SDL2-2.30.9.orig/Android.mk SDL2-2.30.9/Android.mk
--- SDL2-2.30.9.orig/Android.mk 2023-06-04 08:55:56.000000000 +0200
+++ SDL2-2.30.9/Android.mk 2024-12-01 10:07:36.795771235 +0100
@@ -83,6 +83,9 @@ LOCAL_LDLIBS := -ldl -lGLESv1_CM -lGLESv

LOCAL_LDFLAGS := -Wl,--no-undefined

+# https://developer.android.com/guide/practices/page-sizes
+LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"
+
ifeq ($(NDK_DEBUG),1)
cmd-strip :=
endif
@@ -104,7 +107,8 @@ LOCAL_MODULE_FILENAME := libSDL2

LOCAL_LDLIBS :=

-LOCAL_LDFLAGS :=
+# https://developer.android.com/guide/practices/page-sizes
+LOCAL_LDFLAGS := "-Wl,-z,max-page-size=16384"

LOCAL_EXPORT_LDLIBS := -ldl -lGLESv1_CM -lGLESv2 -llog -landroid

3 changes: 3 additions & 0 deletions arch/android/libogg-Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ LOCAL_MODULE := libogg
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)

# https://developer.android.com/guide/practices/page-sizes
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"

LOCAL_SRC_FILES := src/bitwise.c src/framing.c

include $(BUILD_SHARED_LIBRARY)
6 changes: 6 additions & 0 deletions arch/android/libvorbis-Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/lib
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_SHARED_LIBRARIES := libogg

# https://developer.android.com/guide/practices/page-sizes
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"

LOCAL_SRC_FILES := lib/mdct.c lib/smallft.c lib/block.c lib/envelope.c lib/window.c lib/lsp.c \
lib/lpc.c lib/analysis.c lib/synthesis.c lib/psy.c lib/info.c \
lib/floor1.c lib/floor0.c \
Expand All @@ -21,6 +24,9 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/lib
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_SHARED_LIBRARIES := libogg libvorbis

# https://developer.android.com/guide/practices/page-sizes
LOCAL_LDFLAGS += "-Wl,-z,max-page-size=16384"

LOCAL_SRC_FILES := lib/vorbisfile.c

include $(BUILD_SHARED_LIBRARY)
Loading