From: Heiko Z. <smi...@us...> - 2005-01-06 14:02:29
|
Update of /cvsroot/devil-linux/build/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8713/scripts Modified Files: eagle-usb gcc glibc linux linux-wlan-ng Log Message: adapted more changes from the HLFS book (working closer together with Robert right now) compile everything with -fpie and -fstack-protector-all if possible Index: linux-wlan-ng =================================================================== RCS file: /cvsroot/devil-linux/build/scripts/linux-wlan-ng,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- linux-wlan-ng 13 Dec 2004 23:58:52 -0000 1.15 +++ linux-wlan-ng 6 Jan 2005 14:02:18 -0000 1.16 @@ -44,8 +44,8 @@ make default_config || exit 1 - make $PMAKE all || exit 1 - make -C add-ons/keygen || exit 1 + make CC="gcc -no-pie" $PMAKE all || exit 1 + make CC="gcc -no-pie" -C add-ons/keygen || exit 1 strip_debug replace_str etc/wlan/wlan.conf '^WLAN_DEVICES="wlan0"' '#WLAN_DEVICES="wlan0"' fi Index: eagle-usb =================================================================== RCS file: /cvsroot/devil-linux/build/scripts/eagle-usb,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- eagle-usb 24 Dec 2004 17:03:50 -0000 1.8 +++ eagle-usb 6 Jan 2005 14:02:18 -0000 1.9 @@ -32,7 +32,7 @@ if [ "$CONFIG_EAGLE_USB" = "y" ]; then ./autogen.sh || exit 1 ./configure --prefix=/usr --with-kernel-src=$KERNELDIR --with-lang=en || exit 1 - make || exit 1 + make CC="gcc -no-pie" || exit 1 fi ;; Index: glibc =================================================================== RCS file: /cvsroot/devil-linux/build/scripts/glibc,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- glibc 28 Dec 2004 18:55:08 -0000 1.44 +++ glibc 6 Jan 2005 14:02:18 -0000 1.45 @@ -10,7 +10,7 @@ ### BEGIN INIT INFO # Provides: glibc -# Required-Start: prepare distcc +# Required-Start: prepare distcc binutils # Required-Stop: # Default-Start: 1 2 # Default-Stop: @@ -91,7 +91,6 @@ # --without-gd make $PMAKE || exit 1 - #make || exit 1 strip_debug || exit 1 # we have to install this immediately, because this is a library and could be needed by other sources Index: gcc =================================================================== RCS file: /cvsroot/devil-linux/build/scripts/gcc,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- gcc 2 Jan 2005 20:12:46 -0000 1.29 +++ gcc 6 Jan 2005 14:02:18 -0000 1.30 @@ -50,15 +50,15 @@ fi fi - CONFIG_EXTRA="$CONFIG_EXTRA --enable-stack-protector" + #CONFIG_EXTRA="$CONFIG_EXTRA --enable-stack-protector" #patch -p1 -i $(find_src_dir gcc-secpatches)/gcc-3.4-sspspecs-3.patch || exit 1 fi if [ ! -f gcc-patches.done ]; then echo "applying gcc patches" bzcat $DL_DIR/src/gcc-3*patch.bz2 | patch -p1 || exit 1 - echo "applying auto-pue patch" - patch -p1 -i $(find_src_dir gcc-secpatches)/gcc-3.4-piespecs_x86-2.patch || exit 1 + #echo "applying auto-pie patch" + #patch -p1 -i $(find_src_dir gcc-secpatches)/gcc-3.4-piespecs_x86-2.patch || exit 1 touch gcc-patches.done fi @@ -79,6 +79,29 @@ # install it, so we use the same version everywhere make install-no-fixedincludes || exit 1 + if [ "$CONFIG_GCC_STACK_PROTECTOR" = "y" ]; then + # and now make sure we use SSP when compiling + # thanks to Robert Connolly + perl -pi -e 's@\*cc1:\n@$_%(cc1_ssp) @;' $(gcc --print-file specs) + perl -pi -e 's@\*cc1plus:\n@$_%(cc1_ssp) @;' $(gcc --print-file specs) + echo '*cc1_ssp: +%{!fno-stack-protector*: -fstack-protector-all} +' >> $(gcc --print-file specs) + fi + perl -pi -e 's@\*cc1:\n@$_%(cc1_pie) @;' $(gcc --print-file specs) + perl -pi -e 's@\*cc1plus:\n@$_%(cc1_pie) @;' $(gcc --print-file specs) + perl -pi -e 's@%{pie:-pie}@%(link_pie)@;' $(gcc --print-file specs) + perl -pi -e 's@pie:@!no-pie|pie:@g;' $(gcc --print-file specs) + perl -pi -e 's@\*cpp:\n@$_%(cpp_pie) @;' $(gcc --print-file specs) + echo '*cpp_pie: +%{!static:%{!no-pie:%{!pie: -D__PIC__ -DPIC}}} +' >> $(gcc --print-file specs) + echo '*cc1_pie: +%{!static:%{!no-pie:%{!pie: -fPIC}}} +' >> $(gcc --print-file specs) + echo '*link_pie: +%{pie:-pie} %{!pie:%{!static:%{!Bstatic:%{!shared:%{!Bshareable:%{!i:%{!r:%{!no-pie: -pie -z now -z relro}}}}}}}} +' >> $(gcc --print-file specs) ;; install ) Index: linux =================================================================== RCS file: /cvsroot/devil-linux/build/scripts/linux,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- linux 30 Aug 2004 12:21:28 -0000 1.55 +++ linux 6 Jan 2005 14:02:18 -0000 1.56 @@ -36,11 +36,16 @@ # append settings from other progs to config file cat .config.add >> .config || exit 1 fi + if [ "$CONFIG_GCC_STACK_PROTECTOR" = "y" ]; then + make oldconfig + make CC="gcc -no-pie -fno-stack-protector-all -fstack-protector" $PMAKE bzImage || exit 1 + make CC="gcc -no-pie -fno-stack-protector-all -fstack-protector" $PMAKE modules || exit 1 + else + make oldconfig + make CC="gcc -no-pie" $PMAKE bzImage || exit 1 + make CC="gcc -no-pie" $PMAKE modules || exit 1 + fi - make oldconfig - make dep || exit 1 - make $PMAKE bzImage || exit 1 - make $PMAKE modules || exit 1 ;; install ) |