On 1/16/2026 12:14 AM, Richard Biener wrote:
On Thu, Jan 15, 2026 at 9:51 PM Rainer Orth <[email protected]>
wrote:
On FreeBSD/amd64, more than 700 tests FAIL like
FAIL: gcc.dg/pch/common-1.c -O0 -g -I. -Dwith_PCH (test for excess errors)
Excess errors:
gcc/testsuite/gcc.dg/pch/common-1.c:1: sorry, unimplemented: PCH allocation
failure
This can easily be fixed by implementing the
host_hooks.gt_pch_get_address hook. The code is shamelessly stolen from
the openbsd implementation, only changing the names and omitting the
hppa and i386 code. The former isn't supported by FreeBSD at all AFAIK,
while the latter has just been removed in FreeBSD 15.0.
Bootstrapped without regressions on x86_64-unknown-freebsd14.3: all PCH
failures are gone.
Ok for trunk?
OK. Is there possibly a PR about this?
?!? I thought I recently pushed a patch to fix PCH for NetBSD and
OpenBSD from Kalvis:
commit 1a2b5eeb5d24a44db9cb757906bd06912af15379
Author: Kalvis Duckmanton <[email protected]>
Date: Sun Jan 4 10:54:48 2026 -0700
[PATCH v2]: pch, target: update host hooks for NetBSD and OpenBSD
The PCH use_address hooks for NetBSD hosts have not yet been
updated to allow
compiled headers to be loaded at an address different from their
preferred
address.
This change updates host-netbsd.cc:netbsd_gt_pch_use_address()
thus: if a
compiled header cannot be mapped at its preferred address, a region
of memory
is allocated and the base address of this region is passed back to
the caller
(ggc-common.cc:gt_pch_restore() I believe). Note that in this case
the return
value is 0, allowing gt_pch_restore() to load the header. In this
respect the
behaviour is slightly different from that of the use_address hook
for other
hosts (e.g. Linux).
This change against GCC 15.2.0 builds on the work in pch/71934 (and
target/58937)
I missed FreeBSD obviously. But it would certainly be nice if all three
impementations shared the same code.
jeff