NetBSD Problem Report #60797
From zakinko@snowrabbit.org Sat Sep 26 10:43:43 2026
Return-Path: <zakinko@snowrabbit.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits)
client-signature RSA-PSS (2048 bits))
(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 669911A923C
for <gnats-bugs@gnats.NetBSD.org>; Sat, 26 Sep 2026 10:43:43 +0000 (UTC)
Message-Id: <20260926104341.8249EC92F0@bambi.snowrabbit.org>
Date: Sat, 26 Sep 2026 19:43:41 +0900 (JST)
From: zakinko@snowrabbit.org
Reply-To: zakinko@snowrabbit.org
To: gnats-bugs@NetBSD.org
Cc: zakinko@snowrabbit.org
Subject: devel/ncurses: configure rewrites /var/run/ld.so.hints on OpenBSD
X-Send-Pr-Version: 3.95
X-From4GNATS: "zakinko@snowrabbit.org via gnats" <gnats-admin@NetBSD.org>
>Number: 60797
>Category: pkg
>Synopsis: devel/ncurses: configure rewrites /var/run/ld.so.hints on OpenBSD
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Sep 26 10:45:01 +0000 2026
>Originator: Showta Ishizaki
>Release: pkgsrc-current
>Organization:
>Environment:
System: OpenBSD 7.9 amd64
Architecture: x86_64
Machine: amd64
>Description:
Building devel/ncurses as root on OpenBSD leaves the system
unable to run anything from /usr/local:
ld.so: rsync: can't load library 'liblz4.so.3.3'
ld.so: python3: can't load library 'libintl.so.8.2'
CF_LD_SEARCHPATH in configure tries four things in turn, and on
OpenBSD the first three give nothing:
ld --verbose LLD 19.1.7, no SEARCH_DIR lines
ldconfig -NX -v "ldconfig: unknown option -- N"
ldconfig -v (first sed) lists "Adding /usr/lib/..." lines,
which that sed does not pick up
ldconfig -v (second sed) the branch written for OpenBSD;
yields /usr/lib
On Linux ldconfig -v lists directories. On OpenBSD, with no
directory arguments, it rebuilds /var/run/ld.so.hints from the
default /usr/lib alone, dropping /usr/local/lib and
/usr/X11R6/lib that rc put there at boot -- and the macro runs
it twice. The probe's own answer is /usr/lib either way.
I found it because after a pkgsrc build the vmactions CI's
rsync in the VM could no longer start; ldconfig -r showed
"search directories: /usr/lib". Anyone who builds ncurses, or
anything that pulls it in, as root on OpenBSD gets the same
until the next reboot.
>How-To-Repeat:
On OpenBSD, as root: ldconfig -r; cd devel/ncurses && make
configure; ldconfig -r. The second listing has only /usr/lib.
>Fix:
Give configure the answer it would arrive at anyway and skip
the probe:
CONFIGURE_ENV.OpenBSD+= cf_cv_ld_searchpath=/usr/lib
Diff against pkgsrc-current of 2026-09-26 (Makefile still
1.124); it applies with no fuzz.
Measured on OpenBSD 7.8/amd64, 7.9/amd64 and 7.9/arm64. Each
box ran make configure three times -- with the line, without
it, with it again -- reading ldconfig -r after each and putting
the hints back by hand before each run. With the line the
hints keep all three directories; without it they come back as
/usr/lib alone; with the line again they stay at three. The
line does not repair a broken hints file, it only stops
configure from breaking it.
The middle step is there on purpose: without it, "the hints
survived" and "this box never breaks" look identical.
The order the three appear in is not the same everywhere -- rc
and a hand-run ldconfig put them in different orders -- so what
is worth reading is whether /usr/local/lib is there at all.
configure reaches the same answer either way -- "checking for
linker search path... /usr/lib" with the line absent, and the
cached /usr/lib with it present -- so this changes the probe's
side effect, not how ncurses is built.
The probe itself is upstream's; I will report it there too.
--- devel/ncurses/Makefile.orig
+++ devel/ncurses/Makefile
@@ -44,6 +44,13 @@
CONFIGURE_ARGS.Darwin+= --disable-mixed-case
CONFIGURE_ARGS.SunOS+= --disable-const
+# configure probes the linker search path by running "ldconfig -v". On
+# OpenBSD that does not list anything, it rewrites /var/run/ld.so.hints
+# with only /usr/lib when run as root, and every binary under /usr/local
+# then fails to load its libraries. The answer it arrives at there is
+# /usr/lib anyway, so give it that and skip the probe.
+CONFIGURE_ENV.OpenBSD+= cf_cv_ld_searchpath=/usr/lib
+
CONFIGURE_ARGS.UnixWare+= --disable-libtool-version
# QNX libc is missing some functions.
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.