This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: precompiled header support
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Gunther Nikl <gni at gecko dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: 07 May 2004 11:22:40 -0400
- Subject: Re: precompiled header support
- References: <20040507122627.GA71530@lorien.int.gecko.de>
Gunther Nikl <gni@gecko.de> writes:
> What host capabilites are required to use precompiled headers? The sources
> seem to imply that mmap() is required to load a PCH to fixed address. What
> happens if a host doesn't support mmap? To which address the PCH will be
> loaded?
Really what is required is that the host provide a fixed address at
which a PCH can be loaded. This address must be fixed for a
particular instance of cc1, not necessarily fixed in general.
On some hosts the natural way to implement this is to use mmap with a
fixed address. See config/host-linux.c in mainline. On at least one
host, the natural way to implement this is to define a large array
within gcc1 itself. See config/rs6000/host-darwin.c.
> Is it possible to disable generating/using precompiled headers for hosts
> that don't support it?
Well, nobody requires you to generate a precompiled header.
At present there is no simple way to detect whether precompiled
headers will work reliably on your host. If the mainline version of
the gcc.dg/pch tests in the testsuite pass on your host, then I
believe that precompiled headers are fully reliable.
Ian