head 1.1; access; symbols pkgsrc-2026Q3:1.1.0.2 pkgsrc-2026Q3-base:1.1; locks; strict; comment @ * @; 1.1 date 2026.09.13.08.38.04; author bsiegert; state Exp; branches; next ; commitid fMHDXc6458kLcrVG; desc @@ 1.1 log @go14: fix build on FreeBSD with ASLR enabled The package lang/go14 used for bootstrapping Go fails to build on FreeBSD with ASLR enabled. Fix by Sean Hickey in PR pkg/59620. @ text @$NetBSD$ Fix FreeBSD address space conflict when ASLR is enabled. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235735 --- src/runtime/mem_freebsd.c.orig 2015-09-23 04:37:37.000000000 +0000 +++ src/runtime/mem_freebsd.c @@@@ -73,6 +73,11 @@@@ runtime·SysReserve(void *v, uintptr n, return p; } +enum +{ + MAP_EXCL = 0x4000 +}; + void runtime·SysMap(void *v, uintptr n, bool reserved, uint64 *stat) { @@@@ -82,7 +87,7 @@@@ runtime·SysMap(void *v, uintptr n, bool // On 64-bit, we don't actually have v reserved, so tread carefully. if(!reserved) { - p = runtime·mmap(v, n, PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0); + p = runtime·mmap(v, n, PROT_READ|PROT_WRITE, MAP_ANON|MAP_FIXED|MAP_EXCL|MAP_PRIVATE, -1, 0); if(p == (void*)ENOMEM) runtime·throw("runtime: out of memory"); if(p != v) { @