http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47430
Summary: [4.6 Regression] Random PCH related bootstrap failures on powerpc64-linux Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: pch AssignedTo: unassig...@gcc.gnu.org ReportedBy: ja...@gcc.gnu.org CC: b...@gcc.gnu.org, pa...@gcc.gnu.org I saw during the weekend two bootstrap failures in libstdc++. The problem seems to be that powerpc64 uses very large pages (64KB), address space randomization and the fact that for building stdtr1c++.h.gch and extc++.h.gch uses stdc++.h.gch. When building e.g. stdtr1c++.h.gch, stdc++.h.gch already likely exists and thus it first mmaps stdc++.h.gch at the desired address, which is likely TRY_EMPTY_VM_SPACE (OT, for __powerpc__ && __LP64__, shouldn't it use some larger value, say 0x6000000000ULL ?), thus when attempting to determine best VM slot for stdtr1c++.h.gch, that slot is already taken by stdc++.h.gch and thus can't be used. While there is some code to attempt to handle address space randomization, perhaps 32MB works well for 4KB pages, but is too small for larger pages or something, but it certainly fails from time to time on ppc64 and some shared library is mmapped at that point. Potential ways how to fix this, one or more of: 1) in host-linux.c define more than one TRY_EMPTY_VM_SPACE value for each OS, and if mmap at TRY_EMPTY_VM_SPACE fails, try TRY_EMPTY_VM_SPACE2 which is say 0x70000000 for most 32-bit hosts and some GB appart from TRY_EMPTY_VM_SPACE for 64-bit hosts. 2) make sure other PCH is not read during compilation that is writing PCH 3) change the logic for address space randomization in host-linux.c, use larger buffer if page size is > 4KB 4) change libstdc++ makefiles to make sure stdc++.h.gch does not exist when building the other *.gch files, use explicit ordering in the Makefile that it is first rm -f'ed, then the other gch files built, then stdc++.h.gch built Preferences?