This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: other/9830: [pch] not working on Solaris 9
- From: Geoff Keating <geoffk at geoffk dot org>
- To: mteske at csksoftware dot com
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: 24 Feb 2003 12:12:38 -0800
- Subject: Re: other/9830: [pch] not working on Solaris 9
- References: <20030224132612.26862.qmail__21143.0731149905$1046093758@sources.redhat.com>
mteske at csksoftware dot 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 at geoffk dot org>