precompiled header support
Gunther Nikl
gni@gecko.de
Tue May 11 07:55:00 GMT 2004
On Fri, May 07, 2004 at 11:22:40AM -0400, Ian Lance Taylor wrote:
> 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.
What is "fixed for a particular instance of cc1"? That the address is
always the same for a specific cc1 but might be different with another
cc1? However, that doesn't really matter in this case.
> 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.
Both approaches don't work with "my" host since the OS always loads
executables to random addresses. This is by design to not require a MMU.
An executable might have an relocation table if necessary to allow the
loader to adapt the program for the real address in memory.
> > 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.
Generating a precompiled header works :) Using it doesn't work. If I am
lucky I get "text segment moved". If I am not lucky the compiler crashes.
What I am after is: I want prevent other users on that host (if any) to
use a feature that doesn't work. I suppose they would try it regardless
of what documentation states.
Gunther
More information about the Gcc
mailing list