diff --git a/build_gcc.sh b/build_gcc.sh index d981a8a..c92fe9a 100755 --- a/build_gcc.sh +++ b/build_gcc.sh @@ -11,11 +11,11 @@ source tools/tools.sh # GCC version to build # (<4.7 will not work properly with libc++) -GCC_VERSION=4.8.2 +GCC_VERSION=4.9.0 #GCC_VERSION=4.9-20140416 # snapshot # GCC mirror -GCC_MIRROR="ftp://ftp.gwdg.de/pub/misc/gcc" +GCC_MIRROR="ftp://ftp.fu-berlin.de/unix/languages/gcc" require wget @@ -82,8 +82,14 @@ fi $EXTRACONFFLAGS $MAKE -j$JOBS +$MAKE install -j$JOBS || \ $MAKE install -j$JOBS +GCC_VERSION=`echo $GCC_VERSION | tr '-' ' ' | awk '{print $1}'` +pushd $OSXCROSS_TARGET_DIR/x86_64-apple-$OSXCROSS_TARGET/include/c++/${GCC_VERSION}* &>/dev/null +patch -p0 -l < $OSXCROSS_TARGET_DIR/../patches/libstdcxx.patch &>/dev/null || true +popd &>/dev/null + popd &>/dev/null # build popd &>/dev/null # gcc diff --git a/patches/libstdcxx.patch b/patches/libstdcxx.patch new file mode 100644 index 0000000..5ffaf6d --- /dev/null +++ b/patches/libstdcxx.patch @@ -0,0 +1,31 @@ +--- bits/random.h ++++ bits/random.h +@@ -101,10 +101,12 @@ + { typedef unsigned long long type; }; + + #ifdef _GLIBCXX_USE_INT128 ++#ifndef __clang__ + template + struct _Select_uint_least_t<__s, 1> + { typedef unsigned __int128 type; }; + #endif ++#endif + + // Assume a != 0, a < m, c < m, x < m. + template + + #if __cplusplus >= 201103L ++#ifndef __clang__ + namespace std + { + // We handle size_t, ptrdiff_t, and nullptr_t in c++config.h. + using ::max_align_t; + } + #endif ++#endif + + #endif // _GLIBCXX_CSTDDEF