Patchwork fix PR pch/45979 regression on recent ARM/Linux kernels

login
register
mail settings
Submitter Mikael Pettersson
Date Oct. 26, 2010, 6:45 p.m.
Message ID <19655.8672.504570.850812@pilspetsen.it.uu.se>
Download mbox | patch
Permalink /patch/69285/
State New
Headers show

Comments

Mikael Pettersson - Oct. 26, 2010, 6:45 p.m.
Post 2.6.35 ARM/Linux kernels now randomize mmap() by default,
which breaks precompiled headers.  See PR pch/45979.

Fixed by supplying an explicit hint for a likely free area
in the address space for precompiled headers to use, similar
to what has already been done for many other Linux archs.
Based on observation from several largish processes on an
arm-linux-gnueabi machine, 0xa0000000 seems to be a good
choice: it's just under the stack and at the end of a large
area populated by shared libraries.

Tested with gcc-4.6/4.5/4.4 on arm-linux-gnueabi running
2.6.36-rcN kernels.  Fixed all pch testsuite failures, with
no new regressions.

Ok for trunk/4.5/4.4?  (I don't havn svn write access.)

gcc/

2010-10-26  Mikael Pettersson  <mikpe@it.uu.se>

	PR pch/45979
	* config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __ARM_EABI__.
Mikael Pettersson - Nov. 19, 2010, 9:15 a.m.
Ping for http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02252.html

If it helps: I hereby place this patch in the public domain.

On Tue, 26 Oct 2010 20:45:52 +0200, Mikael Pettersson wrote:
 > Post 2.6.35 ARM/Linux kernels now randomize mmap() by default,
 > which breaks precompiled headers.  See PR pch/45979.
 > 
 > Fixed by supplying an explicit hint for a likely free area
 > in the address space for precompiled headers to use, similar
 > to what has already been done for many other Linux archs.
 > Based on observation from several largish processes on an
 > arm-linux-gnueabi machine, 0xa0000000 seems to be a good
 > choice: it's just under the stack and at the end of a large
 > area populated by shared libraries.
 > 
 > Tested with gcc-4.6/4.5/4.4 on arm-linux-gnueabi running
 > 2.6.36-rcN kernels.  Fixed all pch testsuite failures, with
 > no new regressions.
 > 
 > Ok for trunk/4.5/4.4?  (I don't havn svn write access.)
 > 
 > gcc/
 > 
 > 2010-10-26  Mikael Pettersson  <mikpe@it.uu.se>
 > 
 > 	PR pch/45979
 > 	* config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __ARM_EABI__.
 > 
 > --- gcc-4.6-20101009/gcc/config/host-linux.c.~1~	2009-02-20 16:20:38.000000000 +0100
 > +++ gcc-4.6-20101009/gcc/config/host-linux.c	2010-10-13 15:24:28.000000000 +0200
 > @@ -86,6 +86,8 @@
 >  # define TRY_EMPTY_VM_SPACE	0x60000000
 >  #elif defined(__mc68000__)
 >  # define TRY_EMPTY_VM_SPACE	0x40000000
 > +#elif defined(__ARM_EABI__)
 > +# define TRY_EMPTY_VM_SPACE	0xa0000000
 >  #else
 >  # define TRY_EMPTY_VM_SPACE	0
 >  #endif

Patch

--- gcc-4.6-20101009/gcc/config/host-linux.c.~1~	2009-02-20 16:20:38.000000000 +0100
+++ gcc-4.6-20101009/gcc/config/host-linux.c	2010-10-13 15:24:28.000000000 +0200
@@ -86,6 +86,8 @@ 
 # define TRY_EMPTY_VM_SPACE	0x60000000
 #elif defined(__mc68000__)
 # define TRY_EMPTY_VM_SPACE	0x40000000
+#elif defined(__ARM_EABI__)
+# define TRY_EMPTY_VM_SPACE	0xa0000000
 #else
 # define TRY_EMPTY_VM_SPACE	0
 #endif