Summary: | precompiled headers breakage on 2.6.36-rc Linux/ARM kernels | ||
---|---|---|---|
Product: | gcc | Reporter: | Mikael Pettersson <mikpelinux> |
Component: | pch | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ibolton, steven |
Priority: | P3 | Keywords: | patch |
Version: | 4.4.5 | ||
Target Milestone: | 4.7.0 | ||
Host: | Target: | arm | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2011-01-07 11:49:35 | |
Attachments: | define TRY_EMPTY_VM_SPACE for ARM |
Description
Mikael Pettersson
2010-10-12 08:21:23 UTC
Most likely when the linux arm kernel decided to randomize the heap. I assume other Linux archs already randomize the heap. If so, why would that cause PCH failures on ARM? Could it be because there's no TRY_EMPTY_VM_SPACE definition in gcc/config/host-linux.c for ARM? (In reply to comment #2) > I assume other Linux archs already randomize the heap. Could it be because there's no TRY_EMPTY_VM_SPACE definition in gcc/config/host-linux.c for ARM? yes, a definition for TRY_EMPTY_VM_SPACE is needed for ARM. I just went through this for MIPS but I have not pushed it because I don't currently have a correct copyright assignment on file. Ok. I'll cook something up for TRY_EMPTY_VM_SPACE on ARM. (In reply to comment #1) > Most likely when the linux arm kernel decided to randomize the heap. Confirmed. Bisection of the kernel identified: From: Nicolas Pitre <nico@fluxnic.net> Date: Tue, 15 Jun 2010 01:16:19 +0000 (-0400) Subject: [ARM] add address randomization to mmap() X-Git-Tag: v2.6.36-rc1~591^2^2~6^2~2 X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=cc92c28b2db5b406657ecc05235d4ca4e222ae34 [ARM] add address randomization to mmap() Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> --- diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c index f5abc51..4f5b396 100644 --- a/arch/arm/mm/mmap.c +++ b/arch/arm/mm/mmap.c @@ -7,6 +7,7 @@ #include <linux/shm.h> #include <linux/sched.h> #include <linux/io.h> +#include <linux/random.h> #include <asm/cputype.h> #include <asm/system.h> @@ -80,6 +81,9 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, start_addr = addr = TASK_UNMAPPED_BASE; mm->cached_hole_size = 0; } + /* 8 bits of randomness in 20 address space bits */ + if (current->flags & PF_RANDOMIZE) + addr += (get_random_int() % (1 << 8)) << PAGE_SHIFT; full_search: if (do_align) as the cause of this regression. Still, I think the kernel is Ok and it's really gcc's pch implementation which is broken. Created attachment 22030 [details]
define TRY_EMPTY_VM_SPACE for ARM
Preliminary patch which defines TRY_EMPTY_VM_SPACE for ARM and fixes the PCH regressions in a PCH-only test run. I'll submit it after some more testing.
The patch tested ok and has now been submitted: http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02252.html Please can you confirm that this is now fixed in trunk, Mikael. And has it been backported? (In reply to comment #8) > Please can you confirm that this is now fixed in trunk, Mikael. No, it has not been fixed on trunk. > And has it been backported? Not in the official gcc repository. I do use the fix in my private 4.4 and 4.5 based compilers. Author: ramana Date: Thu May 5 09:52:12 2011 New Revision: 173421 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173421 Log: For Michael Hope. 2011-05-05 Michael Hope <michael.hope@linaro.org> PR pch/45979 * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __ARM_EABI__ hosts. Modified: trunk/gcc/ChangeLog trunk/gcc/config/host-linux.c Fixed. Author: michaelh Date: Fri Mar 23 02:19:46 2012 New Revision: 185724 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=185724 Log: 2012-03-16 Michael Hope <michael.hope@linaro.org> Backport from mainline 2011-05-05 Michael Hope <michael.hope@linaro.org> PR pch/45979 * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for __ARM_EABI__ hosts. Modified: branches/gcc-4_6-branch/gcc/ChangeLog branches/gcc-4_6-branch/gcc/config/host-linux.c |