From 664e3c050d9b7266e5a153501b79dcfb1f777a20 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 2 Dec 2013 17:05:32 +0100 Subject: [PATCH] gcc 4: Disable ASLR for the executables Makes pre-compiled headers work reliably. --- sys-devel/gcc/gcc-4.7.3_2013_08_12.recipe | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sys-devel/gcc/gcc-4.7.3_2013_08_12.recipe b/sys-devel/gcc/gcc-4.7.3_2013_08_12.recipe index ce167030b..e8a2c5797 100644 --- a/sys-devel/gcc/gcc-4.7.3_2013_08_12.recipe +++ b/sys-devel/gcc/gcc-4.7.3_2013_08_12.recipe @@ -10,7 +10,7 @@ SRC_URI=" git+file://$portBaseDir/../binutils/download/BuildtoolsPM.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c git+git://github.com/haiku/BuildtoolsPM.git#2d0a2c6404ffae1a46eb7e74daab08099b45af2c " -REVISION="3" +REVISION="4" ARCHITECTURES="x86 x86_64" if [ $effectiveTargetArchitecture != x86_gcc2 ]; then # x86_gcc2 is fine as primary target architecture as long as we're building @@ -119,6 +119,21 @@ INSTALL() done strip --strip-debug lib/*.a + ### Disable ASLR ########################################## + + echo "Add SYS:ENV attribute to disable ASLR" + + cd $installDir + for f in bin/*; do + if [ -r "$f" ]; then + addattr SYS:ENV DISABLE_ASLR=1 $f + fi + done + for f in cc1 cc1plus collect2 lto1; do + addattr SYS:ENV DISABLE_ASLR=1 \ + lib/gcc/$effectiveTargetMachineTriple/*/$f + done + ### Symlinks ############################################## echo "Creating required symlinks"