This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: precompiled header support
On Tue, May 11, 2004 at 06:47:19AM -0400, Ian Lance Taylor wrote:
> Gunther Nikl <gni@gecko.de> writes:
> >
> > 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.
>
> That's a tough one. Are the addresses truly random across the whole
> memory space? Is there any area of memory which you can reasonably
> expect will not contain any code? If not, then I don't think PCH will
> work for you. Tell Geoff Keating--he has argued that every system has
> some address available.
This was answered in other mails of this thread.
> > 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.
>
> Create a host-amiga.c file, mention it in config.host, and define
> HOST_HOOKS_GT_PCH_GET_ADDRESS to a function which simply calls
> error().
That looks like a good solution. I just noticed that the PCH support in
3.4.0 and mainline is different. Mainline will probably fail because
default_gt_pch_use_address would return -1. Hm, I suppose taht function
should simply return -1 and not allocate any memory. Its highly unlikely
that base and addr will ever match with the default_gt_pch_get_address.
Gunther