Update to NDK r18 (#2827)

This commit is contained in:
Fredrik Fornwall 2018-09-19 23:29:39 +02:00 committed by GitHub
parent 90d41b3c12
commit 02c0668a9b
12 changed files with 143 additions and 66 deletions

View File

@ -207,10 +207,6 @@ termux_setup_cmake() {
# First step is to handle command-line arguments. Not to be overridden by packages.
termux_step_handle_arguments() {
# shellcheck source=/dev/null
test -f "$HOME/.termuxrc" && source "$HOME/.termuxrc"
# Handle command-line arguments:
_show_usage () {
echo "Usage: ./build-package.sh [-a ARCH] [-d] [-D] [-f] [-q] [-s] [-o DIR] PACKAGE"
echo "Build a package by creating a .deb file in the debs/ folder."
@ -277,8 +273,6 @@ termux_step_handle_arguments() {
termux_step_setup_variables() {
# shellcheck source=scripts/properties.sh
. "$TERMUX_SCRIPTDIR/scripts/properties.sh"
: "${ANDROID_HOME:="${HOME}/lib/android-sdk"}"
: "${NDK:="${HOME}/lib/android-ndk"}"
: "${TERMUX_MAKE_PROCESSES:="$(nproc)"}"
: "${TERMUX_TOPDIR:="$HOME/.termux-build"}"
: "${TERMUX_ARCH:="aarch64"}" # arm, aarch64, i686 or x86_64.
@ -665,20 +659,6 @@ termux_step_setup_toolchain() {
# Remove android-support header wrapping not needed on android-21:
rm -Rf $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/local
local wrapped plusplus CLANG_TARGET=$TERMUX_HOST_PLATFORM
if [ $TERMUX_ARCH = arm ]; then CLANG_TARGET=${CLANG_TARGET/arm-/armv7a-}; fi
for wrapped in ${TERMUX_HOST_PLATFORM}-clang clang; do
for plusplus in "" "++"; do
local FILE_TO_REPLACE=$_TERMUX_TOOLCHAIN_TMPDIR/bin/${wrapped}${plusplus}
if [ ! -f $FILE_TO_REPLACE ]; then
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/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 \
@ -703,6 +683,12 @@ termux_step_setup_toolchain() {
done
fi
# Setup the cpp preprocessor:
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-clang \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-cpp
sed -i 's/clang70/clang70 -E/' \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$TERMUX_HOST_PLATFORM-cpp
cd $_TERMUX_TOOLCHAIN_TMPDIR/sysroot
for f in $TERMUX_SCRIPTDIR/ndk-patches/*.patch; do
@ -737,6 +723,9 @@ termux_step_setup_toolchain() {
unset file
cd $_TERMUX_TOOLCHAIN_TMPDIR/include/c++/4.9.x
sed "s%\@TERMUX_HOST_PLATFORM\@%${TERMUX_HOST_PLATFORM}%g" $TERMUX_SCRIPTDIR/ndk-patches/*.cpppatch | patch -p1
# Fix relative path in gcc/g++ script:
sed -i "s%\`dirname \$0\`/../../../../%$NDK/toolchains/%g" $_TERMUX_TOOLCHAIN_TMPDIR/bin/${TERMUX_HOST_PLATFORM}-gcc
sed -i "s%\`dirname \$0\`/../../../../%$NDK/toolchains/%g" $_TERMUX_TOOLCHAIN_TMPDIR/bin/${TERMUX_HOST_PLATFORM}-g++
mv $_TERMUX_TOOLCHAIN_TMPDIR $TERMUX_STANDALONE_TOOLCHAIN
fi

View File

@ -18,4 +18,5 @@ ac_cv_func_gettimeofday=yes
ac_cv_func_sleep=yes
ac_cv_func_usleep=yes
ac_cv_search_getaddrinfo=no
ac_cv_c_bigendian=no
"

View File

@ -12,6 +12,10 @@ TERMUX_PKG_KEEP_STATIC_LIBRARIES=true
# Avoid linking against libfl.so from flex if available:
export LEXLIB=
termux_step_pre_configure () {
export CPPFLAGS="$CPPFLAGS -Wno-c++11-narrowing"
}
termux_step_post_make_install () {
cp $TERMUX_PKG_BUILDER_DIR/ldd $TERMUX_PREFIX/bin/ldd
cd $TERMUX_PREFIX/bin

View File

@ -0,0 +1,118 @@
--- ../display.cpp.orig 2018-09-14 05:18:09.639671232 +0000
+++ ./src/display.cpp 2018-09-14 05:31:01.173668070 +0000
@@ -311,7 +311,13 @@
ss << mb_read << "MB of " << fdht->stat_megs() << "MB done, ";
char msg[64];
- snprintf(msg,sizeof(msg),"%02"PRIu64":%02"PRIu64":%02"PRIu64" left", hour, min, seconds);
+ snprintf(msg,sizeof(msg),"%02"
+ PRIu64
+ ":%02"
+ PRIu64
+ ":%02"
+ PRIu64
+ " left", hour, min, seconds);
ss << msg;
}
ss << "\r";
@@ -424,14 +430,23 @@
if (opt_verbose) {
if(opt_verbose >= MORE_VERBOSE){
- status(" Input files examined: %"PRIu64, this->match.total);
- status(" Known files expecting: %"PRIu64, this->match.expect);
+ status(" Input files examined: %"
+ PRIu64
+ , this->match.total);
+ status(" Known files expecting: %"
+ PRIu64
+ , this->match.expect);
}
- status(" Files matched: %"PRIu64, this->match.exact);
- status("Files partially matched: %"PRIu64, this->match.partial);
- status(" Files moved: %"PRIu64, this->match.moved);
- status(" New files found: %"PRIu64, this->match.unknown);
- status(" Known files not found: %"PRIu64, this->match.unused);
+ status(" Files matched: %"
+ PRIu64, this->match.exact);
+ status("Files partially matched: %"
+ PRIu64, this->match.partial);
+ status(" Files moved: %"
+ PRIu64, this->match.moved);
+ status(" New files found: %"
+ PRIu64, this->match.unknown);
+ status(" Known files not found: %"
+ PRIu64, this->match.unused);
}
}
--- ../files.cpp.orig 2018-09-14 05:40:44.400251202 +0000
+++ ./src/files.cpp 2018-09-14 05:53:37.048950212 +0000
@@ -509,7 +509,8 @@
// Users expect the line numbers to start at one, not zero.
if ((!ocb.opt_silent) || (mode_warn_only)) {
- ocb.error("%s: No hash found in line %"PRIu32, fn, count + 1);
+ ocb.error("%s: No hash found in line %"
+ PRIu32, fn, count + 1);
ocb.error("%s: %s", fn, strerror(errno));
return status_t::STATUS_USER_ERROR;
}
@@ -542,7 +543,9 @@
}
if (expected_hashes != count){
- ocb.error("%s: Expecting %"PRIu32" hashes, found %"PRIu32"\n",
+ ocb.error("%s: Expecting %"
+ PRIu32" hashes, found %"
+ PRIu32"\n",
fn, expected_hashes, count);
}
return status_t::status_ok;
--- ../hash.cpp.orig 2018-09-14 05:18:30.955822289 +0000
+++ ./src/hash.cpp 2018-09-14 05:31:24.777749460 +0000
@@ -124,7 +124,9 @@
// If an error occured, display a message and see if we need to quit.
if ((current_read_bytes<0) || (this->handle && ferror(this->handle))){
- ocb->error_filename(this->file_name,"error at offset %"PRIu64": %s",
+ ocb->error_filename(this->file_name,"error at offset %"
+ PRIu64
+ ": %s",
request_start, strerror(errno));
if (file_fatal_error()){
--- ../hashlist.cpp.orig 2018-09-14 05:32:48.130337357 +0000
+++ ./src/hashlist.cpp 2018-09-14 05:33:08.194462187 +0000
@@ -342,7 +342,8 @@
file_data_t *t = new (std::nothrow) file_data_t();
if (NULL == t)
{
- ocb->fatal_error("%s: Out of memory in line %"PRIu64,
+ ocb->fatal_error("%s: Out of memory in line %"
+ PRIu64,
fn.c_str(), line_number);
}
@@ -390,7 +391,8 @@
if ( !algorithm_t::valid_hash(hash_column[column_number],word))
{
if (ocb)
- ocb->error("%s: Invalid %s hash in line %"PRIu64,
+ ocb->error("%s: Invalid %s hash in line %"
+ PRIu64,
fn.c_str(),
hashes[hash_column[column_number]].name.c_str(),
line_number);
--- ../xml.h.orig 2018-09-14 05:12:00.783661170 +0000
+++ ./src/xml.h 2018-09-14 05:29:23.697673797 +0000
@@ -100,7 +100,8 @@
void xmlout(const std::string &tag,const std::string &value){ xmlout(tag,value,"",true); }
void xmlout(const std::string &tag,const int value){ xmlprintf(tag,"","%d",value); }
void xmloutl(const std::string &tag,const long value){ xmlprintf(tag,"","%ld",value); }
- void xmlout(const std::string &tag,const int64_t value){ xmlprintf(tag,"","%"PRId64,value); }
+ void xmlout(const std::string &tag,const int64_t value){ xmlprintf(tag,"","%"
+ PRId64,value); }
void xmlout(const std::string &tag,const double value){ xmlprintf(tag,"","%f",value); }
void xmlout(const std::string &tag,const struct timeval &ts){
xmlprintf(tag,"","%d.%06d",(int)ts.tv_sec, (int)ts.tv_usec);

View File

@ -4,7 +4,7 @@ TERMUX_PKG_VERSION=1.3.4
TERMUX_PKG_REVISION=3
TERMUX_PKG_SRCURL=https://fossies.org/linux/privat/cln-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_SHA256=c32e59b6afbcf8b84075ab454c42982429c6ea9675aee2bbda176cb85293e38f
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-gnu-ld=no"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_c_bigendian=no --with-gnu-ld=no"
TERMUX_PKG_DEPENDS="libgmp"
TERMUX_PKG_BUILD_IN_SRC=yes

View File

@ -5,10 +5,3 @@ TERMUX_PKG_VERSION=4.0.1
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/mpfr/mpfr-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_header_locale_h=no"
termux_step_pre_configure() {
if [ "$TERMUX_ARCH" = i686 ]; then
# Fix clang internal error (on clang in ndk r17):
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --disable-float128"
fi
}

View File

@ -21,7 +21,7 @@ prepare_libs () {
cp $BASEDIR/*.o $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib
LIBATOMIC=$NDK/toolchains/${NDK_SUFFIX}-*/prebuilt/linux-*/${SUFFIX}/lib
if [ $ARCH = arm64 ]; then LIBATOMIC+="64"; fi
if [ $ARCH = "arm64" ] || [ $ARCH = "x86_64" ]; then LIBATOMIC+="64"; fi
if [ $ARCH = "arm" ]; then LIBATOMIC+="/armv7-a"; fi
cp $LIBATOMIC/libatomic.a $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/$SUFFIX/lib/

View File

@ -8,6 +8,7 @@ TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/p7zip/p7zip/${TERMUX
TERMUX_PKG_BUILD_IN_SRC=yes
termux_step_configure () {
export CXXFLAGS="$CXXFLAGS -Wno-c++11-narrowing"
cp makefile.android_arm makefile.machine
}

View File

@ -5,6 +5,7 @@ TERMUX_PKG_SHA256=461b45627a0d800061657b2d800c432c7d1c86c859b40a3ced35a0cc6a85fa
TERMUX_PKG_MAINTAINER="Oliver Schmidhauser @Neo-Oli"
TERMUX_PKG_SRCURL=https://github.com/Parchive/par2cmdline/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_c_bigendian=no"
termux_step_pre_configure() {
if [ $TERMUX_ARCH = "i686" ]; then

View File

@ -1,32 +0,0 @@
#!/bin/bash
force_fPIE=1
force_pie=1
for opt; do
case "$opt" in
-fno-PIC|-fno-pic|-fno-PIE|-fno-pie|-nopie|-static|--static|-shared|--shared|-D__KERNEL__|-nostdlib|-nostartfiles|-mcmodel=kernel|-v|--version|-M*)
force_fPIE=0
force_pie=0
;;
-fPIC|-fpic|-fPIE|-fpie)
force_fPIE=0
;;
-c|-E|-S)
force_pie=0
;;
esac
done
arguments=()
(( $force_fPIE )) && arguments+=(-fPIE)
(( $force_pie )) && arguments+=(-pie)
# The ordinary wrapper from a NDK standalone toolchain
# with "${arguments[@]}" added.
if [ "$1" != "-cc1" ]; then
`dirname $0`/COMPILER -target CLANG_TARGET --sysroot `dirname $0`/../sysroot "${arguments[@]}" "$@"
else
# target/triple already spelled out.
`dirname $0`/COMPILER "${arguments[@]}" "$@"
fi

View File

@ -1,2 +1,7 @@
TERMUX_NDK_VERSION=17
TERMUX_NDK_VERSION=18
TERMUX_ANDROID_BUILD_TOOLS_VERSION=28.0.2
test -f "$HOME/.termuxrc" && source "$HOME/.termuxrc"
: "${ANDROID_HOME:="${HOME}/lib/android-sdk"}"
: "${NDK:="${HOME}/lib/android-ndk"}"

View File

@ -3,14 +3,11 @@ set -e -u
# Install desired parts of the Android SDK:
. $(cd "$(dirname "$0")"; pwd)/properties.sh
test -f $HOME/.termuxrc && . $HOME/.termuxrc
: ${ANDROID_HOME:="${HOME}/lib/android-sdk"}
: ${NDK:="${HOME}/lib/android-ndk"}
ANDROID_SDK_FILE=sdk-tools-linux-4333796.zip
ANDROID_SDK_SHA256=92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9
ANDROID_NDK_FILE=android-ndk-r${TERMUX_NDK_VERSION}-Linux-x86_64.zip
ANDROID_NDK_SHA256=ba3d813b47de75bc32a2f3de087f72599c6cb36fdc9686b96f517f5492ff43ca
ANDROID_NDK_SHA256=c413dd014edc37f822d0dc88fabc05b64232d07d5c6e9345224e47073fdf140b
if [ ! -d $ANDROID_HOME ]; then
mkdir -p $ANDROID_HOME