Skip to content

Commit

Permalink
ndk r17-beta2 upgrade: initial commit
Browse files Browse the repository at this point in the history
* Upgrading is needed in order to fix the stupid situation we're in
  with docker-tini:
  * Needs to have API >= 23 for sigtimedwait
    (termux#899)
  * Needs to have API <= 21 for static linking
    (android/ndk#272)
* The latter of the 2 above restrictions was removed in NDK r17, so
  that's why we're upgrading.
* The other changes (removed headers and patches) are according to
  Mr. Fornwall himself:
  termux#1905

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
  • Loading branch information
vladimiroltean committed May 3, 2018
1 parent 37992fb commit 6f477f2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3,606 deletions.
15 changes: 3 additions & 12 deletions build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ termux_step_setup_variables() {
: "${TERMUX_DEBUG:=""}"
: "${TERMUX_PKG_API_LEVEL:="23"}"
: "${TERMUX_ANDROID_BUILD_TOOLS_VERSION:="27.0.3"}"
: "${TERMUX_NDK_VERSION:="16"}"
: "${TERMUX_NDK_VERSION:="17"}"

if [ "x86_64" = "$TERMUX_ARCH" ] || [ "aarch64" = "$TERMUX_ARCH" ]; then
TERMUX_ARCH_BITS=64
Expand Down Expand Up @@ -637,19 +637,11 @@ termux_step_setup_toolchain() {
termux_error_exit "No toolchain file to override: $FILE_TO_REPLACE"
fi
cp "$TERMUX_SCRIPTDIR/scripts/clang-pie-wrapper" $FILE_TO_REPLACE
sed -i "s/COMPILER/clang50$plusplus/" $FILE_TO_REPLACE
sed -i "s/COMPILER/clang60$plusplus/" $FILE_TO_REPLACE
sed -i "s/CLANG_TARGET/$CLANG_TARGET/" $FILE_TO_REPLACE
done
done

if [ "$TERMUX_ARCH" = "aarch64" ]; then
# Use gold by default to work around https://github.com/android-ndk/ndk/issues/148
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld.gold \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/aarch64-linux-android-ld
cp $_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld.gold \
$_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld
fi

if [ "$TERMUX_ARCH" = "arm" ]; then
# Linker wrapper script to add '--exclude-libs libgcc.a', see
# https://github.com/android-ndk/ndk/issues/379
Expand All @@ -672,9 +664,8 @@ termux_step_setup_toolchain() {
sed "s%\@TERMUX_HOME\@%${TERMUX_ANDROID_HOME}%g" "$f" | \
patch --silent -p1;
done
# elf.h: Taken from glibc since the elf.h in the NDK is lacking.
# ifaddrs.h: Added in android-24 unified headers, use a inline implementation for now.
cp "$TERMUX_SCRIPTDIR"/ndk-patches/{elf.h,ifaddrs.h,libintl.h} usr/include
cp "$TERMUX_SCRIPTDIR"/ndk-patches/{ifaddrs.h,libintl.h} usr/include

# Remove <sys/shm.h> from the NDK in favour of that from the libandroid-shmem.
# Remove <sys/sem.h> as it doesn't work for non-root.
Expand Down

0 comments on commit 6f477f2

Please sign in to comment.