Skip to content

Commit 362c88e

Browse files
committed
Pin NDK LLVM binutils for Android Opus cross-build
configure fell back to the host macOS ar/ranlib/strip (no NDK-prefixed wrappers exist in NDK r23+), so Apple's ranlib could not index the Android ELF objects in libopus.a. On the macOS 26 runner this produced an archive with no usable symbol table, breaking all opus_* symbol resolution at link time. Pin AR/RANLIB/STRIP/NM to the NDK llvm-* tools.
1 parent 66677ba commit 362c88e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

scripts/build_opus_android.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ for i in "${!ABIS[@]}"; do
4040
else
4141
PLATFORM="$OS-$(uname -m)"
4242
fi
43-
CC_PATH="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$PLATFORM/bin/${HOST}${API}-clang"
43+
TOOLBIN="$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$PLATFORM/bin"
44+
CC_PATH="$TOOLBIN/${HOST}${API}-clang"
4445

4546
OUT_DIR="$OUT_ROOT/$ABI"
4647
mkdir -p "$OUT_DIR"
@@ -55,6 +56,10 @@ for i in "${!ABIS[@]}"; do
5556
--enable-static \
5657
--host="$HOST" \
5758
CC="$CC_PATH" \
59+
AR="$TOOLBIN/llvm-ar" \
60+
RANLIB="$TOOLBIN/llvm-ranlib" \
61+
STRIP="$TOOLBIN/llvm-strip" \
62+
NM="$TOOLBIN/llvm-nm" \
5863
CFLAGS="-Oz" \
5964
--prefix="$OUT_DIR" \
6065
$EXTRA_CONFIGURE_FLAGS

0 commit comments

Comments
 (0)