public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* PCH support on Solaris
@ 2003-04-02 18:33 Eric Botcazou
  2003-04-03  6:05 ` Geoff Keating
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Botcazou @ 2003-04-02 18:33 UTC (permalink / raw)
  To: Geoff Keating; +Cc: gcc

Hi Geoff,

PCH support doesn't currently work on Solaris because the mmap heuristics 
used in gt_pch_save and gt_pch_restore fails:

poog% gcc/xgcc -Bgcc common-1.h
mmi.preferred_base = ff220000
mmi.size = 56000
page_size = 2000
poog% rm common-1.h
poog% gcc/xgcc -Bgcc common-1.c
mmi.preferred_base = ff220000
mmi.size = 56000
mmi.offset = 6000
addr = ff226000
xgcc: Internal error: Segmentation Fault (program cc1)
Please submit a full bug report.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

In other words, Solaris appears to map the whole file, whatever offset you 
specify in the call to mmap, so that the address returned is

	addr = mmi.preferred_base + mmi.offset


The reporter of PR other/9830 proposes to force the address by passing 
MAP_FIXED to mmap; this works (all pch tests of the testsuite pass) but, if 
my interpretation is correct, this could fail if the pages before the forced 
address are for some reason unmappable.

The other solution is of course to pre-calculate mmi.offset and add it to 
mmi.preferred_base, but there is an obvious chicken-and-egg problem with the 
current code in ggc-common.c.

Hence two questions: which solution is the right one? If it is the second 
solution, is there any mean to easily pre-calculate mmi.offset or do we need 
to resort to re-playing the first part of the write operation?

Thanks in advance.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PCH support on Solaris
  2003-04-02 18:33 PCH support on Solaris Eric Botcazou
@ 2003-04-03  6:05 ` Geoff Keating
  2003-04-03  7:23   ` Eric Botcazou
  0 siblings, 1 reply; 5+ messages in thread
From: Geoff Keating @ 2003-04-03  6:05 UTC (permalink / raw)
  To: ebotcazou; +Cc: gcc

> From: Eric Botcazou <ebotcazou@libertysurf.fr>
> Date: Wed, 2 Apr 2003 19:39:48 +0200

> In other words, Solaris appears to map the whole file, whatever offset you 
> specify in the call to mmap, so that the address returned is
> 
> 	addr = mmi.preferred_base + mmi.offset
> 
> 
> The reporter of PR other/9830 proposes to force the address by passing 
> MAP_FIXED to mmap; this works (all pch tests of the testsuite pass) but, if 
> my interpretation is correct, this could fail if the pages before the forced 
> address are for some reason unmappable.

I think we discussed this more in the PR and the suggestion was to use
MAP_FIXED but to check that the area was safe to map into.  There's
sample code in the PR, I think, but it really needs someone with a
Solaris machine to do a proper patch using host-hooks.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PCH support on Solaris
  2003-04-03  6:05 ` Geoff Keating
@ 2003-04-03  7:23   ` Eric Botcazou
  2003-04-03  8:04     ` Geoff Keating
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Botcazou @ 2003-04-03  7:23 UTC (permalink / raw)
  To: Geoff Keating; +Cc: gcc

> I think we discussed this more in the PR and the suggestion was to use
> MAP_FIXED but to check that the area was safe to map into.  There's
> sample code in the PR, I think, but it really needs someone with a
> Solaris machine to do a proper patch using host-hooks.

This particular PR contains no discussion and no sample code. And I didn't 
find anything either in the other 6 PCH-related PRs reported by GNATS.

Could you point me to the discussion you are speaking of?

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PCH support on Solaris
  2003-04-03  7:23   ` Eric Botcazou
@ 2003-04-03  8:04     ` Geoff Keating
  2003-04-03  9:18       ` Eric Botcazou
  0 siblings, 1 reply; 5+ messages in thread
From: Geoff Keating @ 2003-04-03  8:04 UTC (permalink / raw)
  To: ebotcazou; +Cc: gcc

> From: Eric Botcazou <ebotcazou@libertysurf.fr>
> Date: Thu, 3 Apr 2003 08:24:40 +0200

> > I think we discussed this more in the PR and the suggestion was to use
> > MAP_FIXED but to check that the area was safe to map into.  There's
> > sample code in the PR, I think, but it really needs someone with a
> > Solaris machine to do a proper patch using host-hooks.
> 
> This particular PR contains no discussion and no sample code. And I didn't 
> find anything either in the other 6 PCH-related PRs reported by GNATS.
> 
> Could you point me to the discussion you are speaking of?

http://gcc.gnu.org/ml/gcc-bugs/2003-02/msg01348.html

I don't know why that didn't get into the PR.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PCH support on Solaris
  2003-04-03  8:04     ` Geoff Keating
@ 2003-04-03  9:18       ` Eric Botcazou
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Botcazou @ 2003-04-03  9:18 UTC (permalink / raw)
  To: Geoff Keating; +Cc: gcc

> http://gcc.gnu.org/ml/gcc-bugs/2003-02/msg01348.html

Ah! ok, thanks. I'll start experimenting with the code.

> I don't know why that didn't get into the PR.

<gcc-gnats@gcc.gnu.org> is not in the Cc field.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-04-03  7:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-02 18:33 PCH support on Solaris Eric Botcazou
2003-04-03  6:05 ` Geoff Keating
2003-04-03  7:23   ` Eric Botcazou
2003-04-03  8:04     ` Geoff Keating
2003-04-03  9:18       ` Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).