but, I think setting `NOSTATICLIB=' should've worked too. Can you try this:
(WARNING: haven't done a full build, just `src/tests/lib/libpthread/weak/')
---START patch---
--- src/share/mk/bsd.lib.mk.orig 2025-09-20 03:56:03.753948411 +0000
+++ src/share/mk/bsd.lib.mk 2025-10-11 05:32:17.192792877 +0000
@@ -463,7 +463,9 @@
.endif
.if ${MKDEBUGLIB} != "no"
+. if ${MAKESTATICLIB} != "no"
_LIBS+=${_LIB_g.a}
+. endif
GOBJS+=${OBJS:.o=.go}
DEBUGFLAGS?=-DDEBUG
.endif
--- src/tests/lib/libpthread/weak/lib/Makefile.orig 2025-10-06
13:16:44.000000000 +0000
+++ src/tests/lib/libpthread/weak/lib/Makefile 2025-10-11
05:29:30.042531183 +0000
@@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.1 2025/10/06 13:16:44 riastradh Exp $
#
-MKPROFILE= no # XXX hack -- should be NOPROFILE
+NOPROFILE= # defined
NOLINT= # defined
NOMAN= # defined
NOSTATICLIB= # defined
---END patch---