From aa1865fe9a41f12397fd805a4493c1296dea9381 Mon Sep 17 00:00:00 2001 From: its-pointless Date: Sun, 16 Jul 2017 15:43:56 +1000 Subject: [PATCH] fixes building cstddef include for g++ --- build-package.sh | 3 ++- ndk-patches/cstddef.cpppatch | 14 ++++++++++++++ packages/ndk-stl/build.sh | 3 ++- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 ndk-patches/cstddef.cpppatch diff --git a/build-package.sh b/build-package.sh index 02ea6a543..54c0b95c6 100755 --- a/build-package.sh +++ b/build-package.sh @@ -592,7 +592,8 @@ termux_step_setup_toolchain() { https://raw.githubusercontent.com/madler/zlib/v1.2.8/$file done 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 mv $_TERMUX_TOOLCHAIN_TMPDIR $TERMUX_STANDALONE_TOOLCHAIN fi diff --git a/ndk-patches/cstddef.cpppatch b/ndk-patches/cstddef.cpppatch new file mode 100644 index 000000000..f62cc5ec8 --- /dev/null +++ b/ndk-patches/cstddef.cpppatch @@ -0,0 +1,14 @@ +--- /home/builder/cstddef.orig 2017-07-15 01:17:10.637496279 +0000 ++++ ./cstddef 2017-07-15 10:28:28.526713523 +0000 +@@ -40,7 +40,11 @@ + #endif + + // Don't include our own ; we don't want to declare ::nullptr_t. ++#ifdef __clang__ + #include_next ++#else ++#include "../../../lib/gcc/@TERMUX_HOST_PLATFORM@/4.9.x/include/stddef.h" ++#endif + #include <__nullptr> + + _LIBCPP_BEGIN_NAMESPACE_STD diff --git a/packages/ndk-stl/build.sh b/packages/ndk-stl/build.sh index 10cd6b7f4..18ef0626c 100644 --- a/packages/ndk-stl/build.sh +++ b/packages/ndk-stl/build.sh @@ -7,7 +7,8 @@ TERMUX_PKG_NO_DEVELSPLIT=yes termux_step_extract_into_massagedir () { mkdir -p $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/c++/v1/ cp -Rf $TERMUX_STANDALONE_TOOLCHAIN/include/c++/4.9.x/* $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/c++/v1/ - + cd $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/c++/v1/ + sed "s%\@TERMUX_HOST_PLATFORM\@%${TERMUX_HOST_PLATFORM}%g" $TERMUX_SCRIPTDIR/ndk-patches/cstddef.cpppatch | patch -p1 -R # fenv.h is a C++ compatibility header which should be included with the compiler #rm -Rf $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/{arm-linux-androideabi,tr1,tr2,fenv.h,complex.h,stdio.h,wctype.h} }