sys-devel/gcc: update gcc to 9.4.0

Update sys-devel/gcc to 9.4.0, mainly to address CVE-2020-13844.
This commit is contained in:
Dongsu Park 2021-11-24 14:54:30 +01:00 committed by Dongsu Park
parent daab3ae59f
commit 4841bcaebf
22 changed files with 12 additions and 1370 deletions

View File

@ -1,5 +1,2 @@
DIST gcc-8.3.0-patches-1.0.tar.bz2 12278 BLAKE2B 793465c5de0af850c7f3017b3011e68f3bd1664e6ce3500a3dc3003d37c03fe81857698957770a135eadd395a7767fa804d354ecdcdeb1d83623280ca569d4ec SHA512 0efadd2481713992807fed2683666f1094b3757674754601c079569f3ef70cd7aed3cefc9f815f4e59a21d37e4e940c122df714e16f3878a5f966450c4273669
DIST gcc-8.3.0-patches-1.1.tar.bz2 14430 BLAKE2B c702fbdb18c3c952cdb9adead3a193c948d78a4cb4b041beaa51a06b907fd357bb10a2f8d47d55978ebb08590fd7c9a6ec3df8e7a007173e20a55d251d947c72 SHA512 9e2284f597bab6f78ca24ead358b1f50495aefc9e0a416ace24c94723db7b2fb82d48426876138d00c82bcaf9c2f8b4674885988448dcf16dee1b764face9af4
DIST gcc-8.3.0.tar.xz 63694700 BLAKE2B 71df2ff5bd6874d57519c2e9af6b22152c8c4d7fab906a5f427b41bc4e8e742127592a8684120d9d3c9ce6241439531850be08ec0a4f29dbfdee95435655fdca SHA512 1811337ae3add9680cec64968a2509d085b6dc5b6783fc1e8c295e3e47416196fd1a3ad8dfe7e10be2276b4f62c357659ce2902f239f60a8648548231b4b5802
DIST gcc-9.3.0-patches-3.tar.bz2 14193 BLAKE2B 4863fec1af41a8cdb2c24479b28812df36c1f71ab71d267ff0efc467cfb8ce99ed77714ceaedfb08b0d1eb0eb9316758cc7cbc5a8ad0bb582050690935e64b46 SHA512 8b90a5826df64e6f74e4f6c0e5acead695b38f671e26485b110d5b341daaad4ac21aabb04baae9ad457408eed274888b7f785bbc782611acfc7261e6a315d110
DIST gcc-9.3.0.tar.xz 70533868 BLAKE2B 21efb1432aefad5ed9b9b395e88ef2adfda3a8ea6e3e808cd151da6e66df9fed1bafdc8b8ff055d4b2272ac786d8b7ddc4293bb6b51c55c40a261a0eda0e7cb4 SHA512 4b9e3639eef6e623747a22c37a904b4750c93b6da77cf3958d5047e9b5ebddb7eebe091cc16ca0a227c0ecbd2bf3b984b221130f269a97ee4cc18f9cf6c444de
DIST gcc-9.4.0-patches-1.tar.bz2 14012 BLAKE2B d5fbfd73d9c3a5b66be5b124d981fe5a7468363c83784989a50731f87931435f4b6302e4c20a64b20680581ed40005eff7bdd5855526a093f73a04c3c1ddab31 SHA512 b84884c7d2197cb14229d3321b98cd66c783cf9ebf7e5d1b1186e6cf32ee9e47d004ebad26118f9c848f9bc0a3783ceb23d9b65101d98c3bfa99874e66ee7cbc
DIST gcc-9.4.0.tar.xz 72411232 BLAKE2B 4bb000d33d6bd2d6cc91c040713f27f79dcf726ef8ab1542c711e0c25651507628510b1373bc73aef71ffb660afddb2eb8d8c8540f5f1498ee243cfff6c0be67 SHA512 dfd3500bf21784b8351a522d53463cf362ede66b0bc302edf350bb44e94418497a8b4b797b6af8ca9b2eeb746b3b115d9c3698381b989546e9151b4496415624

View File

@ -1,11 +0,0 @@
# Flatcar Container Linux notes for the GCC package
This readme captures notes for upgrading GCC in the SDK toolchain.
Starting notes
- The SDK uses cross compiler environments for all boards, even "native" (x86 on x86).
- For "merely" one-shot compiling OS image packages with a newer gcc version it is sufficient to supply the build recipe and then build it as a cross compiler. For making the update persistent, the SDK needs to be build first (all 4 stages).
- The SDK build uses its own set of build recipes, i.e. **not** `src/third-party/(coreos-overlay|portage-stable). Instead, the recipes included with the bootstrap SDK (used to build the new SDK) are used. These reside in `chroot/var/gentoo/repos/gentoo`.
- This effectively prevents *replacing* gcc in a single step, as the SDK bootstrap process will try to build the old gcc during the first stage(s)
- Instead, the new gcc version's build recipe needs to be added, then the SDK needs to be built, and then the old version's recipe can be removed.

View File

@ -1,22 +0,0 @@
--- configure.in.old 2004-06-26 07:01:06.000000000 +0200
+++ configure.in 2004-06-26 07:02:55.000000000 +0200
@@ -52,8 +52,7 @@
host_tools="texinfo byacc flex bison binutils ld gas gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool grep diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils snavigator libtool gettext zip fastjar"
# libgcj represents the runtime libraries only used by gcj.
-libgcj="target-libffi \
- target-boehm-gc \
+libgcj="target-boehm-gc \
target-zlib \
target-qthreads \
target-libjava"
@@ -66,7 +65,8 @@
target-newlib \
${libstdcxx_version} \
target-libf2c \
- ${libgcj}
+ ${libgcj} \
+ target-libffi \
target-libobjc"
# these tools are built using the target libs, and are intended to run only

View File

@ -1,40 +0,0 @@
diff -ur gcc-3.4.3/libffi/Makefile.in gcc-3.4.3-ffi-fixes/libffi/Makefile.in
--- gcc-3.4.3/libffi/Makefile.in 2003-11-22 08:41:32.000000000 -0500
+++ gcc-3.4.3-ffi-fixes/libffi/Makefile.in 2004-11-28 17:31:50.000000000 -0500
@@ -89,7 +89,7 @@
libffi_basedir = @libffi_basedir@
tool_include_dir = @tool_include_dir@
toolexecdir = @toolexecdir@
-toolexeclibdir = @toolexeclibdir@
+toolexeclibdir = @toolexeclibdir@/@gcc_version@
AUTOMAKE_OPTIONS = cygnus
diff -ur gcc-3.4.3/libffi/configure gcc-3.4.3-ffi-fixes/libffi/configure
--- gcc-3.4.3/libffi/configure 2004-05-18 05:08:39.000000000 -0400
+++ gcc-3.4.3-ffi-fixes/libffi/configure 2004-11-28 17:48:19.000000000 -0500
@@ -3800,8 +3800,8 @@
toolexecdir='$(exec_prefix)/$(target_alias)'
toolexeclibdir='$(toolexecdir)/lib'
else
- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- toolexeclibdir='$(libdir)'
+ toolexecdir='$(libdir)/gcc/$(target_alias)'
+ toolexeclibdir='$(libdir)/gcc/$(target_alias)/$(gcc-version)'
fi
multi_os_directory=`$CC -print-multi-os-directory`
case $multi_os_directory in
diff -ur gcc-3.4.3/libffi/configure.in gcc-3.4.3-ffi-fixes/libffi/configure.in
--- gcc-3.4.3/libffi/configure.in 2004-04-27 01:10:19.000000000 -0400
+++ gcc-3.4.3-ffi-fixes/libffi/configure.in 2004-11-28 17:40:30.000000000 -0500
@@ -225,8 +225,8 @@
toolexecdir='$(exec_prefix)/$(target_alias)'
toolexeclibdir='$(toolexecdir)/lib'
else
- toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
- toolexeclibdir='$(libdir)'
+ toolexecdir='$(libdir)/gcc/$(target_alias)'
+ toolexeclibdir='$(libdir)/gcc/$(target_alias)/$(gcc_version)'
fi
multi_os_directory=`$CC -print-multi-os-directory`
case $multi_os_directory in

View File

@ -1,40 +0,0 @@
--- configure.in.orig 2004-08-03 00:53:36.000000000 +0200
+++ configure.in 2004-08-03 00:52:35.000000000 +0200
@@ -136,8 +136,7 @@
host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
# libgcj represents the runtime libraries only used by gcj.
-libgcj="target-libffi \
- target-boehm-gc \
+libgcj="target-boehm-gc \
target-zlib \
target-qthreads \
target-libjava"
@@ -150,6 +150,7 @@
target-libstdc++-v3 \
target-libf2c \
${libgcj} \
+ target-libffi \
target-libobjc"
# these tools are built using the target libraries, and are intended to
--- configure~ 2004-08-28 02:31:04.000000000 +0200
+++ configure 2004-08-28 10:55:28.000000000 +0200
@@ -876,8 +876,7 @@
host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar"
# libgcj represents the runtime libraries only used by gcj.
-libgcj="target-libffi \
- target-boehm-gc \
+libgcj="target-boehm-gc \
target-zlib \
target-qthreads \
target-libjava"
@@ -891,6 +890,7 @@
target-libstdc++-v3 \
target-libf2c \
${libgcj} \
+ target-libffi \
target-libobjc"
# these tools are built using the target libraries, and are intended to

View File

@ -1,63 +0,0 @@
Some notes on the 'bootstrap with or without libc headers' debate:
http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
--- gcc/config/sh/linux.h
+++ gcc/config/sh/linux.h
@@ -145,6 +145,7 @@
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
+#ifndef inhibit_libc
#ifdef IN_LIBGCC2
#include <signal.h>
#include <sys/ucontext.h>
@@ -295,6 +296,7 @@
#endif /* defined (__SH5__) */
#endif /* IN_LIBGCC2 */
+#endif /* inhibit_libc */
/* For SH3 and SH4, we use a slot of the unwind frame which correspond
to a fake register number 16 as a placeholder for the return address
--- gcc/config/i386/linux.h
+++ gcc/config/i386/linux.h
@@ -208,6 +208,7 @@
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
+#ifndef inhibit_libc
#ifdef IN_LIBGCC2
/* There's no sys/ucontext.h for some (all?) libc1, so no
signal-turned-exceptions for them. There's also no configure-run for
@@ -272,3 +273,4 @@
} while (0)
#endif /* not USE_GNULIBC_1 */
#endif /* IN_LIBGCC2 */
+#endif /* inhibit_libc */
--- gcc/config/alpha/linux.h
+++ gcc/config/alpha/linux.h
@@ -73,6 +73,7 @@
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
+#ifndef inhibit_libc
#ifdef IN_LIBGCC2
#include <signal.h>
#include <sys/ucontext.h>
@@ -122,3 +123,4 @@
(FS)->retaddr_column = 64; \
goto SUCCESS; \
} while (0)
+#endif /* inhibit_libc */
--- gcc/config.gcc
+++ gcc/config.gcc
@@ -321,7 +321,7 @@
need_64bit_hwint=yes
;;
# Note the 'l'; we need to be able to match e.g. "shle" or "shl".
-sh[123456789l]*-*-*)
+sh[123456789lbe]*-*-*)
cpu_type=sh
need_64bit_hwint=yes
;;

View File

@ -1,40 +0,0 @@
Some notes on the 'bootstrap with or without libc headers' debate:
http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
--- gcc/unwind-dw2.c
+++ gcc/unwind-dw2.c
@@ -253,9 +253,11 @@
}
#endif
+#ifndef inhibit_libc
#ifdef MD_UNWIND_SUPPORT
#include MD_UNWIND_SUPPORT
#endif
+#endif
/* Extract any interesting information from the CIE for the translation
unit F belongs to. Return a pointer to the byte after the augmentation,
--- gcc/configure
+++ gcc/configure
@@ -12857,7 +12857,7 @@ then
| powerpc*-*-*,powerpc64*-*-*)
CROSS="$CROSS -DNATIVE_CROSS" ;;
esac
-elif test "x$TARGET_SYSTEM_ROOT" != x; then
+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
SYSTEM_HEADER_DIR=$build_system_header_dir
fi
--- gcc/configure.ac
+++ gcc/configure.ac
@@ -1717,7 +1717,7 @@ then
| powerpc*-*-*,powerpc64*-*-*)
CROSS="$CROSS -DNATIVE_CROSS" ;;
esac
-elif test "x$TARGET_SYSTEM_ROOT" != x; then
+elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
SYSTEM_HEADER_DIR=$build_system_header_dir
fi

View File

@ -1,64 +0,0 @@
workaround for lame stack packing on i386 ...
- build gcc with -Os (crtfastmath.o to be specific)
- crtfastmath.o is installed into gcc libdir
- run gcc with -ffast-math and get crtfastmath.o linked in
- resulting compiled app segfaults due to init code in
crtfastmath.o that has mis-aligned structure on stack
http://bugs.gentoo.org/147020
http://gcc.gnu.org/PR28621
this is supposed to be fixed in current 4.1 branch, but i'm unable to get
the fix to work so until i can figure out what i'm doing wrong, we'll use
this workaround for now.
--- gcc-4.1.1/gcc/config/i386/crtfastmath.c
+++ gcc-4.1.1/gcc/config/i386/crtfastmath.c
@@ -37,6 +37,23 @@
#define FXSAVE (1 << 24)
#define SSE (1 << 25)
+struct
+{
+ unsigned short int cwd;
+ unsigned short int swd;
+ unsigned short int twd;
+ unsigned short int fop;
+ long int fip;
+ long int fcs;
+ long int foo;
+ long int fos;
+ long int mxcsr;
+ long int mxcsr_mask;
+ long int st_space[32];
+ long int xmm_space[32];
+ long int padding[56];
+} __attribute__ ((aligned (16))) fxsave;
+
static void __attribute__((constructor))
set_fast_math (void)
{
@@ -75,22 +92,6 @@
if (edx & FXSAVE)
{
/* Check if DAZ is available. */
- struct
- {
- unsigned short int cwd;
- unsigned short int swd;
- unsigned short int twd;
- unsigned short int fop;
- long int fip;
- long int fcs;
- long int foo;
- long int fos;
- long int mxcsr;
- long int mxcsr_mask;
- long int st_space[32];
- long int xmm_space[32];
- long int padding[56];
- } __attribute__ ((aligned (16))) fxsave;
__builtin_memset (&fxsave, 0, sizeof (fxsave));

View File

@ -1,313 +0,0 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# Helper functions
#
function printn(string) {
printf("%s", string)
}
function einfo(string) {
printf(" \033[32;01m*\033[0m %s\n", string)
}
function einfon(string) {
printf(" \033[32;01m*\033[0m %s", string)
}
function ewarn(string) {
printf(" \033[33;01m*\033[0m %s\n", string)
}
function ewarnn(string) {
printf(" \033[33;01m*\033[0m %s", string)
}
function eerror(string) {
printf(" \033[31;01m*\033[0m %s\n", string)
}
#
# assert(condition, errmsg)
# assert that a condition is true. Otherwise exit.
#
function assert(condition, string) {
if (! condition) {
printf("%s:%d: assertion failed: %s\n",
FILENAME, FNR, string) > "/dev/stderr"
_assert_exit = 1
exit 1
}
}
#
# system(command, return)
# wrapper that normalizes return codes ...
#
function dosystem(command, ret) {
ret = 0
ret = system(command)
if (ret == 0)
return 1
else
return 0
}
BEGIN {
#
# Get our variables from environment
#
OLDVER = ENVIRON["OLDVER"]
OLDCHOST = ENVIRON["OLDCHOST"]
if (OLDVER == "") {
eerror("Could not get OLDVER!");
exit 1
}
# Setup some sane defaults
LIBCOUNT = 2
HAVE_GCC34 = 0
DIRLIST[1] = "/lib"
DIRLIST[2] = "/usr/lib"
#
# Walk /etc/ld.so.conf to discover all our library paths
#
pipe = "cat /etc/ld.so.conf | sort 2>/dev/null"
while(((pipe) | getline ldsoconf_data) > 0) {
if (ldsoconf_data !~ /^[[:space:]]*#/) {
if (ldsoconf_data == "") continue
# Remove any trailing comments
sub(/#.*$/, "", ldsoconf_data)
# Remove any trailing spaces
sub(/[[:space:]]+$/, "", ldsoconf_data)
# If there's more than one path per line, split
# it up as if they were sep lines
split(ldsoconf_data, nodes, /[:,[:space:]]/)
# Now add the rest from ld.so.conf
for (x in nodes) {
# wtf does this line do ?
sub(/=.*/, "", nodes[x])
# Prune trailing /
sub(/\/$/, "", nodes[x])
if (nodes[x] == "") continue
#
# Drop the directory if its a child directory of
# one that was already added ...
# For example, if we have:
# /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
# We really just want to save /usr/lib /usr/libexec
#
CHILD = 0
for (y in DIRLIST) {
if (nodes[x] ~ "^" DIRLIST[y] "(/|$)") {
CHILD = 1
break
}
}
if (CHILD) continue
DIRLIST[++LIBCOUNT] = nodes[x]
}
}
}
close(pipe)
#
# Get line from gcc's output containing CHOST
#
pipe = "gcc -print-file-name=libgcc.a 2>/dev/null"
if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) {
close(pipe)
# If we fail to get the CHOST, see if we can get the CHOST
# portage thinks we are using ...
pipe = "/usr/bin/portageq envvar 'CHOST'"
assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST")
} else {
# Check pre gcc-3.4.x versions
CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST)
if (CHOST == TMP_CHOST || CHOST == "") {
# Check gcc-3.4.x or later
CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST);
if (CHOST == TMP_CHOST || CHOST == "")
CHOST = ""
else
HAVE_GCC34 = 1
}
}
close(pipe)
if (CHOST == "") {
eerror("Could not get gcc's CHOST!")
exit 1
}
if (OLDCHOST != "")
if (OLDCHOST == CHOST)
OLDCHOST = ""
GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/"
GCCLIBPREFIX_NEW = "/usr/lib/gcc/"
if (HAVE_GCC34)
GCCLIBPREFIX = GCCLIBPREFIX_NEW
else
GCCLIBPREFIX = GCCLIBPREFIX_OLD
GCCLIB = GCCLIBPREFIX CHOST
if (OLDCHOST != "") {
OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST
OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST
}
# Get current gcc's version
pipe = "gcc -dumpversion"
assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)")
close(pipe)
if (NEWVER == "") {
eerror("Could not get gcc's version!")
exit 1
}
# Nothing to do ?
if ((OLDVER == NEWVER) && (OLDCHOST == ""))
exit 0
#
# Ok, now let's scan for the .la files and actually fix them up
#
for (x = 1; x <= LIBCOUNT; x++) {
# Do nothing if the target dir is gcc's internal library path
if (DIRLIST[x] ~ GCCLIBPREFIX_OLD ||
DIRLIST[x] ~ GCCLIBPREFIX_NEW)
continue
einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...")
pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null"
while (((pipe) | getline la_files) > 0) {
# Do nothing if the .la file is located in gcc's internal lib path
if (la_files ~ GCCLIBPREFIX_OLD ||
la_files ~ GCCLIBPREFIX_NEW)
continue
CHANGED = 0
CHOST_CHANGED = 0
# See if we need to fix the .la file
while ((getline la_data < (la_files)) > 0) {
if (OLDCHOST != "") {
if ((gsub(OLDGCCLIB1 "[/[:space:]]+",
GCCLIB, la_data) > 0) ||
(gsub(OLDGCCLIB2 "[/[:space:]]+",
GCCLIB, la_data) > 0)) {
CHANGED = 1
CHOST_CHANGED = 1
}
}
if (OLDVER != NEWVER) {
if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*",
GCCLIB "/" NEWVER, la_data) > 0) ||
(gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*",
GCCLIB "/" NEWVER, la_data) > 0))
CHANGED = 1
}
}
close(la_files)
# Do the actual changes in a second loop, as we can then
# verify that CHOST_CHANGED among things is correct ...
if (CHANGED) {
ewarnn(" FIXING: " la_files " ...")
if (CHANGED)
printn("[")
# Clear the temp file (removing rather than '>foo' is better
# out of a security point of view?)
dosystem("rm -f " la_files ".new")
while ((getline la_data < (la_files)) > 0) {
if (OLDCHOST != "") {
tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)",
GCCLIB "\\1", "g", la_data)
tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)",
GCCLIB "\\1", "g", tmpstr)
if (la_data != tmpstr) {
printn("c")
la_data = tmpstr
}
if (CHOST_CHANGED > 0) {
# We try to be careful about CHOST changes outside
# the gcc library path (meaning we cannot match it
# via /GCCLIBPREFIX CHOST/) ...
# Catch:
#
# dependency_libs=' -L/usr/CHOST/{bin,lib}'
#
gsub("-L/usr/" OLDCHOST "/",
"-L/usr/" CHOST "/", la_data)
# Catch:
#
# dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib'
#
la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/",
"\\1/" CHOST "/", "g", la_data)
}
}
if (OLDVER != NEWVER) {
# Catch:
#
# dependency_libs=' -L/usr/lib/gcc/CHOST/VER'
#
tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)",
GCCLIB "/" NEWVER "\\1", "g", la_data)
tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)",
GCCLIB "/" NEWVER "\\1", "g", tmpstr)
if (la_data != tmpstr) {
# Catch:
#
# dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib'
#
# in cases where we have gcc34
tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)",
GCCLIBPREFIX "\\1", "g", tmpstr)
tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)",
GCCLIBPREFIX "\\1", "g", tmpstr)
printn("v")
la_data = tmpstr
}
}
print la_data >> (la_files ".new")
}
if (CHANGED)
print "]"
close(la_files)
close(la_files ".new")
assert(dosystem("mv -f " la_files ".new " la_files),
"dosystem(\"mv -f " la_files ".new " la_files "\")")
}
}
close(pipe)
}
}
# vim:ts=4

View File

@ -1,334 +0,0 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# Helper functions
#
function printn(string) {
printf("%s", string)
}
function einfo(string) {
printf(" \033[32;01m*\033[0m %s\n", string)
}
function einfon(string) {
printf(" \033[32;01m*\033[0m %s", string)
}
function ewarn(string) {
printf(" \033[33;01m*\033[0m %s\n", string)
}
function ewarnn(string) {
printf(" \033[33;01m*\033[0m %s", string)
}
function eerror(string) {
printf(" \033[31;01m*\033[0m %s\n", string)
}
#
# assert(condition, errmsg)
# assert that a condition is true. Otherwise exit.
#
function assert(condition, string) {
if (! condition) {
printf("%s:%d: assertion failed: %s\n",
FILENAME, FNR, string) > "/dev/stderr"
_assert_exit = 1
exit 1
}
}
#
# system(command, return)
# wrapper that normalizes return codes ...
#
function dosystem(command, ret) {
ret = 0
ret = system(command)
if (ret == 0)
return 1
else
return 0
}
#
# parse_ld_conf(config_file)
#
function parse_ld_conf(conf, pipe, ldsoconf_data, CHILD, y) {
pipe = "cd /etc; cat " conf " | sort 2>/dev/null"
while(((pipe) | getline ldsoconf_data) > 0) {
if (ldsoconf_data ~ /^[[:space:]]*#/)
continue
if (ldsoconf_data == "")
continue
# Handle the "include" keyword
if (ldsoconf_data ~ /^include /) {
sub(/^include /, "", ldsoconf_data)
parse_ld_conf(ldsoconf_data)
continue
}
# Remove any trailing comments
sub(/#.*$/, "", ldsoconf_data)
# Remove any trailing spaces
sub(/[[:space:]]+$/, "", ldsoconf_data)
# Eat duplicate slashes
sub(/\/\//, "/", ldsoconf_data)
# Prune trailing /
sub(/\/$/, "", ldsoconf_data)
#
# Drop the directory if its a child directory of
# one that was already added ...
# For example, if we have:
# /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss
# We really just want to save /usr/lib /usr/libexec
#
CHILD = 0
for (y in DIRLIST) {
if (ldsoconf_data ~ "^" DIRLIST[y] "(/|$)") {
CHILD = 1
break
}
}
if (CHILD) continue
DIRLIST[++LIBCOUNT] = ldsoconf_data
}
close(pipe)
}
BEGIN {
#
# Get our variables from environment
#
OLDVER = ENVIRON["OLDVER"]
OLDCHOST = ENVIRON["OLDCHOST"]
if (OLDVER == "") {
eerror("Could not get OLDVER!");
exit 1
}
# Setup some sane defaults
LIBCOUNT = 2
HAVE_GCC34 = 0
DIRLIST[1] = "/lib"
DIRLIST[2] = "/usr/lib"
#
# Walk /etc/ld.so.conf to discover all our library paths
#
parse_ld_conf("/etc/ld.so.conf")
#
# Get line from gcc's output containing CHOST
#
pipe = "gcc -print-file-name=libgcc.a 2>/dev/null"
if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) {
close(pipe)
# If we fail to get the CHOST, see if we can get the CHOST
# portage thinks we are using ...
pipe = "/usr/bin/portageq envvar 'CHOST'"
assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST")
} else {
# Check pre gcc-3.4.x versions
CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST)
if (CHOST == TMP_CHOST || CHOST == "") {
# Check gcc-3.4.x or later
CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST);
if (CHOST == TMP_CHOST || CHOST == "")
CHOST = ""
else
HAVE_GCC34 = 1
}
}
close(pipe)
if (CHOST == "") {
eerror("Could not get gcc's CHOST!")
exit 1
}
if (OLDCHOST != "")
if (OLDCHOST == CHOST)
OLDCHOST = ""
GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/"
GCCLIBPREFIX_NEW = "/usr/lib/gcc/"
if (HAVE_GCC34)
GCCLIBPREFIX = GCCLIBPREFIX_NEW
else
GCCLIBPREFIX = GCCLIBPREFIX_OLD
GCCLIB = GCCLIBPREFIX CHOST
if (OLDCHOST != "") {
OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST
OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST
}
# Get current gcc's version
pipe = "gcc -dumpversion"
assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)")
close(pipe)
if (NEWVER == "") {
eerror("Could not get gcc's version!")
exit 1
}
# Nothing to do ?
# NB: Do not check for (OLDVER == NEWVER) anymore, as we might need to
# replace libstdc++.la ....
if ((OLDVER == "") && (OLDCHOST == ""))
exit 0
#
# Ok, now let's scan for the .la files and actually fix them up
#
for (x = 1; x <= LIBCOUNT; x++) {
# Do nothing if the target dir is gcc's internal library path
if (DIRLIST[x] ~ GCCLIBPREFIX_OLD ||
DIRLIST[x] ~ GCCLIBPREFIX_NEW)
continue
einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...")
pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null"
while (((pipe) | getline la_files) > 0) {
# Do nothing if the .la file is located in gcc's internal lib path
if (la_files ~ GCCLIBPREFIX_OLD ||
la_files ~ GCCLIBPREFIX_NEW)
continue
CHANGED = 0
CHOST_CHANGED = 0
# See if we need to fix the .la file
while ((getline la_data < (la_files)) > 0) {
if (OLDCHOST != "") {
if ((gsub(OLDGCCLIB1 "[/[:space:]]+",
GCCLIB, la_data) > 0) ||
(gsub(OLDGCCLIB2 "[/[:space:]]+",
GCCLIB, la_data) > 0)) {
CHANGED = 1
CHOST_CHANGED = 1
}
}
if (OLDVER != NEWVER) {
if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*",
GCCLIB "/" NEWVER, la_data) > 0) ||
(gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*",
GCCLIB "/" NEWVER, la_data) > 0))
CHANGED = 1
}
# We now check if we have libstdc++.la, as we remove the
# libtool linker scripts for gcc ...
# We do this last, as we only match the new paths
if (gsub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
"-lstdc++", la_data) > 0)
CHANGED = 1
}
close(la_files)
# Do the actual changes in a second loop, as we can then
# verify that CHOST_CHANGED among things is correct ...
if (CHANGED) {
ewarnn(" FIXING: " la_files " ...[")
# Clear the temp file (removing rather than '>foo' is better
# out of a security point of view?)
dosystem("rm -f " la_files ".new")
while ((getline la_data < (la_files)) > 0) {
if (OLDCHOST != "") {
tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)",
GCCLIB "\\1", "g", la_data)
tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)",
GCCLIB "\\1", "g", tmpstr)
if (la_data != tmpstr) {
printn("c")
la_data = tmpstr
}
if (CHOST_CHANGED > 0) {
# We try to be careful about CHOST changes outside
# the gcc library path (meaning we cannot match it
# via /GCCLIBPREFIX CHOST/) ...
# Catch:
#
# dependency_libs=' -L/usr/CHOST/{bin,lib}'
#
gsub("-L/usr/" OLDCHOST "/",
"-L/usr/" CHOST "/", la_data)
# Catch:
#
# dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib'
#
la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/",
"\\1/" CHOST "/", "g", la_data)
}
}
if (OLDVER != NEWVER) {
# Catch:
#
# dependency_libs=' -L/usr/lib/gcc/CHOST/VER'
#
tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)",
GCCLIB "/" NEWVER "\\1", "g", la_data)
tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)",
GCCLIB "/" NEWVER "\\1", "g", tmpstr)
if (la_data != tmpstr) {
# Catch:
#
# dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib'
#
# in cases where we have gcc34
tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)",
GCCLIBPREFIX "\\1", "g", tmpstr)
tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)",
GCCLIBPREFIX "\\1", "g", tmpstr)
printn("v")
la_data = tmpstr
}
}
# We now check if we have libstdc++.la, as we remove the
# libtool linker scripts for gcc and any referencese in any
# libtool linker scripts.
# We do this last, as we only match the new paths
tmpstr = gensub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la",
"-lstdc++", "g", la_data);
if (la_data != tmpstr) {
printn("l")
la_data = tmpstr
}
print la_data >> (la_files ".new")
}
if (CHANGED)
print "]"
close(la_files)
close(la_files ".new")
assert(dosystem("mv -f " la_files ".new " la_files),
"dosystem(\"mv -f " la_files ".new " la_files "\")")
}
}
close(pipe)
}
}
# vim:ts=4

View File

@ -1,20 +0,0 @@
#! /bin/sh
# Call the appropriate C compiler with options to accept ANSI/ISO C
# The following options are the same (as of gcc-2.95):
# -ansi
# -std=c89
# -std=iso9899:1990
for i; do
case "$i" in
-ansi|-std=c89|-std=iso9899:1990)
;;
-std=*)
echo >&2 "`basename $0` called with non ANSI/ISO C90 option $i"
exit 1
;;
esac
done
exec gcc -std=c89 -pedantic -U_FORTIFY_SOURCE "$@"

View File

@ -1,21 +0,0 @@
#! /bin/sh
# Call the appropriate C compiler with options to accept ANSI/ISO C
# The following options are the same (as of gcc-3.3):
# -std=c99
# -std=c9x
# -std=iso9899:1999
# -std=iso9899:199x
for i; do
case "$i" in
-std=c9[9x]|-std=iso9899:199[9x])
;;
-ansi|-std=*)
echo >&2 "`basename $0` called with non ANSI/ISO C99 option $i"
exit 1
;;
esac
done
exec gcc -std=c99 -pedantic -U_FORTIFY_SOURCE ${1+"$@"}

View File

@ -1,66 +0,0 @@
#!/bin/sh
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
usage() {
cat << "USAGE_END"
Usage: fix_libtool_files.sh <old-gcc-version> [--oldarch <old-CHOST>]
Where <old-gcc-version> is the version number of the
previous gcc version. For example, if you updated to
gcc-3.2.1, and you had gcc-3.2 installed, run:
# fix_libtool_files.sh 3.2
If you updated to gcc-3.2.3, and the old CHOST was i586-pc-linux-gnu
but you now have CHOST as i686-pc-linux-gnu, run:
# fix_libtool_files.sh 3.2 --oldarch i586-pc-linux-gnu
Note that if only the CHOST and not the version changed, you can run
it with the current version and the '--oldarch <old-CHOST>' arguments,
and it will do the expected:
# fix_libtool_files.sh `gcc -dumpversion` --oldarch i586-pc-linux-gnu
USAGE_END
exit 1
}
case $2 in
--oldarch) [ $# -ne 3 ] && usage ;;
*) [ $# -ne 1 ] && usage ;;
esac
ARGV1=$1
ARGV2=$2
ARGV3=$3
. /etc/profile || exit 1
if [ ${EUID:-0} -ne 0 -a "${EPREFIX}" = '' ] ; then
echo "${0##*/}: Must be root."
exit 1
fi
# make sure the files come out sane
umask 0022
OLDCHOST=
[ "${ARGV2}" = "--oldarch" ] && OLDCHOST=${ARGV3}
AWKDIR="/usr/share/gcc-data"
if [ ! -r "${AWKDIR}/fixlafiles.awk" ] ; then
echo "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!"
exit 1
fi
OLDVER=${ARGV1}
export OLDVER OLDCHOST
echo "Scanning libtool files for hardcoded gcc library paths..."
exec gawk -f "${AWKDIR}/fixlafiles.awk"
# vim:ts=4

View File

@ -1,66 +0,0 @@
From 41a4aa66eac45c8862a79351647ec06dd03bd1f5 Mon Sep 17 00:00:00 2001
From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Dec 2014 11:24:37 +0000
Subject: [PATCH] PR bootstrap/64023 * Makefile.tpl
(EXTRA_TARGET_FLAGS): Set STAGE1_LDFLAGS to POSTSTAGE1_LDFLAGS and
STAGE1_LIBS to POSTSTAGE1_LIBS. Add -B to libstdc++-v3/src/.libs and
libstdc++-v3/libsupc++/.libs to CXX. * Makefile.in: Regenerated.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218705 138bc75d-0d04-0410-961f-82ee72b054a4
---
ChangeLog | 9 +++++++++
Makefile.in | 6 +++++-
Makefile.tpl | 6 +++++-
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index ba5ae4c2ecb..8ffc313f157 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -835,7 +835,9 @@ EXTRA_TARGET_FLAGS = \
'AS=$(COMPILER_AS_FOR_TARGET)' \
'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
- 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
+ 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
+ -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
+ $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
@@ -853,6 +855,8 @@ EXTRA_TARGET_FLAGS = \
'WINDRES=$$(WINDRES_FOR_TARGET)' \
'WINDMC=$$(WINDMC_FOR_TARGET)' \
'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
+ 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
+ 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
"TFLAGS=$$TFLAGS"
TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
diff --git a/Makefile.tpl b/Makefile.tpl
index dcbc6b1b143..bb8227eaafa 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -641,7 +641,9 @@ EXTRA_TARGET_FLAGS = \
'AS=$(COMPILER_AS_FOR_TARGET)' \
'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
- 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
+ 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
+ -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
+ $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
@@ -659,6 +661,8 @@ EXTRA_TARGET_FLAGS = \
'WINDRES=$$(WINDRES_FOR_TARGET)' \
'WINDMC=$$(WINDMC_FOR_TARGET)' \
'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
+ 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
+ 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
"TFLAGS=$$TFLAGS"
TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
--
2.15.0

View File

@ -1,41 +0,0 @@
https://gcc.gnu.org/PR87338
From 1cc1dc32fcf6b47db4e6d28f55de343713f824a4 Mon Sep 17 00:00:00 2001
From: James Clarke <jrtc27@jrtc27.com>
Date: Thu, 25 Apr 2019 15:58:55 +0200
Subject: [PATCH] PR bootstrap/87338: Fix ia64 bootstrap comparison regression
in r257511
To: gcc-patches@gcc.gnu.org
By using ASM_OUTPUT_LABEL, r257511 forced the assembler to start a new
bundle when emitting an inline entry label on. Instead, use
ASM_OUTPUT_DEBUG_LABEL like for the block begin and end labels so tags are
emitted rather than labels.
gcc/
PR bootstrap/87338
* dwarf2out.c (dwarf2out_inline_entry): Use ASM_OUTPUT_DEBUG_LABEL
instead of ASM_GENERATE_INTERNAL_LABEL and ASM_OUTPUT_LABEL.
---
gcc/dwarf2out.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -27670,11 +27670,8 @@ dwarf2out_inline_entry (tree block)
if (cur_line_info_table)
ied->view = cur_line_info_table->view;
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_GENERATE_INTERNAL_LABEL (label, BLOCK_INLINE_ENTRY_LABEL,
- BLOCK_NUMBER (block));
- ASM_OUTPUT_LABEL (asm_out_file, label);
+ ASM_OUTPUT_DEBUG_LABEL (asm_out_file, BLOCK_INLINE_ENTRY_LABEL,
+ BLOCK_NUMBER (block));
}
/* Called from finalize_size_functions for size functions so that their body
--
1.8.5.3

View File

@ -1,29 +0,0 @@
https://gcc.gnu.org/PR90419
diff -ruN gcc-8.3.0.orig/gcc/config/riscv/t-linux-multilib gcc-8.3.0/gcc/config/riscv/t-linux-multilib
--- gcc-8.3.0.orig/gcc/config/riscv/t-linux-multilib 2017-02-06 22:38:37.000000000 +0100
+++ gcc-8.3.0/gcc/config/riscv/t-linux-multilib 2019-04-28 16:37:44.377841943 +0200
@@ -20,21 +20,9 @@
ilp32d \
lp64 \
lp64d
-MULTILIB_REQUIRED = march=rv32imac/mabi=ilp32 \
-march=rv32imafdc/mabi=ilp32d \
-march=rv64imac/mabi=lp64 \
+MULTILIB_REQUIRED = march=rv64imac/mabi=lp64 \
march=rv64imafdc/mabi=lp64d
-MULTILIB_REUSE = march.rv32imac/mabi.ilp32=march.rv32ima/mabi.ilp32 \
-march.rv32imac/mabi.ilp32=march.rv32imaf/mabi.ilp32 \
-march.rv32imac/mabi.ilp32=march.rv32imafd/mabi.ilp32 \
-march.rv32imac/mabi.ilp32=march.rv32imafc/mabi.ilp32 \
-march.rv32imac/mabi.ilp32=march.rv32imafdc/mabi.ilp32 \
-march.rv32imac/mabi.ilp32=march.rv32g/mabi.ilp32 \
-march.rv32imac/mabi.ilp32=march.rv32gc/mabi.ilp32 \
-march.rv32imafdc/mabi.ilp32d=march.rv32imafd/mabi.ilp32d \
-march.rv32imafdc/mabi.ilp32d=march.rv32gc/mabi.ilp32d \
-march.rv32imafdc/mabi.ilp32d=march.rv32g/mabi.ilp32d \
-march.rv64imac/mabi.lp64=march.rv64ima/mabi.lp64 \
+MULTILIB_REUSE = march.rv64imac/mabi.lp64=march.rv64ima/mabi.lp64 \
march.rv64imac/mabi.lp64=march.rv64imaf/mabi.lp64 \
march.rv64imac/mabi.lp64=march.rv64imafd/mabi.lp64 \
march.rv64imac/mabi.lp64=march.rv64imafc/mabi.lp64 \

View File

@ -1,29 +0,0 @@
https://bugs.gentoo.org/707958
https://gcc.gnu.org/PR88879
Subject: [PATCH] sel-sched: allow negative insn priority (PR 88879)
From: Alexander Monakov <amonakov@ispras.ru>
PR rtl-optimization/88879
* sel-sched.c (sel_target_adjust_priority): Remove assert.
From-SVN: r271039
---
gcc/ChangeLog | 5 +++++
gcc/sel-sched.c | 2 --
2 files changed, 5 insertions(+), 2 deletions(-)
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -3331,8 +3331,6 @@ sel_target_adjust_priority (expr_t expr)
else
new_priority = priority;
- gcc_assert (new_priority >= 0);
-
/* If the priority has changed, adjust EXPR_PRIORITY_ADJ accordingly. */
EXPR_PRIORITY_ADJ (expr) = new_priority - EXPR_PRIORITY (expr);
--
2.25.0

View File

@ -1,87 +0,0 @@
2013-08-22 Magnus Granberg <zorry@gentoo.org>
* gcc/gcc.c (main): Add support for external spec file via the GCC_SPECS env var
and move the process of the user specifed specs.
This allows us to easily control pie/ssp defaults with gcc-config profiles.
Original patch by Rob Holland
Extended to support multiple entries separated by ':' by Kevin F. Quinn
Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
Modified to process the GCC_SPECS env var befor DRIVER_SELF_SPECS by Magnus Granberg
--- gcc-4.8-20130210/gcc/gcc.c 2013-02-05 16:55:31.000000000 +0100
+++ gcc-4.8-20130210-work/gcc/gcc.c 2013-07-26 02:32:14.625089864 +0200
@@ -6427,6 +6428,48 @@ main (int argc, char **argv)
do_option_spec (option_default_specs[i].name,
option_default_specs[i].spec);
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
+ /* Add specs listed in GCC_SPECS. Note; in the process of separating
+ * each spec listed, the string is overwritten at token boundaries
+ * (':') with '\0', an effect of strtok_r().
+ */
+ specs_file = getenv ("GCC_SPECS");
+ if (specs_file && (strlen(specs_file) > 0))
+ {
+ char *spec, *saveptr;
+ for (spec=strtok_r(specs_file,":",&saveptr);
+ spec!=NULL;
+ spec=strtok_r(NULL,":",&saveptr))
+ {
+ struct user_specs *user = (struct user_specs *)
+ xmalloc (sizeof (struct user_specs));
+ user->next = (struct user_specs *) 0;
+ user->filename = spec;
+ if (user_specs_tail)
+ user_specs_tail->next = user;
+ else
+ user_specs_head = user;
+ user_specs_tail = user;
+ }
+ }
+#endif
+ /* Process any user specified specs in the order given on the command
+ * line. */
+ for (uptr = user_specs_head; uptr; uptr = uptr->next)
+ {
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename,
+ R_OK, true);
+ read_specs (filename ? filename : uptr->filename, false, true);
+ }
+ /* Process any user self specs. */
+ {
+ struct spec_list *sl;
+ for (sl = specs; sl; sl = sl->next)
+ if (sl->name_len == sizeof "self_spec" - 1
+ && !strcmp (sl->name, "self_spec"))
+ do_self_spec (*sl->ptr_spec);
+ }
+
/* Process DRIVER_SELF_SPECS, adding any new options to the end
of the command line. */
@@ -6535,24 +6578,6 @@ main (int argc, char **argv)
PREFIX_PRIORITY_LAST, 0, 1);
}
- /* Process any user specified specs in the order given on the command
- line. */
- for (uptr = user_specs_head; uptr; uptr = uptr->next)
- {
- char *filename = find_a_file (&startfile_prefixes, uptr->filename,
- R_OK, true);
- read_specs (filename ? filename : uptr->filename, false, true);
- }
-
- /* Process any user self specs. */
- {
- struct spec_list *sl;
- for (sl = specs; sl; sl = sl->next)
- if (sl->name_len == sizeof "self_spec" - 1
- && !strcmp (sl->name, "self_spec"))
- do_self_spec (*sl->ptr_spec);
- }
-
if (compare_debug)
{
enum save_temps save;

View File

@ -1,42 +0,0 @@
Add support for external spec file via the GCC_SPECS env var. This
allows us to easily control pie/ssp defaults with gcc-config profiles.
Original patch by Rob Holland
Extended to support multiple entries separated by ':' by Kevin F. Quinn
Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
--- gcc-4/gcc/gcc.c
+++ gcc-4/gcc/gcc.c
@@ -6482,6 +6482,32 @@
/* Process any user specified specs in the order given on the command
line. */
+#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
+ /* Add specs listed in GCC_SPECS. Note; in the process of separating
+ * each spec listed, the string is overwritten at token boundaries
+ * (':') with '\0', an effect of strtok_r().
+ */
+ specs_file = getenv ("GCC_SPECS");
+ if (specs_file && (strlen(specs_file) > 0))
+ {
+ char *spec, *saveptr;
+ for (spec=strtok_r(specs_file,":",&saveptr);
+ spec!=NULL;
+ spec=strtok_r(NULL,":",&saveptr))
+ {
+ struct user_specs *user = (struct user_specs *)
+ xmalloc (sizeof (struct user_specs));
+
+ user->next = (struct user_specs *) 0;
+ user->filename = spec;
+ if (user_specs_tail)
+ user_specs_tail->next = user;
+ else
+ user_specs_head = user;
+ user_specs_tail = user;
+ }
+ }
+#endif
for (uptr = user_specs_head; uptr; uptr = uptr->next)
{
char *filename = find_a_file (&startfile_prefixes, uptr->filename,

View File

@ -1,25 +0,0 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
PATCH_VER="1.1"
inherit toolchain
KEYWORDS="alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
RDEPEND=""
DEPEND="${RDEPEND}
elibc_glibc? ( >=sys-libs/glibc-2.13 )
>=${CATEGORY}/binutils-2.20"
if [[ ${CATEGORY} != cross-* ]] ; then
PDEPEND="${PDEPEND} elibc_glibc? ( >=sys-libs/glibc-2.13 )"
fi
src_prepare() {
toolchain_src_prepare
eapply "${FILESDIR}"/gcc-8.3.0-ia64-bootstrap.patch
eapply "${FILESDIR}"/gcc-8.3.0-norisc32.patch
}

View File

@ -1,13 +1,13 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="6"
PATCH_VER="3"
EAPI="7"
PATCH_VER="1"
MUSL_VER="1"
inherit toolchain
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
RDEPEND=""
DEPEND="${RDEPEND}

View File

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>toolchain@gentoo.org</email>
<name>Gentoo Toolchain Project</name>
</maintainer>
<use>
<flag name="ada">Build the ADA language (GNAT) frontend</flag>
<flag name="awt">Useful only when building GCJ, this enables Abstract Window Toolkit
(AWT) peer support on top of GTK+</flag>
<flag name="boundschecking">Add the bounds checking patch by Haj Ten Brugge,
this will DISABLE the hardened PIE+SSP patches</flag>
<flag name="cilk">Support the Cilk Plus language (C/C++ based languages for parallel programming)</flag>
<flag name="d">Enable support for the D programming language</flag>
<flag name="fixed-point">Enable fixed-point arithmetic support for MIPS targets
in gcc (Warning: significantly increases compile time!)</flag>
<flag name="gcj">Build the GCJ Java language frontend.</flag>
<flag name="go">Build the GCC Go language frontend.</flag>
<flag name="graphite">Add support for the framework for loop
optimizations based on a polyhedral intermediate representation</flag>
@ -23,18 +23,16 @@
code in the C library (DO NOT ENABLE THIS IF YOU DON'T KNOW WHAT IT DOES)</flag>
<flag name="lto">Build using Link Time Optimizations (LTO)</flag>
<flag name="mpx">Enable support for Intel Memory Protection Extensions (MPX)</flag>
<flag name="mudflap">Add support for mudflap, a pointer use checking library</flag>
<flag name="nopie">Disable PIE support (NOT FOR GENERAL USE)</flag>
<flag name="nossp">Disable SSP support (NOT FOR GENERAL USE)</flag>
<flag name="nptl">Enable support for Native POSIX Threads Library, the new threading module (requires linux-2.6 or better usually)</flag>
<flag name="objc">Build support for the Objective C code language</flag>
<flag name="objc++">Build support for the Objective C++ language</flag>
<flag name="objc-gc">Build support for the Objective C code language Garbage
Collector</flag>
<flag name="pgo">Build GCC using Profile Guided Optimization (PGO)</flag>
<flag name="regression-test">Run the testsuite and install the results (requires FEATURES=test)</flag>
<flag name="sanitize">Build support for various sanitizer functions (ASAN/TSAN/etc...)</flag>
<flag name="ssp">Build packages with stack smashing protector on by default</flag>
<flag name="systemtap">enable systemtap static probe points</flag>
<flag name="valgrind">Enable valgrind annotations for gcc internals (useful for gcc debugging).</flag>
<flag name="vtv">Build support for virtual table verification (a C++ hardening feature)</flag>
</use>
<upstream>