This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: other/9830: [pch] not working on Solaris 9


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>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]