diff options
author | Joey Dumont | 2021-06-22 05:48:57 -0400 |
---|---|---|
committer | GitHub | 2021-06-22 05:48:57 -0400 |
commit | 3cab395e4d2a52fb08b899576ed0177afcc02216 (patch) | |
tree | 6190f46988fa95ebb49079d2e9cd8fe8c5ab0803 | |
parent | d462f4b945e3feae0e8c485e433626392a89bff1 (diff) | |
download | aur-3cab395e4d2a52fb08b899576ed0177afcc02216.tar.gz |
Update mips64-ultra-elf toolchain to the latest GCC (11.1.0) (#2)
Update mips64-ultra-elf to the latest GCC version of 11.10, and apply workaround for Werror=format-security.
upgpkg: mips64-ultra-elf-binutils 2.36.1_r144.128cbf0-1
upgpkg: mips64-ultra-elf-gcc-stage1 11.1.0_r144.128cbf0-1
upgpkg: mips64-ultra-elf-gcc 11.1.0_r144.128cbf0-1
upgpkg: mips64-ultra-elf-gdb 10.2_r144.128cbf0-1
upgpkg: mips64-ultra-elf-newlib 4.1.0_r144.128cbf0-1
-rw-r--r-- | .SRCINFO | 13 | ||||
-rw-r--r-- | PKGBUILD | 23 | ||||
-rw-r--r-- | gcc11-Wno-format-security.patch | 152 |
3 files changed, 174 insertions, 14 deletions
@@ -1,6 +1,6 @@ pkgbase = mips64-ultra-elf-gcc-stage1 pkgdesc = The GNU Compiler Collection. Stage 1 for toolchain building (mips64-ultra-elf) - pkgver = 10.3.0_r141.479e768 + pkgver = 11.1.0_r144.128cbf0 pkgrel = 1 url = http://www.gnu.org/software/gcc/ arch = x86_64 @@ -15,12 +15,13 @@ pkgbase = mips64-ultra-elf-gcc-stage1 depends = zstd optdepends = mips64-ultra-elf-newlib: Standard C library optimized for embedded systems options = !emptydirs - source = http://gcc.gnu.org/pub/gcc/releases/gcc-10.3.0/gcc-10.3.0.tar.xz - source = http://isl.gforge.inria.fr/isl-0.22.tar.xz + source = http://gcc.gnu.org/pub/gcc/releases/gcc-11.1.0/gcc-11.1.0.tar.xz + source = http://isl.gforge.inria.fr/isl-0.24.tar.xz source = git+https://github.com/glankk/n64.git#branch=n64-ultra - sha256sums = 64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344 - sha256sums = 6c8bc56c477affecba9c59e2c9f026967ac8bad01b51bdd07916db40a517b9fa + source = gcc11-Wno-format-security.patch + sha256sums = 4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf + sha256sums = 043105cc544f416b48736fff8caf077fb0663a717d06b1113f16e391ac99ebad sha256sums = SKIP + sha256sums = 6f9a34812a07e49a568467df11d6ab19b9fd7d953e9ecd739c7a38d9df821b52 pkgname = mips64-ultra-elf-gcc-stage1 - @@ -1,9 +1,9 @@ # Maintainer: Joey Dumont <joey.dumont@gmail.com> _target=mips64-ultra-elf pkgname=${_target}-gcc-stage1 -_gccver=10.3.0 -_islver=0.22 -pkgver=10.3.0_r141.479e768 +_gccver=11.1.0 +_islver=0.24 +pkgver=11.1.0_r144.128cbf0 pkgrel=1 pkgdesc="The GNU Compiler Collection. Stage 1 for toolchain building (${_target})" arch=('x86_64') @@ -14,11 +14,13 @@ makedepends=(gmp mpfr git "${_target}-binutils") optdepends=("${_target}-newlib: Standard C library optimized for embedded systems") options=(!emptydirs) source=("http://gcc.gnu.org/pub/gcc/releases/gcc-${_gccver}/gcc-${_gccver}.tar.xz" - "http://isl.gforge.inria.fr/isl-${_islver}.tar.xz" - "git+https://github.com/glankk/n64.git#branch=n64-ultra") -sha256sums=('64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344' - '6c8bc56c477affecba9c59e2c9f026967ac8bad01b51bdd07916db40a517b9fa' - 'SKIP') + "http://isl.gforge.inria.fr/isl-${_islver}.tar.xz" + "git+https://github.com/glankk/n64.git#branch=n64-ultra" + "gcc11-Wno-format-security.patch") +sha256sums=('4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf' + '043105cc544f416b48736fff8caf077fb0663a717d06b1113f16e391ac99ebad' + 'SKIP' + '6f9a34812a07e49a568467df11d6ab19b9fd7d953e9ecd739c7a38d9df821b52') pkgver() { cd "${srcdir}/n64/" @@ -36,6 +38,9 @@ prepare() { # hack! - some configure tests for header files using "$CPP $CPPFLAGS" sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure + # -- Patch Werror=format-security issues. + patch --strip=1 --input="$srcdir"/gcc11-Wno-format-security.patch + mkdir "${srcdir}"/build-gcc # -- Copy the files from the source. @@ -44,6 +49,7 @@ prepare() { cd "${srcdir}/n64" cp config/gcc/mips/* "${CP_DIR}/gcc/config/mips/" cat config/gcc/config.gcc.ultra >> "${CP_DIR}/gcc/config.gcc" + } build() { @@ -71,6 +77,7 @@ build() { --without-headers \ --without-included-gettext \ --enable-checking=release \ + --disable-build-format-warnings \ --disable-decimal-float \ --disable-gold \ --disable-libatomic \ diff --git a/gcc11-Wno-format-security.patch b/gcc11-Wno-format-security.patch new file mode 100644 index 000000000000..3504b970f726 --- /dev/null +++ b/gcc11-Wno-format-security.patch @@ -0,0 +1,152 @@ +From 107db5008b826d46f4eeb569b7199f0874839112 Mon Sep 17 00:00:00 2001 +From: Joey Dumont <joey.dumont@gmail.com> +Date: Thu, 17 Jun 2021 22:17:13 -0400 +Subject: [PATCH] Workaround for Werror=format-security errors in the libcpp + and gcc components. + +Both libcpp and the gcc subfolders have fail to compile when the Werror=format-security +flag is present. This patch attempts to to selectively disable this flag by adding +Wno-error=format-security in some build system variables. + +In the gcc component, we simply augment the existing --disable-build-format-warnings +option to set -Wno-error=format-security. We also must add this flag to the strict_warn +set of CFLAGS, so that the gcc/c component can pick it up. + +In the libcpp component, we add the --disable-build-format-warnings option +to the configure script, and give it the same options as gcc's option. +--- + gcc/configure | 4 ++-- + gcc/configure.ac | 6 +++--- + libcpp/configure | 20 +++++++++++++++++--- + libcpp/configure.ac | 8 +++++++- + 4 files changed, 29 insertions(+), 9 deletions(-) + +diff --git a/gcc/configure b/gcc/configure +index 7184dd6c0..90d3a97e3 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -6833,7 +6833,7 @@ else + fi + + if test $enable_build_format_warnings = no; then : +- wf_opt=-Wno-format ++ wf_opt="-Wno-format -Wno-format-security" + else + wf_opt= + fi +@@ -6960,7 +6960,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + strict_warn= + save_CXXFLAGS="$CXXFLAGS" +-for real_option in -Wmissing-format-attribute -Woverloaded-virtual; do ++for real_option in -Wmissing-format-attribute -Woverloaded-virtual $wf_opt; do + # Do the check with the no- prefix removed since gcc silently + # accepts any -Wno-* option on purpose + case $real_option in +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 96a6f62b0..379acef47 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -523,17 +523,17 @@ AC_ARG_ENABLE(build-format-warnings, + AS_HELP_STRING([--disable-build-format-warnings],[don't use -Wformat while building GCC]), + [],[enable_build_format_warnings=yes]) + AS_IF([test $enable_build_format_warnings = no], +- [wf_opt=-Wno-format],[wf_opt=]) ++ [wf_opt=-Wno-format -Wno-format-security],[wf_opt=]) + ACX_PROG_CXX_WARNING_OPTS( + m4_quote(m4_do([-W -Wall -Wno-narrowing -Wwrite-strings ], + [-Wcast-qual -Wno-error=format-diag $wf_opt])), + [loose_warn]) + ACX_PROG_CC_WARNING_OPTS( + m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes ], +- [-Wno-error=format-diag])), [c_loose_warn]) ++ [-Wno-error=format-diag ])), [c_loose_warn]) + ACX_PROG_CXX_WARNING_OPTS( + m4_quote(m4_do([-Wmissing-format-attribute ], +- [-Woverloaded-virtual])), [strict_warn]) ++ [-Woverloaded-virtual $wf_opt])), [strict_warn]) + ACX_PROG_CC_WARNING_OPTS( + m4_quote(m4_do([-Wold-style-definition -Wc++-compat])), [c_strict_warn]) + ACX_PROG_CXX_WARNING_ALMOST_PEDANTIC( +diff --git a/libcpp/configure b/libcpp/configure +index 7e28606f6..f91a07b34 100755 +--- a/libcpp/configure ++++ b/libcpp/configure +@@ -728,6 +728,7 @@ ac_subst_files='' + ac_user_opts=' + enable_option_checking + enable_largefile ++enable_build_format_warnings + enable_werror_always + with_gnu_ld + enable_rpath +@@ -1367,6 +1368,8 @@ Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-largefile omit support for large files ++ --disable-build-format-warnings ++ don't use -Wformat while building GCC + --enable-werror-always enable -Werror despite compiler version + --disable-rpath do not hardcode runtime library paths + --enable-maintainer-mode enable rules only needed by maintainers +@@ -4898,6 +4901,18 @@ test -n "$AUTOHEADER" || AUTOHEADER="$MISSING autoheader" + + # Figure out what compiler warnings we can enable. + # See config/warnings.m4 for details. ++# Check whether --enable-build-format-warnings was given. ++if test "${enable_build_format_warnings+set}" = set; then : ++ enableval=$enable_build_format_warnings; ++else ++ enable_build_format_warnings=yes ++fi ++ ++if test $enable_build_format_warnings = no; then : ++ wf_opt="-Wno-format -Wno-format-security" ++else ++ wf_opt= ++fi + + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' +@@ -4907,8 +4922,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + warn= + save_CFLAGS="$CFLAGS" +-for real_option in -W -Wall -Wno-narrowing -Wwrite-strings \ +- -Wmissing-format-attribute; do ++for real_option in -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute $wf_opt; do + # Do the check with the no- prefix removed since gcc silently + # accepts any -Wno-* option on purpose + case $real_option in +@@ -4983,7 +4997,7 @@ else + CFLAGS="$option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +- ++ + int + main () + { +diff --git a/libcpp/configure.ac b/libcpp/configure.ac +index 1efa96f7c..fe1e90a61 100644 +--- a/libcpp/configure.ac ++++ b/libcpp/configure.ac +@@ -25,8 +25,14 @@ AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader]) + # Figure out what compiler warnings we can enable. + # See config/warnings.m4 for details. + ++AC_ARG_ENABLE(build-format-warnings, ++ AS_HELP_STRING([--disable-build-format-warnings],[don't use -Wformat while building GCC]), ++ [],[enable_build_format_warnings=yes]) ++AS_IF([test $enable_build_format_warnings = no], ++ [wf_opt="-Wno-format -Wno-format-security"],[wf_opt=]) ++ + ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wno-narrowing -Wwrite-strings \ +- -Wmissing-format-attribute], [warn]) ++ -Wmissing-format-attribute $wf_opt] , [warn]) + ACX_PROG_CC_WARNING_OPTS([-Wstrict-prototypes -Wmissing-prototypes \ + -Wold-style-definition -Wc++-compat], [c_warn]) + ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long]) +-- +2.32.0 + |