--- libstdc++-v3/configure.host.orig +++ libstdc++-v3/configure.host @@ -262,6 +262,9 @@ freebsd*) os_include_dir="os/bsd/freebsd" ;; + linux-android*) + os_include_dir="os/bionic" + ;; linux-musl*) os_include_dir="os/generic" ;; --- libstdc++-v3/config/os/bionic/ctype_base.h.orig +++ libstdc++-v3/config/os/bionic/ctype_base.h @@ -38,6 +38,18 @@ // Non-standard typedefs. typedef const int* __to_type; +#ifdef _CTYPE_U +#define _U _CTYPE_U +#define _L _CTYPE_L +#define _D _CTYPE_D +#define _S _CTYPE_S +#define _P _CTYPE_P +#define _C _CTYPE_C +#define _X _CTYPE_X +#define _B _CTYPE_B +#define _N _CTYPE_D +#endif + // NB: Offsets into ctype::_M_table force a particular size // on the mask type. Because of this, we don't use an enum. typedef char mask; --- libstdc++-v3/src/c++11/futex.cc.orig +++ libstdc++-v3/src/c++11/futex.cc @@ -27,7 +27,11 @@ #if defined(_GLIBCXX_HAVE_LINUX_FUTEX) && ATOMIC_INT_LOCK_FREE > 1 #include #include +#ifdef __ANDROID__ +#include +#else #include +#endif #include #include #include --- libstdc++-v3/src/filesystem/dir.cc.orig +++ libstdc++-v3/src/filesystem/dir.cc @@ -146,7 +146,13 @@ int err = std::exchange(errno, 0); const auto entp = readdir(dirp); +#ifdef __ANDROID__ + int tmperr = errno; + errno = err; + err = tmperr; +#else std::swap(errno, err); +#endif if (entp) {