diff --git a/build_gcc.sh b/build_gcc.sh index c92bb88..a196c26 100755 --- a/build_gcc.sh +++ b/build_gcc.sh @@ -85,9 +85,16 @@ $MAKE -j$JOBS $MAKE install 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 + +pushd $OSXCROSS_TARGET_DIR/x86_64-apple-$OSXCROSS_TARGET/include &>/dev/null +pushd c++/${GCC_VERSION}* &>/dev/null + +cat $OSXCROSS_TARGET_DIR/../patches/libstdcxx.patch | \ + sed "s/darwin13/$OSXCROSS_TARGET/g" | \ + patch -p0 -l &>/dev/null || true + +popd &>/dev/null +popd &>/dev/null popd &>/dev/null # build popd &>/dev/null # gcc diff --git a/patches/libstdcxx.patch b/patches/libstdcxx.patch index 5ffaf6d..a5ba0bd 100644 --- a/patches/libstdcxx.patch +++ b/patches/libstdcxx.patch @@ -29,3 +29,27 @@ +#endif #endif // _GLIBCXX_CSTDDEF +--- x86_64-apple-darwin13/bits/c++config.h ++++ x86_64-apple-darwin13/bits/c++config.h +@@ -913,7 +913,9 @@ + #define _GLIBCXX_HAVE_TGMATH_H 1 + + /* Define to 1 if the target supports thread-local storage. */ ++#if !defined(__clang__) || __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1070 + #define _GLIBCXX_HAVE_TLS 1 ++#endif + + /* Define to 1 if you have the header file. */ + #define _GLIBCXX_HAVE_UNISTD_H 1 +--- x86_64-apple-darwin13/i386/bits/c++config.h ++++ x86_64-apple-darwin13/i386/bits/c++config.h +@@ -913,7 +913,9 @@ + #define _GLIBCXX_HAVE_TGMATH_H 1 + + /* Define to 1 if the target supports thread-local storage. */ ++#if !defined(__clang__) || __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1070 + #define _GLIBCXX_HAVE_TLS 1 ++#endif + + /* Define to 1 if you have the header file. */ + #define _GLIBCXX_HAVE_UNISTD_H 1