From d23fd662f2a1a24d58ed109c69438d327b3b6af8 Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Tue, 24 May 2022 22:27:01 +0200 Subject: [PATCH] main/gcc6: fix build (MR 3153) Fix the build failure when built with newer gcc: /home/pmos/build/src/gcc-6.4.0/gcc/config/i386/i386.c: In function 'int function_arg_advance_32(CUMULATIVE_ARGS*, machine_mode, const_tree, long int, long int)': /home/pmos/build/src/gcc-6.4.0/gcc/config/i386/i386.c:8743:18: error: converting to 'bool' from 'std::nullptr_t' requires direct-initialization [-fpermissive] 8743 | bool error_p = NULL; | ^~~~ Patch source: https://svnweb.freebsd.org/ports/head/lang/gcc7/files/patch-gcc_config_i386_i386.c?view=markup&pathrev=545751 --- main/gcc6/0015-fix-error_p-null-error.patch | 30 +++++++++++++++++++++ main/gcc6/APKBUILD | 10 ++++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 main/gcc6/0015-fix-error_p-null-error.patch diff --git a/main/gcc6/0015-fix-error_p-null-error.patch b/main/gcc6/0015-fix-error_p-null-error.patch new file mode 100644 index 000000000..ac609b9e2 --- /dev/null +++ b/main/gcc6/0015-fix-error_p-null-error.patch @@ -0,0 +1,30 @@ +This fixes + +/wrkdirs/usr/ports/lang/gcc7/work/gcc-7.5.0/gcc/config/i386/i386.c:9631:8: error: cannot initialize a variable of type 'bool' with an rvalue of type 'nullptr_t' + bool error_p = NULL; + ^ ~~~~ + +and comes from upstream as part of + + commit 9f36390d429502f0a0dee20bda5b4870da948f6a + Author: Uros Bizjak + Date: Sat May 6 09:01:51 2017 +0200 + + i386.c (ext_80387_constant_init): Do not explicitly initialize to zero. + + * config/i386/i386.c (ext_80387_constant_init): Do not explicitly + initialize to zero. + (init_regs): Remove declaration. + (function_arg_advance_32): Initialize error_p as boolean variable. + +--- a/gcc/config/i386/i386.c 2019-11-01 20:30:26 UTC ++++ b/gcc/config/i386/i386.c 2019-11-01 20:30:26 UTC +@@ -9628,7 +9628,7 @@ function_arg_advance_32 (CUMULATIVE_ARGS *cum, machine + HOST_WIDE_INT words) + { + int res = 0; +- bool error_p = NULL; ++ bool error_p = false; + + if (TARGET_IAMCU) + { diff --git a/main/gcc6/APKBUILD b/main/gcc6/APKBUILD index 281964697..c0b4f3e56 100644 --- a/main/gcc6/APKBUILD +++ b/main/gcc6/APKBUILD @@ -1,7 +1,7 @@ pkgname=gcc6 pkgver=9999 _pkgver=6.4.0 -pkgrel=8 +pkgrel=9 pkgdesc="Old GCC for old vendor kernels (C compiler only)" url="http://gcc.gnu.org" arch="all" @@ -200,6 +200,7 @@ source="http://gcc.gnu.org/pub/gcc/releases/gcc-${_pkgbase:-$_pkgver}/gcc-${_pkg 0013-i386-Don-t-generate-alias-for-function-return-thunk.patch 0014-fix-missing-includes-isl-0.20.patch + 0015-fix-error_p-null-error.patch " # we build out-of-tree @@ -420,7 +421,8 @@ package() { done } -sha512sums="02c60e54527c7adf584798d5251f8a0b80c93d5deafce82501b2c28e6692e0bd783927bbfc4bc527a863c0cccc025150a34740a9e29badb02d4b48e56a8aba90 gcc-6.4.0.tar.xz +sha512sums=" +02c60e54527c7adf584798d5251f8a0b80c93d5deafce82501b2c28e6692e0bd783927bbfc4bc527a863c0cccc025150a34740a9e29badb02d4b48e56a8aba90 gcc-6.4.0.tar.xz 28f8c6fdbcb19e950b1d0bafb3bcc7a8cba87bc673aa6027cece116599cdee80f0cf5e95a1440544890239f5c754e8a93ab46d9daedd937faef445d7ea33b226 ecj-4.9.jar a1335adc2fbee98e36c4437ff2587771b98ed4180726779020f65039498235626a411cdb0100dbd20cd19d12f0d94f9a21af179ff624676c28cead9d60598b5d 001_all_default-ssp-strong.patch e36e95b81489163abd6fe9d58f7867bdca43e61143afacbfb17f4698c0b16ec5fd0061d8fab7b2ae615540bebd721c2e2227f80401b4e7fc253da9da62e6b513 002_all_default-relro.patch @@ -473,4 +475,6 @@ b7b59f3203bf53168de2170b91738cd456f6ae205b3fe5bf8aacbaa8cc5624dd09c941ad8f1071d1 c53d4c5968865abb709ee8a9af9d57917d43ea3ba31ee8312f9e8f338e9b1b44babf5aa3414848da7267e5cf13a9261815eb9185dc153cbd41ee7ce5ea23d2d0 0011-i386-Update-mfunction-return-for-return-with-pop.patch 955080ba3e42cfe2f604e5dcef46aa6fca7c899c7808398947af655ff3b7954e30807ef85246986a5cc7db36dbc870db151e9fa8d8bc967b89ea56efdf64614c 0012-i386-Add-TARGET_INDIRECT_BRANCH_REGISTER.patch 3aae3a9cef8e8afe5a5433db8d9f410e1a2882481af01bb1d33232f987dbb74d7780c32be70b868bb391b3601b65ed3a16d777afea946f5eeaff72aa1e7fa3a9 0013-i386-Don-t-generate-alias-for-function-return-thunk.patch -e926a9c43eb774f788bbba168f4363fe37ccf2d57531540a6bccb3e16a487aa42e85dfdfc4fb0a3370eb890d100cd1e93279efb2fc9af73b09e3225511afa132 0014-fix-missing-includes-isl-0.20.patch" +e926a9c43eb774f788bbba168f4363fe37ccf2d57531540a6bccb3e16a487aa42e85dfdfc4fb0a3370eb890d100cd1e93279efb2fc9af73b09e3225511afa132 0014-fix-missing-includes-isl-0.20.patch +a3ab3b63583587cf9e3e9c3f30089c440bc58c3d87199d50e7c3dda2bf308685eae162ed122d481e472814498008e41c192581ca393629adf4487ea0e3f91254 0015-fix-error_p-null-error.patch +"