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

update ndk to 17 and switch some packages to clang build #2415

Merged
merged 25 commits into from
May 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b20c351
update ndk to 17
vishalbiswas May 10, 2018
ebcd7b2
bump NDK version in setup-android script
vishalbiswas May 10, 2018
36f53d9
libnl: fix for ndk r17
vishalbiswas May 10, 2018
c40c41a
libpixman: use clang's __builtin_shufflevector instead of __builtin_s…
May 10, 2018
ed1b6bf
fix as for arm
vishalbiswas May 10, 2018
3b63031
ndk17 still uses ld.bfd on aarch64
vishalbiswas May 10, 2018
682fd8f
use -fno-integrated-as for clang only
vishalbiswas May 11, 2018
cbd4b4b
glib: remove patch unnecessary after ndk17
vishalbiswas May 11, 2018
f24428c
torsocks: remove unneeded patch after ndk17
vishalbiswas May 11, 2018
e3f109b
subversion: fix build as clang++ now errors out for mismatched flags
vishalbiswas May 11, 2018
7de2328
libpulseaudio: fix build with ndk17
vishalbiswas May 11, 2018
43850b8
gst-plugins-good: disable video4linux2
vishalbiswas May 11, 2018
42459b9
libzmq: disable Werror to build with ndk17
vishalbiswas May 11, 2018
abdb664
ltrace: hardcode symbol not available in ndk17
vishalbiswas May 13, 2018
e6f3e20
busybox: build with clang for all arches except arm
Grimler91 May 13, 2018
67adb13
dropbear: build with clang instead of gcc
Grimler91 May 13, 2018
4b478b3
gnupg: build with clang instead of gcc
Grimler91 May 13, 2018
a378397
openssl: use clang for all arches except arm
Grimler91 May 13, 2018
c698ecc
picolisp: build with clang instead of gcc
Grimler91 May 13, 2018
72e3d20
valgrind: use clang on all arches except aarch64
Grimler91 May 13, 2018
0f49e20
Merge pull request #3 from Grimler91/ndk17
vishalbiswas May 13, 2018
e508eed
Revert "gst-plugins-good: disable video4linux2"
vishalbiswas May 19, 2018
f2eac18
libllvm: use default arm triple
vishalbiswas May 19, 2018
5829cba
Merge branch 'master' into ndk17
vishalbiswas May 19, 2018
7c7c367
Merge branch 'master' into ndk17
fornwall May 27, 2018
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
15 changes: 9 additions & 6 deletions build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ termux_step_setup_variables() {
: "${TERMUX_DEBUG:=""}"
: "${TERMUX_PKG_API_LEVEL:="21"}"
: "${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 @@ -369,7 +369,7 @@ termux_step_start_build() {
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_TOPDIR/_lib/${TERMUX_NDK_VERSION}-${TERMUX_ARCH}-${TERMUX_PKG_API_LEVEL}"
# Bump the below version if a change is made in toolchain setup to ensure
# that everyone gets an updated toolchain:
TERMUX_STANDALONE_TOOLCHAIN+="-v3"
TERMUX_STANDALONE_TOOLCHAIN+="-v1"

if [ -n "${TERMUX_PKG_BLACKLISTED_ARCHES:=""}" ] && [ "$TERMUX_PKG_BLACKLISTED_ARCHES" != "${TERMUX_PKG_BLACKLISTED_ARCHES/$TERMUX_ARCH/}" ]; then
echo "Skipping building $TERMUX_PKG_NAME for arch $TERMUX_ARCH"
Expand Down Expand Up @@ -563,6 +563,9 @@ termux_step_setup_toolchain() {
# "We recommend using the -mthumb compiler flag to force the generation of 16-bit Thumb-2 instructions".
# With r13 of the ndk ruby 2.4.0 segfaults when built on arm with clang without -mthumb.
CFLAGS+=" -march=armv7-a -mfpu=neon -mfloat-abi=softfp -mthumb"
if [ "$TERMUX_PKG_CLANG" != "no" ]; then
CFLAGS+=" -fno-integrated-as"
fi
LDFLAGS+=" -march=armv7-a"
elif [ "$TERMUX_ARCH" = "i686" ]; then
# From $NDK/docs/CPU-ARCH-ABIS.html:
Expand Down Expand Up @@ -637,17 +640,17 @@ 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
$_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
$_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld
fi

if [ "$TERMUX_ARCH" = "arm" ]; then
Expand Down Expand Up @@ -675,7 +678,7 @@ termux_step_setup_toolchain() {
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
Loading