other/9830: [pch] not working on Solaris 9
Geoff Keating
geoffk@geoffk.org
Mon Feb 24 20:12:00 GMT 2003
mteske@csksoftware.com writes:
> Use this patch. One might have to check for solaris, though, since I don't know if MAP_FIXED is a generic mmap option.
>
>
> *** ggc-common.c-orig Mon Feb 24 11:47:34 2003
> --- ggc-common.c Mon Feb 24 14:23:31 2003
> ***************
> *** 583,589 ****
>
> #if HAVE_MMAP_FILE
> addr = mmap (mmi.preferred_base, mmi.size,
> ! PROT_READ | PROT_WRITE, MAP_PRIVATE,
> fileno (f), mmi.offset);
> #else
> addr = (void *)-1;
> --- 583,589 ----
>
> #if HAVE_MMAP_FILE
> addr = mmap (mmi.preferred_base, mmi.size,
> ! PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED ,
> fileno (f), mmi.offset);
> #else
> addr = (void *)-1;
This patch is unsafe in general, because it might map the PCH file
over some other memory that's in use (like a shared object).
Can you work out why Solaris isn't mapping the PCH at the requested address?
--
- Geoffrey Keating <geoffk@geoffk.org>
More information about the Gcc-bugs
mailing list