From 3754b9a198a5ef124e33b6bad9eb0f4ca204e794 Mon Sep 17 00:00:00 2001 From: rofl0r Date: Fri, 19 Jul 2024 14:07:24 +0000 Subject: [PATCH] gcc 5-7: fix build error for x86 targets building any of i?86, x86_64, and x32 targets on a *musl* host with a recent gcc host version (in my testing gcc 11), causes the following build error: ../../src_gcc/gcc/config/i386/i386.c:8750:18: error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive] 8750 | bool error_p = NULL; | ^~~~ the issue affects the 3 supported gcc versions 5.3.0, 6.5.0 and 7.5.0. --- patches/gcc-5.3.0/0022-i386-bool-null.diff | 11 +++++++++++ patches/gcc-6.5.0/0027-i386-bool-null.diff | 11 +++++++++++ patches/gcc-7.5.0/0024-i386-bool-null.diff | 11 +++++++++++ 3 files changed, 33 insertions(+) create mode 100644 patches/gcc-5.3.0/0022-i386-bool-null.diff create mode 100644 patches/gcc-6.5.0/0027-i386-bool-null.diff create mode 100644 patches/gcc-7.5.0/0024-i386-bool-null.diff diff --git a/patches/gcc-5.3.0/0022-i386-bool-null.diff b/patches/gcc-5.3.0/0022-i386-bool-null.diff new file mode 100644 index 0000000..68fcdde --- /dev/null +++ b/patches/gcc-5.3.0/0022-i386-bool-null.diff @@ -0,0 +1,11 @@ +--- gcc-6.5.0.orig/gcc/config/i386/i386.c ++++ gcc-6.5.0/gcc/config/i386/i386.c +@@ -8747,7 +8747,7 @@ + HOST_WIDE_INT words) + { + int res = 0; +- bool error_p = NULL; ++ bool error_p = 0; + + if (TARGET_IAMCU) + { diff --git a/patches/gcc-6.5.0/0027-i386-bool-null.diff b/patches/gcc-6.5.0/0027-i386-bool-null.diff new file mode 100644 index 0000000..68fcdde --- /dev/null +++ b/patches/gcc-6.5.0/0027-i386-bool-null.diff @@ -0,0 +1,11 @@ +--- gcc-6.5.0.orig/gcc/config/i386/i386.c ++++ gcc-6.5.0/gcc/config/i386/i386.c +@@ -8747,7 +8747,7 @@ + HOST_WIDE_INT words) + { + int res = 0; +- bool error_p = NULL; ++ bool error_p = 0; + + if (TARGET_IAMCU) + { diff --git a/patches/gcc-7.5.0/0024-i386-bool-null.diff b/patches/gcc-7.5.0/0024-i386-bool-null.diff new file mode 100644 index 0000000..68fcdde --- /dev/null +++ b/patches/gcc-7.5.0/0024-i386-bool-null.diff @@ -0,0 +1,11 @@ +--- gcc-6.5.0.orig/gcc/config/i386/i386.c ++++ gcc-6.5.0/gcc/config/i386/i386.c +@@ -8747,7 +8747,7 @@ + HOST_WIDE_INT words) + { + int res = 0; +- bool error_p = NULL; ++ bool error_p = 0; + + if (TARGET_IAMCU) + {