diff options
author | Daniel Bermond | 2021-10-31 14:18:22 -0300 |
---|---|---|
committer | Daniel Bermond | 2021-10-31 14:18:22 -0300 |
commit | bdfd6aa36693b56c91c56ce6e7446aea873ede55 (patch) | |
tree | e821b5c33c830d19539f893cbdf38a6569416ea3 | |
download | aur-bdfd6aa36693b56c91c56ce6e7446aea873ede55.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 35 | ||||
-rw-r--r-- | 010-gcc-fix-build.patch | 383 | ||||
-rw-r--r-- | 020-gcc11-Wno-format-security.patch | 27 | ||||
-rw-r--r-- | PKGBUILD | 163 |
4 files changed, 608 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..cdff5f5d7a7d --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,35 @@ +pkgbase = mips64el-linux-gnu-gcc-bootstrap + pkgdesc = The GNU Compiler Collection - bootstrap/stage1 cross compiler for the MIPS64EL target (for the toolchain with GNU C library and multilib ABI) + pkgver = 11.2.0 + pkgrel = 1 + url = https://gcc.gnu.org/ + arch = x86_64 + license = GPL + license = LGPL + license = FDL + license = custom + makedepends = mips64el-linux-gnu-linux-api-headers + depends = gmp + depends = libmpc + depends = mips64el-linux-gnu-binutils + depends = mpfr + depends = sh + depends = zlib + depends = zstd + options = !emptydirs + source = https://sourceware.org/pub/gcc/releases/gcc-11.2.0/gcc-11.2.0.tar.xz + source = https://sourceware.org/pub/gcc/releases/gcc-11.2.0/gcc-11.2.0.tar.xz.sig + source = https://sourceforge.net/projects/libisl/files/isl-0.24.tar.xz + source = 010-gcc-fix-build.patch + source = 020-gcc11-Wno-format-security.patch + validpgpkeys = 13975A70E63C361C73AE69EF6EEB81F8981C74C7 + validpgpkeys = 33C235A34C46AA3FFB293709A328C3A2C3C45C06 + sha256sums = d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b + sha256sums = SKIP + sha256sums = 043105cc544f416b48736fff8caf077fb0663a717d06b1113f16e391ac99ebad + sha256sums = 6b3a5608bcb7bba042b25aab518c7f8dc50180174d53d5f4bbe381c9b0132e27 + sha256sums = 504e4b5a08eb25b6c35f19fdbe0c743ae4e9015d0af4759e74150006c283585e + +pkgname = mips64el-linux-gnu-gcc-bootstrap + provides = mips64el-linux-gnuabi-gcc-bootstrap + conflicts = mips64el-linux-gnuabi-gcc-bootstrap diff --git a/010-gcc-fix-build.patch b/010-gcc-fix-build.patch new file mode 100644 index 000000000000..a2a07179df85 --- /dev/null +++ b/010-gcc-fix-build.patch @@ -0,0 +1,383 @@ +--- a/gcc/configure ++++ b/gcc/configure +@@ -3318,7 +3318,7 @@ fi + ## -------------------- ## + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -3949,7 +3949,7 @@ rm -f a.out a.exe b.out + + # Find the native compiler + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -4732,13 +4732,13 @@ if test "x$ac_cv_prog_cc_c89" != xno; th + fi + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -4989,7 +4989,7 @@ else + fi + fi + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -5216,7 +5216,7 @@ fi + + # Do configure tests with the C++ compiler, since that's what we build with. + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -5322,7 +5322,7 @@ esac + + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -5449,7 +5449,7 @@ See \`config.log' for more details" "$LI + fi + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -5777,7 +5777,7 @@ $as_echo "$ac_cv_safe_to_define___extens + + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -5908,7 +5908,7 @@ See \`config.log' for more details" "$LI + fi + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -6838,7 +6838,7 @@ else + wf_opt= + fi + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -6888,7 +6888,7 @@ fi + done + CXXFLAGS="$save_CXXFLAGS" + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -6896,7 +6896,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -6946,14 +6946,14 @@ fi + done + CFLAGS="$save_CFLAGS" + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -7003,14 +7003,14 @@ fi + done + CXXFLAGS="$save_CXXFLAGS" + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -7060,14 +7060,14 @@ fi + done + CFLAGS="$save_CFLAGS" + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -7109,14 +7109,14 @@ fi + + fi + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -7133,7 +7133,7 @@ if test $enable_werror_always = yes; the + fi + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -7154,7 +7154,7 @@ fi + + # Disable exceptions and RTTI if building with g++ + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -7204,7 +7204,7 @@ fi + done + CFLAGS="$save_CFLAGS" + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -9400,7 +9400,7 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUI + # ---------------------- + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -9529,7 +9529,7 @@ See \`config.log' for more details" >&2; + fi + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -15226,7 +15226,7 @@ if ${lt_cv_cc_needs_belf+:} false; then + $as_echo_n "(cached) " >&6 + else + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -15250,7 +15250,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -16313,7 +16313,7 @@ esac + + lt_save_CC="$CC" + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -19708,7 +19708,7 @@ $as_echo "$enable_static" >&6; } + + fi + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -19719,7 +19719,7 @@ CC="$lt_save_CC" + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -19846,7 +19846,7 @@ See \`config.log' for more details" "$LI + fi + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -19856,7 +19856,7 @@ else + fi + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +@@ -22721,7 +22721,7 @@ fi + fi # test "$_lt_caught_CXX_error" != yes + + ac_ext=cpp +-ac_cpp='$CXXCPP $CPPFLAGS' ++ac_cpp='$CXXCPP $CPPFLAGS -O2' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +--- a/libiberty/configure ++++ b/libiberty/configure +@@ -2450,7 +2450,7 @@ fi + ## -------------------- ## + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -2981,7 +2981,7 @@ $as_echo "$as_me: target_header_dir = $t + + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -3793,14 +3793,14 @@ if test "x$ac_cv_prog_cc_c89" != xno; th + fi + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -3931,7 +3931,7 @@ See \`config.log' for more details" "$LI + fi + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -4462,7 +4462,7 @@ fi + ac_c_preproc_warn_flag=yes + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -4514,14 +4514,14 @@ fi + done + CFLAGS="$save_CFLAGS" + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu +@@ -4563,7 +4563,7 @@ fi + + fi + ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' ++ac_cpp='$CPP $CPPFLAGS -O2' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' + ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' + ac_compiler_gnu=$ac_cv_c_compiler_gnu diff --git a/020-gcc11-Wno-format-security.patch b/020-gcc11-Wno-format-security.patch new file mode 100644 index 000000000000..974ea44d0f85 --- /dev/null +++ b/020-gcc11-Wno-format-security.patch @@ -0,0 +1,27 @@ +2017-02-25 Jakub Jelinek <jakub@redhat.com> + + * configure.ac: When adding -Wno-format, also add -Wno-format-security. + * configure: Regenerated. + +--- gcc/configure.ac.jj 2017-02-13 12:20:53.000000000 +0100 ++++ gcc/configure.ac 2017-02-25 12:42:32.859175403 +0100 +@@ -480,7 +480,7 @@ 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])), +--- gcc/configure.jj 2017-02-13 12:20:52.000000000 +0100 ++++ gcc/configure 2017-02-25 12:42:50.041946391 +0100 +@@ -6647,7 +6647,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 diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..d393db450e52 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,163 @@ +# Maintainer: Daniel Bermond <dbermond@archlinux.org> + +# NOTE: +# this package is the bootstrap (stage1) cross compiler, used +# to build the first cross C library on the system only during +# the first creation of the toolchain. It cannot build regular +# software, since a cross C library will not be present yet. +# When the final cross compiler is installed, this package +# is not needed to be built anymore for building new versions +# of the cross C library and the cross compiler. + +_target=mips64el-linux-gnu +pkgname="${_target}-gcc-bootstrap" +pkgver=11.2.0 +_islver=0.24 +_majorver="${pkgver%%.*}" +pkgrel=1 +pkgdesc='The GNU Compiler Collection - bootstrap/stage1 cross compiler for the MIPS64EL target (for the toolchain with GNU C library and multilib ABI)' +arch=('x86_64') +url='https://gcc.gnu.org/' +license=('GPL' 'LGPL' 'FDL' 'custom') +depends=('gmp' 'libmpc' "${_target}-binutils" 'mpfr' 'sh' 'zlib' 'zstd') +makedepends=("${_target}-linux-api-headers") +options=('!emptydirs') +source=("https://sourceware.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.xz"{,.sig} + #"http://isl.gforge.inria.fr/isl-${_islver}.tar.xz" + "https://sourceforge.net/projects/libisl/files/isl-${_islver}.tar.xz" + '010-gcc-fix-build.patch' + '020-gcc11-Wno-format-security.patch') +sha256sums=('d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b' + 'SKIP' + '043105cc544f416b48736fff8caf077fb0663a717d06b1113f16e391ac99ebad' + '6b3a5608bcb7bba042b25aab518c7f8dc50180174d53d5f4bbe381c9b0132e27' + '504e4b5a08eb25b6c35f19fdbe0c743ae4e9015d0af4759e74150006c283585e') +validpgpkeys=('13975A70E63C361C73AE69EF6EEB81F8981C74C7' # Richard Guenther <richard.guenther@gmail.com> + '33C235A34C46AA3FFB293709A328C3A2C3C45C06') # Jakub Jelinek <jakub@redhat.com> + +_ABIS=('64' 'n32' '32') +_DEFAULT_ABI='64' # gcc defaults to 'n32' ABI for MIPS64 + +prepare() { + mkdir -p build + + # link isl for in-tree build + ln -s "../isl-${_islver}" "gcc-${pkgver}/isl" + + patch -d "gcc-${pkgver}" -Np1 -i "${srcdir}/010-gcc-fix-build.patch" + patch -d "gcc-${pkgver}" -Np0 -i "${srcdir}/020-gcc11-Wno-format-security.patch" +} + +build() { + cd build + + # using -pipe causes spurious test-suite failures + # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565 + export CFLAGS="${CFLAGS/-pipe/}" + export CXXFLAGS="${CXXFLAGS/-pipe/}" + + # position independent code (PIE) is troublesome in MIPS, as + # it can cause this error when building software with gcc: + # cc1: error: position-independent code requires ‘-mabicalls’ + # (this error is not always solved when using '-mabicalls') + # https://github.com/crosstool-ng/crosstool-ng/issues/948 + # https://gcc.gnu.org/legacy-ml/gcc-patches/2012-08/msg00237.html + + "${srcdir}/gcc-${pkgver}/configure" \ + --build="$CHOST" \ + --host="$CHOST" \ + --target="$_target" \ + --prefix='/usr' \ + --libdir='/usr/lib' \ + --libexecdir='/usr/lib' \ + --mandir='/usr/share/man' \ + --with-sysroot="/usr/${_target}" \ + --with-build-sysroot="/usr/${_target}" \ + --with-native-system-header-dir='/include' \ + --with-abi="$_DEFAULT_ABI" \ + --with-newlib \ + --with-gnu-as \ + --with-gnu-ld \ + --enable-languages='c,c++' \ + --with-isl \ + --with-linker-hash-style='gnu' \ + --with-system-zlib \ + --enable-__cxa_atexit \ + --enable-cet='auto' \ + --enable-checking='release' \ + --enable-clocale='newlib' \ + --disable-default-pie \ + --enable-default-ssp \ + --enable-gnu-indirect-function \ + --enable-gnu-unique-object \ + --enable-install-libiberty \ + --enable-linker-build-id \ + --enable-lto \ + --enable-multilib \ + --enable-plugin \ + --disable-shared \ + --disable-threads \ + --disable-libssp \ + --disable-libstdcxx-pch \ + --disable-libunwind-exceptions \ + --disable-werror + make all-gcc all-target-libgcc +} + +check() { + # disable libphobos test to avoid segfaults and other possible problems + sed -i '/maybe-check-target-libphobos \\/d' build/Makefile + + # do not abort on error as some are "expected" + make -C build -k check || true + "gcc-${pkgver}/contrib/test_summary" +} + +package() { + make -C build DESTDIR="$pkgdir" install-gcc install-target-libgcc + + # allow using gnuabi${_abi} executables + local _abi + local _bin + for _abi in "${_ABIS[@]}" + do + provides+=("${pkgname/gnu/"gnuabi${_abi}"}") + conflicts+=("${pkgname/gnu/"gnuabi${_abi}"}") + + for _bin in c++ cpp g++ gcc "gcc-${pkgver}" + do + if [ "$_abi" = "$_DEFAULT_ABI" ] + then + ln -s "${_target}-${_bin}" "${pkgdir}/usr/bin/${_target/gnu/"gnuabi${_abi}"}-${_bin}" + else + cat <<- __EOF__ | install -D -m755 /dev/stdin "${pkgdir}/usr/bin/${_target/gnu/"gnuabi${_abi}"}-${_bin}" + #!/bin/sh + + exec ${_target}-${_bin} -mabi='${_abi}' "\$@" +__EOF__ + fi + + case "$_bin" in + cpp|g++|gcc) + ln -s "${_target}-${_bin}.1.gz" "${pkgdir}/usr/share/man/man1/${_target/gnu/"gnuabi${_abi}"}-${_bin}.1.gz" + ;; + esac + done + done + + install -D -m644 "gcc-${pkgver}/COPYING.RUNTIME" \ + "${pkgdir}/usr/share/licenses/${pkgname}/RUNTIME.LIBRARY.EXCEPTION" + + # remove conflicting files + rm -r "${pkgdir}/usr/share"/{info,locale,man/man7} + + # strip target binaries + find "${pkgdir}/usr/lib/gcc/${_target}" \ + -type f -and \( -name \*.a -or -name \*.o \) \ + -exec "${_target}-objcopy" -R .comment -R .note -R .debug_info -R .debug_aranges \ + -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line \ + -R .debug_str -R .debug_ranges -R .debug_loc '{}' \; + + # strip host binaries + find "${pkgdir}/usr/bin" "${pkgdir}/usr/lib/gcc/${_target}" -type f -and \( -executable \) -exec strip '{}' \; +} |