This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PCH support on Solaris
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: "Bonzini" <bonzini at gnu dot org>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 3 Apr 2003 10:12:52 +0200
- Subject: Re: PCH support on Solaris
- References: <004b01c2f996$13a890a0$7ddc1d97@bonz>
> A solution might be to do an anonymous mmap to find the address
>
> #ifndef MAP_NORESERVE
> #define MAP_NORESERVE 0
> #endif
>
> guess = mmap (mmi.preferred_base, mmi.size,
> PROT_NONE, MAP_PRIVATE|MAP_NORESERVE|MAP_ANON,
> -1, 0);
>
> addr = mmap (guess, mmi.size, PROT_READ, MAP_FIXED|MAP_SHARED,
> fd, mmi.offset);
Which address are you talking about? According to my experiments, the value
of addr returned by
addr = mmap (mmi.preferred_base, mmi.size, PROT_READ, MAP_PRIVATE
fd, mmi.offset);
is perfectly predictable on Solaris: it's
addr = mmi.preferred_base + mmi.offset
The problem is that the heuristics expects mmi.preferred_base, so we need
either to change the heuristics or to force the address with MAP_FIXED.
--
Eric Botcazou