This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PCH support on Solaris


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]