On 26/11/25 11:15, Jeff Law wrote:


On 11/18/25 7:41 PM, Kalvis Duckmanton wrote:
Hi!

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)

ChangeLog:

     * gcc/config/host-netbsd.cc (netbsd_gt_pch_use_address): update for pch/71934

It appears that OpenBSD has the exact same implementation of gt_pch_use_address; is there any reason to believe we shouldn't be doing exactly the same thing for that implementation?

I don't think there is any such reason, but I wouldn't like to speak for the OpenBSD development team.

Generally it looks sensible.  So my preference would be to fix both NetBSD and OpenBSD at the same time, assuming we think both need the same fix.

Ok.  I will investigate a bit further and try to confirm that the proposed change will also work for OpenBSD.

(I should also note at this point, for completeness, that I don't have commit access to GCC :) )

many thanks!

kalvis

Reply via email to