From 742c8e9610950504831c5b43eb0381f1714b0c0a Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sat, 28 Jan 2017 20:24:46 +1100 Subject: [PATCH] patch darwin-driver.c to compile gcc 6.3.0 see https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/config/darwin-driver.c?r1=244010&r2=244009&pathrev=244010 --- build_gcc.sh | 5 +++++ patches/darwin-driver.c.patch | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 patches/darwin-driver.c.patch diff --git a/build_gcc.sh b/build_gcc.sh index 3af5352..1eb07b8 100755 --- a/build_gcc.sh +++ b/build_gcc.sh @@ -65,6 +65,11 @@ if [ $(osxcross-cmp $GCC_VERSION '>' 5.0.0) == 1 ] && patch -p1 < $PATCH_DIR/gcc-pr66035.patch fi +if [ $(osxcross-cmp $GCC_VERSION '==' 6.3.0) == 1 ]; then + # 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 +fi + mkdir -p build pushd build &>/dev/null diff --git a/patches/darwin-driver.c.patch b/patches/darwin-driver.c.patch new file mode 100644 index 0000000..c4f1ea3 --- /dev/null +++ b/patches/darwin-driver.c.patch @@ -0,0 +1,15 @@ +--- trunk/gcc/config/darwin-driver.c 2017/01/03 00:16:13 244009 ++++ trunk/gcc/config/darwin-driver.c 2017/01/03 05:36:40 244010 +@@ -299,10 +299,10 @@ + if (vers_string != NULL) + { + char *asm_major = NULL; +- char *first_period = strchr(vers_string, '.'); ++ const char *first_period = strchr(vers_string, '.'); + if (first_period != NULL) + { +- char *second_period = strchr(first_period+1, '.'); ++ const char *second_period = strchr(first_period+1, '.'); + if (second_period != NULL) + asm_major = xstrndup (vers_string, second_period-vers_string); + else