SOLVED Re: GCC pch failures
Greg Schafer
diy-linux-dev@diy-linux.org
Wed, 20 Jul 2005 11:03:05 +1000
On Tue, Jul 19, 2005 at 11:16:22PM +0100, Haren Visavadia wrote:
> --- Greg Schafer wrote:
> > This is with
> > gcc-3.4.4. gcc-4.0.1 appears to be unaffected. A
> > bunch of GCC pch tests are
> > failing like this:
> >
> > FAIL: gcc.dg/pch/common-1.c -O0 (test for excess
> > errors)
<snip>
> Confirm.
>
> I have the gcc 3.4.4 built with the kernel 2.6.11.12
> and kernel 2.6.12. The problem appears wth kernel
> 2.6.12 and not with kernel 2.6.11.12.
>
> It's definitely a kernel issue.
Ok, thanks for confirming.
I've investigated and found out what the problem is. It's the address space
randomization patches that went into 2.6.12. AFAICT, these patches
originated from the RH Exec Shield stuff.
Essentially, the PCH implementation in GCC-3.4.x is incompatible with
address space randomization. However, it should be fixed in GCC-4.x. More
information here:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14206
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14400
http://lwn.net/Articles/140002/
http://lwn.net/Articles/121845/
A workaround is to disable address space randomization. This can be done
via sysctl (and sysctl.conf) or simply like this:
echo 0 > /proc/sys/kernel/randomize_va_space
I'll whack an appropriate note into the Ref' Build docco as this will surely
trip up many folks.
Regards
Greg