Browse Source

Clifford Wolf:


			
			
				rocklinux
			
			
		
Clifford Wolf 19 years ago
parent
commit
4e87e1ab80
3 changed files with 44 additions and 7 deletions
  1. +5
    -3
      package/base/gcc/apply-protector.sh
  2. +4
    -4
      package/base/gcc/gcc.desc
  3. +35
    -0
      package/base/gcc/gcc33/protector-hotfix.diff

+ 5
- 3
package/base/gcc/apply-protector.sh

@ -4,19 +4,21 @@ 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')
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
patch -p1 < $1/package/base/$2/protector-hotfix.diff
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/

+ 4
- 4
package/base/gcc/gcc.desc

@ -59,14 +59,14 @@
#endif
#if xpkg == gcc33.*
[V] 3.3.5
[D] 1892323860 gcc-3.3.5.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/gcc-3.3.5/
[V] 3.3.6
[D] 3201207174 gcc-3.3.6.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/gcc-3.3.6/
[D] 3472291992 protector-3.3-7.tar.gz http://www.research.ibm.com/trl/projects/security/ssp/gcc3_3/
#endif
#if xpkg == gcc34.*
[V] 3.4.4
[D] 1929991607 gcc-3.4.4.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/gcc-3.4.4/
[V] 3.4.5
[D] 2687631868 gcc-3.4.5.tar.bz2 ftp://gcc.gnu.org/pub/gcc/releases/gcc-3.4.5/
[D] 365541092 protector-3.4.4-1.tar.gz http://www.research.ibm.com/trl/projects/security/ssp/gcc3_4_4/
#endif

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

@ -0,0 +1,35 @@
--- ./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. */

Loading…
Cancel
Save