From f163d8ef16281c6f28600f27f6b5ace9068c0602 Mon Sep 17 00:00:00 2001 From: Stefan Fiedler Date: Sun, 3 Jun 2007 13:31:58 +0000 Subject: [PATCH] Stefan Fiedler: gcc: remove left-over stack protector files and code [2007052613015414700] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@8520 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/base/gcc/apply-protector.sh | 29 -------- package/base/gcc/gcc.conf | 6 -- package/base/gcc/gcc2/protector-docs.patch | 71 -------------------- package/base/gcc/gcc32/protector-docs.patch | 71 -------------------- package/base/gcc/gcc33/protector-hotfix.diff | 54 --------------- package/base/gcc/parse-config | 2 - 6 files changed, 233 deletions(-) delete mode 100644 package/base/gcc/apply-protector.sh delete mode 100644 package/base/gcc/gcc2/protector-docs.patch delete mode 100644 package/base/gcc/gcc32/protector-docs.patch delete mode 100644 package/base/gcc/gcc33/protector-hotfix.diff diff --git a/package/base/gcc/apply-protector.sh b/package/base/gcc/apply-protector.sh deleted file mode 100644 index 7ceefd303..000000000 --- a/package/base/gcc/apply-protector.sh +++ /dev/null @@ -1,29 +0,0 @@ - -pfile=$( echo "$3" | grep protector | tr ' ' '\t' | tr -s '\t' | cut -f2 ) - -if [ "$pfile" ] -then - tar='tar --use-compress-program=bzip2' - pdif=$($tar -tf $archdir/${pfile/.gz/.bz2} | \ - grep '\.dif$' | grep -v 'protectonly\.dif'; ) - $tar -xf $archdir/${pfile/.gz/.bz2} - - # Patch protector.dif a bit to apply against current gcc-3 - if test -f $1/package/base/gcc/$2/protector-hotfix.diff; then - echo "Hotfixing the protector patch .." - patch -p1 < $1/package/base/gcc/$2/protector-hotfix.diff - fi - - # be careful if you enable this, you have to respect $pkg. - # Set -fstack-protector as default? - # [ $ROCKCFG_PKG_GCC[23]_STACKPRO = 1 ] && patch -p0 < protectonly.dif - - echo "Applying the protector patch .." - patch -p0 < $pdif - if [ $2 != gcc34 ]; then - mv protector.{c,h} gcc/ - fi -else - echo "No stack-protector available for $2 ..." -fi - diff --git a/package/base/gcc/gcc.conf b/package/base/gcc/gcc.conf index f5847378e..6b300a633 100644 --- a/package/base/gcc/gcc.conf +++ b/package/base/gcc/gcc.conf @@ -90,9 +90,6 @@ genrockspecs() { hook_add preconf 2 custmain() { - # Apply the respective gcc-2 or gcc-3 stack protector patch. - . $base/package/base/gcc/apply-protector.sh $base gcc${pkg_gcc_version} "$desc_D" - hook_eval preconf # In stage 1 we only build a normal c compiler (no c++, etc) @@ -454,9 +451,6 @@ custmain() { } gcc_cross() { - # Apply the respective gcc-2 or gcc-3 stack protector patch. - . $base/package/base/gcc/apply-protector.sh $base gcc${pkg_gcc_version} "$desc_D" - mkdir -p $root/$prefix/$pkg_gcc_target/{bin,lib} if [ "$stagelevel" -eq 0 ] diff --git a/package/base/gcc/gcc2/protector-docs.patch b/package/base/gcc/gcc2/protector-docs.patch deleted file mode 100644 index 42e55622e..000000000 --- a/package/base/gcc/gcc2/protector-docs.patch +++ /dev/null @@ -1,71 +0,0 @@ -# --- ROCK-COPYRIGHT-NOTE-BEGIN --- -# -# This copyright note is auto-generated by ./scripts/Create-CopyPatch. -# Please add additional copyright information _after_ the line containing -# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by -# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! -# -# ROCK Linux: rock-src/package/base/gcc/gcc2/protector-docs.patch -# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf -# -# This patch file is dual-licensed. It is available under the license the -# patched project is licensed under, as long as it is an OpenSource license -# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms -# of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# --- ROCK-COPYRIGHT-NOTE-END --- - - -Add documentation (man and info) to protector.patch. - ---- ./gcc/gcc.1.orig Tue Oct 16 08:19:36 2001 -+++ ./gcc/gcc.1 Tue Oct 16 08:27:46 2001 -@@ -515,6 +515,7 @@ - \-fshared\-data - \-fshort\-enums - \-fshort\-double -+\-fstack\-protector - \-fvolatile - \-fvolatile\-global - \-fverbose\-asm -@@ -3856,6 +3857,12 @@ - .B no\-\c - \&\|' or adding - it. -+.TP -+.B \-fstack\-protector -+Enable the Stack-Smashing Protector ( -+.B http://www.trl.ibm.com/projects/security/ssp/ -+). This option is only available in ROCK Linux (and probably -+some other distributions). It's not a standard GCC option. - .TP - .B \-fnonnull\-objects - Assume that objects reached through references are not null ---- ./gcc/invoke.texi.orig Tue Oct 16 08:38:25 2001 -+++ ./gcc/invoke.texi Tue Oct 16 08:38:17 2001 -@@ -421,8 +421,8 @@ - -fno-common -fno-ident -fno-gnu-linker - -fpcc-struct-return -fpic -fPIC - -freg-struct-return -fshared-data -fshort-enums ---fshort-double -fvolatile -fvolatile-global -fvolatile-static ---fverbose-asm -fpack-struct -fstack-check -+-fshort-double -fstack-protector -fvolatile -fvolatile-global -+-fvolatile-static -fverbose-asm -fpack-struct -fstack-check - -fargument-alias -fargument-noalias - -fargument-noalias-global - -fleading-underscore -@@ -6147,6 +6147,12 @@ - it. - - @table @code -+@item -fstack-protector -+Enable the Stack-Smashing Protector -+(http://www.trl.ibm.com/projects/security/ssp/). -+This option is only available in ROCK Linux (and probably -+some other distributions). It's not a standard GCC option. -+ - @item -fexceptions - Enable exception handling. Generates extra code needed to propagate - exceptions. For some targets, this implies generation of frame unwind diff --git a/package/base/gcc/gcc32/protector-docs.patch b/package/base/gcc/gcc32/protector-docs.patch deleted file mode 100644 index 149275aad..000000000 --- a/package/base/gcc/gcc32/protector-docs.patch +++ /dev/null @@ -1,71 +0,0 @@ -# --- ROCK-COPYRIGHT-NOTE-BEGIN --- -# -# This copyright note is auto-generated by ./scripts/Create-CopyPatch. -# Please add additional copyright information _after_ the line containing -# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by -# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! -# -# ROCK Linux: rock-src/package/base/gcc/gcc32/protector-docs.patch -# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf -# -# This patch file is dual-licensed. It is available under the license the -# patched project is licensed under, as long as it is an OpenSource license -# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms -# of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# --- ROCK-COPYRIGHT-NOTE-END --- - ---- ./gcc/doc/gcc.1.orig 2002-11-19 19:17:19.000000000 +0100 -+++ ./gcc/doc/gcc.1 2003-01-02 16:08:53.000000000 +0100 -@@ -687,8 +687,8 @@ - \&\-fno-common \-fno-ident \-fno-gnu-linker - \&\-fpcc-struct-return \-fpic \-fPIC - \&\-freg-struct-return \-fshared-data \-fshort-enums --\&\-fshort-double \-fshort-wchar \-fvolatile --\&\-fvolatile-global \-fvolatile-static -+\&\-fshort-double \-fstack-protector \-fshort-wchar -+\&\-fvolatile \-fvolatile-global \-fvolatile-static - \&\-fverbose-asm \-fpack-struct \-fstack-check - \&\-fstack-limit-register=\fR\fIreg\fR \fB\-fstack-limit-symbol=\fR\fIsym\fR - \&\fB\-fargument-alias \-fargument-noalias -@@ -8954,6 +8954,12 @@ - instructions to throw exceptions, i.e. memory references or floating - point instructions. It does not allow exceptions to be thrown from - arbitrary signal handlers such as \f(CW\*(C`SIGALRM\*(C'\fR. -+.Ip "\fB\-fstack-protector\fR" 4 -+.IX Item "-fstack-protector" -+Enable the Stack-Smashing Protector ( -+.B http://www.trl.ibm.com/projects/security/ssp/ -+). This option is only available in ROCK Linux (and probably -+some other distributions). It's not a standard GCC option. - .Ip "\fB\-funwind-tables\fR" 4 - .IX Item "-funwind-tables" - Similar to \fB\-fexceptions\fR, except that it will just generate any needed ---- ./gcc/doc/invoke.texi.orig 2002-10-29 17:35:04.000000000 +0100 -+++ ./gcc/doc/invoke.texi 2003-01-02 16:12:11.000000000 +0100 -@@ -676,7 +676,7 @@ - -fno-common -fno-ident -fno-gnu-linker @gol - -fpcc-struct-return -fpic -fPIC @gol - -freg-struct-return -fshared-data -fshort-enums @gol ---fshort-double -fshort-wchar -fvolatile @gol -+-fshort-double -fstack-protector -fshort-wchar -fvolatile @gol - -fvolatile-global -fvolatile-static @gol - -fverbose-asm -fpack-struct -fstack-check @gol - -fstack-limit-register=@var{reg} -fstack-limit-symbol=@var{sym} @gol -@@ -9721,6 +9721,14 @@ - it. - - @table @gcctabopt -+ -+@item -fstack-protector -+@opindex fstack-protector -+Enable the Stack-Smashing Protector -+(http://www.trl.ibm.com/projects/security/ssp/). -+This option is only available in ROCK Linux (and probably -+some other distributions). It's not a standard GCC option. -+ - @item -fexceptions - @opindex fexceptions - Enable exception handling. Generates extra code needed to propagate diff --git a/package/base/gcc/gcc33/protector-hotfix.diff b/package/base/gcc/gcc33/protector-hotfix.diff deleted file mode 100644 index f2a9b9453..000000000 --- a/package/base/gcc/gcc33/protector-hotfix.diff +++ /dev/null @@ -1,54 +0,0 @@ -# --- ROCK-COPYRIGHT-NOTE-BEGIN --- -# -# This copyright note is auto-generated by ./scripts/Create-CopyPatch. -# Please add additional copyright information _after_ the line containing -# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by -# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! -# -# ROCK Linux: rock-src/package/base/gcc/gcc33/protector-hotfix.diff -# ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf -# -# This patch file is dual-licensed. It is available under the license the -# patched project is licensed under, as long as it is an OpenSource license -# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms -# of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# --- ROCK-COPYRIGHT-NOTE-END --- - ---- ./protector.dif.orig 2005-12-12 18:08:37.000000000 +0100 -+++ ./protector.dif 2005-12-12 18:09:04.000000000 +0100 -@@ -573,24 +573,23 @@ - /* P comes after Q; combine P into Q. */ - q->size += p->size; - *************** put_reg_into_stack (function, reg, type, --*** 1497,1503 **** -- new = func->x_parm_reg_stack_loc[regno]; -+*** 1513,1518 **** - - if (new == 0) --! new = assign_stack_local_1 (decl_mode, GET_MODE_SIZE (decl_mode), 0, func); -+! new = assign_stack_local_1 (decl_mode, GET_MODE_SIZE (decl_mode), -+! consecutive_p ? -2 : 0, func); - - PUT_CODE (reg, MEM); -- PUT_MODE (reg, decl_mode); ----- 1512,1520 ---- -- new = func->x_parm_reg_stack_loc[regno]; -+--- 1513,1521 ---- - - if (new == 0) - ! new = function ? --! assign_stack_local_1 (decl_mode, GET_MODE_SIZE (decl_mode), 0, func): --! assign_stack_local_for_pseudo_reg (decl_mode, GET_MODE_SIZE (decl_mode), 0); -+! assign_stack_local_1 (decl_mode, GET_MODE_SIZE (decl_mode), -+! consecutive_p ? -2 : 0, func) : -+! assign_stack_local_for_pseudo_reg (decl_mode, GET_MODE_SIZE (decl_mode), -+! consecutive_p ? -2 : 0); - - PUT_CODE (reg, MEM); -- PUT_MODE (reg, decl_mode); - *************** instantiate_virtual_regs_1 (loc, object, - *** 3961,3967 **** - constant with that register. */ diff --git a/package/base/gcc/parse-config b/package/base/gcc/parse-config index 8f9a9ad45..c8525178e 100644 --- a/package/base/gcc/parse-config +++ b/package/base/gcc/parse-config @@ -30,8 +30,6 @@ if [ $pkg != glibc23 -a $pkg != glibc22 -a \ $pkg != grub -a $pkg != dietlibc ] then if [ "$ROCKCFG_PKG_GCC_STACKPRO" = 1 ] ; then - var_append GCC2_WRAPPER_INSERT " " "-fstack-protector" - var_append GCC3_WRAPPER_INSERT " " "-fstack-protector" var_append GCC4_WRAPPER_INSERT " " "-fstack-protector" fi fi