Browse Source

Stefan Fiedler:


			
			
				rocklinux
			
			
		
Stefan Fiedler 17 years ago
parent
commit
f163d8ef16
6 changed files with 0 additions and 233 deletions
  1. +0
    -29
      package/base/gcc/apply-protector.sh
  2. +0
    -6
      package/base/gcc/gcc.conf
  3. +0
    -71
      package/base/gcc/gcc2/protector-docs.patch
  4. +0
    -71
      package/base/gcc/gcc32/protector-docs.patch
  5. +0
    -54
      package/base/gcc/gcc33/protector-hotfix.diff
  6. +0
    -2
      package/base/gcc/parse-config

+ 0
- 29
package/base/gcc/apply-protector.sh

@ -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

+ 0
- 6
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 ]

+ 0
- 71
package/base/gcc/gcc2/protector-docs.patch

@ -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

+ 0
- 71
package/base/gcc/gcc32/protector-docs.patch

@ -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

+ 0
- 54
package/base/gcc/gcc33/protector-hotfix.diff

@ -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. */

+ 0
- 2
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

Loading…
Cancel
Save