From 10d37d9256affc87170d3bce9cde7b929f1aa2f4 Mon Sep 17 00:00:00 2001 From: Frederik Seiffert Date: Fri, 9 Feb 2024 09:26:08 +0100 Subject: [PATCH] Enforce fast-path objc_msgSend() aka non-legacy dispatch Forces Clang to use the fast path, which is not enabled by default on arm64 even though it's supported in the runtime. Can be removed when Clang 18 containing this patch is available via the Android SDK: https://github.com/llvm/llvm-project/pull/76694 --- phases/20-gnustep-make.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/phases/20-gnustep-make.sh b/phases/20-gnustep-make.sh index f0c4e9d..351a142 100755 --- a/phases/20-gnustep-make.sh +++ b/phases/20-gnustep-make.sh @@ -19,6 +19,14 @@ mkdir -p "${INSTALL_PREFIX}"/etc/GNUstep GNUSTEP_USER_CONFIG_FILE="${INSTALL_PREFIX}"/etc/GNUstep/GNUstep-user.conf cp "${ROOT_DIR}"/config/gnustep-make-user.config "${GNUSTEP_USER_CONFIG_FILE}" +OPTIONS= +if [ "$ABI_NAME" == "arm64-v8a" ]; then + # enforce fast-path objc_msgSend() aka non-legacy dispatch (not enabled by default on arm64) + # can be removed when Clang 18 containing this patch is available via the Android SDK: + # https://github.com/llvm/llvm-project/pull/76694 + OPTIONS="OBJCFLAGS=-fno-objc-legacy-dispatch" +fi + echo -e "\n### Running configure" ./configure \ --host=${ANDROID_TARGET} \ @@ -26,6 +34,7 @@ echo -e "\n### Running configure" --with-library-combo=ng-gnu-gnu \ --with-user-config-file="${GNUSTEP_USER_CONFIG_FILE}" \ --with-runtime-abi=gnustep-2.0 \ + ${OPTIONS} echo -e "\n### Installing" make install