mirror of
https://github.com/Relintai/osxcross.git
synced 2025-02-03 22:45:56 +01:00
Fix building GCC < 9.0.0 with SDK >= 10.14
This commit is contained in:
parent
6a46fa5e35
commit
caf707bf92
33
build_gcc.sh
33
build_gcc.sh
@ -59,23 +59,46 @@ pushd gcc*$GCC_VERSION* &>/dev/null
|
|||||||
rm -f $OSXCROSS_TARGET_DIR/bin/*-gcc*
|
rm -f $OSXCROSS_TARGET_DIR/bin/*-gcc*
|
||||||
rm -f $OSXCROSS_TARGET_DIR/bin/*-g++*
|
rm -f $OSXCROSS_TARGET_DIR/bin/*-g++*
|
||||||
|
|
||||||
if [ $(osxcross-cmp $GCC_VERSION '>' 5.0.0) == 1 ] &&
|
if [ $(osxcross-cmp $GCC_VERSION '>' 5.0.0) -eq 1 ] &&
|
||||||
[ $(osxcross-cmp $GCC_VERSION '<' 5.3.0) == 1 ]; then
|
[ $(osxcross-cmp $GCC_VERSION '<' 5.3.0) -eq 1 ]; then
|
||||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66035
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66035
|
||||||
patch -p1 < $PATCH_DIR/gcc-pr66035.patch
|
patch -p1 < $PATCH_DIR/gcc-pr66035.patch
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $(osxcross-cmp $GCC_VERSION '>=' 6.1.0) == 1 ] &&
|
if [ $(osxcross-cmp $GCC_VERSION '>=' 6.1.0) -eq 1 ] &&
|
||||||
[ $(osxcross-cmp $GCC_VERSION '<=' 6.3.0) == 1 ]; then
|
[ $(osxcross-cmp $GCC_VERSION '<=' 6.3.0) -eq 1 ]; then
|
||||||
# https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00129.html
|
# https://gcc.gnu.org/ml/gcc-patches/2016-09/msg00129.html
|
||||||
patch -p1 < $PATCH_DIR/gcc-6-buildfix.patch
|
patch -p1 < $PATCH_DIR/gcc-6-buildfix.patch
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $(osxcross-cmp $GCC_VERSION '==' 6.3.0) == 1 ]; then
|
if [ $(osxcross-cmp $GCC_VERSION '==' 6.3.0) -eq 1 ]; then
|
||||||
# https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/darwin-driver.c?r1=244010&r2=244009&pathrev=244010
|
# https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/darwin-driver.c?r1=244010&r2=244009&pathrev=244010
|
||||||
patch -p1 < $PATCH_DIR/darwin-driver.c.patch
|
patch -p1 < $PATCH_DIR/darwin-driver.c.patch
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $(osxcross-cmp $OSXCROSS_SDK_VERSION '>=' 10.14) -eq 1 ] &&
|
||||||
|
[ $(osxcross-cmp $GCC_VERSION '<' 9.0.0) -eq 1 ]; then
|
||||||
|
files_to_patch=(
|
||||||
|
libsanitizer/asan/asan_mac.cc
|
||||||
|
libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
|
||||||
|
libsanitizer/sanitizer_common/sanitizer_posix.cc
|
||||||
|
libsanitizer/sanitizer_common/sanitizer_mac.cc
|
||||||
|
gcc/ada/init.c
|
||||||
|
gcc/config/darwin-driver.c
|
||||||
|
)
|
||||||
|
|
||||||
|
for file in ${files_to_patch[*]}; do
|
||||||
|
if [ -f $file ]; then
|
||||||
|
echo patching $PWD/$file
|
||||||
|
$SED -i 's/#include <sys\/sysctl.h>/#define _Atomic volatile\n#include <sys\/sysctl.h>\n#undef _Atomic/g' $file
|
||||||
|
$SED -i 's/#include <sys\/mount.h>/#define _Atomic volatile\n#include <sys\/mount.h>\n#undef _Atomic/g' $file
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
pushd build &>/dev/null
|
pushd build &>/dev/null
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user