NetBSD Problem Report #61079
From wiz@netbsd.org Wed Nov 25 19:57:28 2026
Return-Path: <wiz@netbsd.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 134CF1A923B
for <gnats-bugs@gnats.NetBSD.org>; Wed, 25 Nov 2026 19:57:28 +0000 (UTC)
Message-Id: <20261125195727.9C92A84E88@mail.netbsd.org>
Date: Wed, 25 Nov 2026 19:57:27 +0000 (UTC)
From: wiz@NetBSD.org
Reply-To: wiz@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: ld compat linker warnings considered harmful
X-Send-Pr-Version: 3.95
X-From4GNATS: "wiz@NetBSD.org via gnats" <gnats-admin@NetBSD.org>
>Number: 61079
>Category: toolchain
>Synopsis: ld compat linker warnings considered harmful
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: toolchain-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Nov 25 20:00:00 +0000 2026
>Last-Modified: Fri Nov 27 17:20:01 +0000 2026
>Originator: Thomas Klausner
>Release: NetBSD 11.99.11
>Organization:
>Environment:
Architecture: x86_64
Machine: amd64
>Description:
For library function renaming to work, NetBSD uses header macros to
use the latest version of a function, so that the old symbol still
stays available for programs that were linked against the previous
version of the function.
There is also a linker warning so that you do not use the old
functions by accident, because you forgot including the header, e.g.:
ld: /usr/lib/libm.so.0: warning: warning: reference to compatibility cabs()
The (known) problem is that this linker warning also triggers when it
shouldn't, when libraries are pulled in indirectly and the functions
not even used by the program that (indirectly) links against them.
meson by default enables fatal linker warnings, so this breaks
builds.
I've discussed this on the mailing lists twice, without results,
so let's file it so it's at least a well-documented problem.
https://mail-index.netbsd.org/current-users/2026/02/24/msg047412.html
https://mail-index.netbsd.org/tech-toolchain/2026/08/18/msg004873.html
>How-To-Repeat:
In short, a program just doing 'exit' is linked against libgssapi (or
libroken, both work), and the linker complains:
# gcc -o a a.c -lgssapi
ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility login_getpwclass(); include <login_cap.h> for correct reference
ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility pw_scan(); include <pwd.h> to generate correct reference
ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility loginx(); include <util.h> to generate correct reference
ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility parsedate(); include <util.h> for correct reference
ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility pw_copyx(); include <util.h> to generate correct reference
ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility pw_getpwconf(); include <pwd.h> to generate correct reference
ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility login(); include <util.h> to generate correct reference
ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility setusercontext(); include <login_cap.h> for correct reference
ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility pw_copy(); include <util.h> to generate correct reference
No function from gssapi (or roken) is called, so nothing can call
libutil and need the compat header.
a.c
--- begin ---
#include <stdlib.h>
int main() {
exit(0);
}
--- end ---
Makefile
--- begin ---
a:
gcc -o a a.c -lgssapi
b:
gcc -o b a.c -lroken
--- end ---
>Fix:
Not known.
RVP pointed out that --no-copy-dt-needed-entries seems to work around this:
https://mail-index.netbsd.org/tech-toolchain/2026/09/18/msg004903.html
but I don't know if that's an appropriate solution or not.
>Audit-Trail:
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: toolchain-manager@netbsd.org,
gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: toolchain/61079: ld compat linker warnings considered harmful
Date: Wed, 25 Nov 2026 16:10:01 -0500
The reason the NetBSD defaults to copy-dt-needed is pkgsrc. What =
copy-dt-needed does
is if your program links against libcurses.so and libcurses.so has a =
DT_NEEDED for libterminfo.so=20
and your program references a symbol from libterminfo.so like setupterm:
with copy-dt-needed; the program will resolve the symbol from =
libterminfo.so
without copy-dt-needed: the program will fail to link unless =
-lterminfo is added to the link line
Now libncurses.so includes the terminfo functions in it, but our =
libcurses.so does not, so many
pkgsrc packages will break if we change the default to no-copy-dt-needed =
like linux did.
This is the most popular example for DT_NEEDED, another is libkrb5.so =
and libroken.so.
We have choices:
- keep the status quo and only fix what's broken, living with the bogus =
linker warnings
- take the plunge, make no-copy-dt-needed the default,=20
- and fix whatever breaks in pkgsrc
- or make our libraries more compatible with linux by =
incorporating libterminfo in libcurses etc.
Long term we should be going with aligning with the rest of the world =
and turning off copy-dt-needed.
This unfortunately means maintaining more patches in pkgsrc, and =
fighting with upstreams to accept them.
I don't think that compatibility is a good reason to merge libraries, =
unless standards mandate it.
This also means that more programs will not work out-of-the box for =
NetBSD.
christos=
From: Thomas Klausner <wiz@gatalith.at>
To: Christos Zoulas <christos@zoulas.com>
Cc: NetBSD bugtracking <gnats-bugs@netbsd.org>
Subject: Re: toolchain/61079: ld compat linker warnings considered harmful
Date: Wed, 25 Nov 2026 22:14:46 +0100
On Wed, Nov 25, 2026 at 04:10:01PM +0100, Christos Zoulas wrote:
> - take the plunge, make no-copy-dt-needed the default,
> - and fix whatever breaks in pkgsrc
I'm for this. Can you come up with a patch for src so I can try in a
limited bulk build how much would break?
I think, since Linux also switched to that default, that nowadays it
should be easier than when the hack was introduced.
Thomas
From: Christos Zoulas <christos@zoulas.com>
To: Thomas Klausner <wiz@gatalith.at>
Cc: NetBSD bugtracking <gnats-bugs@netbsd.org>
Subject: Re: toolchain/61079: ld compat linker warnings considered harmful
Date: Wed, 25 Nov 2026 17:09:20 -0500
Undo this patch for every arch (remove the XXX line and the next), for =
every arch, for aarch64 this is:
--- ld/emultempl/aarch64elf.em 11 Feb 2026 19:50:29 -0000 1.1.1.10
+++ ld/emultempl/aarch64elf.em 11 Feb 2026 20:15:02 -0000 1.12
@@ -57,6 +57,8 @@ gld${EMULATION_NAME}_before_parse (void)
ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
input_flags.dynamic =3D ${DYNAMIC_LINK-true};
+ /* XXX For NetBSD, ----copy-dt-needed-entries by default. */
+ input_flags.add_DT_NEEDED_for_dynamic =3D true;
config.has_shared =3D `if test -n "$GENERATE_SHLIB_SCRIPT" ; then =
echo true ; e
lse echo false ; fi`; =20
config.separate_code =3D `if test "x${SEPARATE_CODE}" =3D xyes ; then =
echo true ;
else echo false ; fi`; =20
link_info.check_relocs_after_open_input =3D true;
> On Nov 25, 2026, at 4:14=E2=80=AFPM, Thomas Klausner <wiz@gatalith.at> =
wrote:
>=20
> On Wed, Nov 25, 2026 at 04:10:01PM +0100, Christos Zoulas wrote:
>> - take the plunge, make no-copy-dt-needed the default,=20
>> - and fix whatever breaks in pkgsrc
>=20
> I'm for this. Can you come up with a patch for src so I can try in a
> limited bulk build how much would break?
As I mentioned the differences between curses and ncurses and kerberos
bite the most.=20
>=20
> I think, since Linux also switched to that default, that nowadays it
> should be easier than when the hack was introduced.
> Thomas
christos=
From: Thomas Klausner <wiz@gatalith.at>
To: Christos Zoulas <christos@zoulas.com>
Cc: NetBSD bugtracking <gnats-bugs@netbsd.org>
Subject: Re: toolchain/61079: ld compat linker warnings considered harmful
Date: Wed, 25 Nov 2026 23:22:09 +0100
--j3bfm3o2ubrhhlk5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Wed, Nov 25, 2026 at 05:09:20PM +0100, Christos Zoulas wrote:
> Undo this patch for every arch (remove the XXX line and the next), for every arch, for aarch64 this is:
There's fewer of these than I expected, see attached.
Thomas
--j3bfm3o2ubrhhlk5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ld.diff"
Index: aarch64elf.em
===================================================================
RCS file: /cvsroot/src/external/gpl3/binutils/dist/ld/emultempl/aarch64elf.em,v
retrieving revision 1.12
diff -u -r1.12 aarch64elf.em
--- aarch64elf.em 11 Feb 2026 20:15:02 -0000 1.12
+++ aarch64elf.em 25 Nov 2026 22:21:35 -0000
@@ -57,8 +57,6 @@
ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
input_flags.dynamic = ${DYNAMIC_LINK-true};
- /* XXX For NetBSD, ----copy-dt-needed-entries by default. */
- input_flags.add_DT_NEEDED_for_dynamic = true;
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`;
link_info.check_relocs_after_open_input = true;
Index: armelf.em
===================================================================
RCS file: /cvsroot/src/external/gpl3/binutils/dist/ld/emultempl/armelf.em,v
retrieving revision 1.12
diff -u -r1.12 armelf.em
--- armelf.em 11 Feb 2026 20:15:02 -0000 1.12
+++ armelf.em 25 Nov 2026 22:21:36 -0000
@@ -57,8 +57,6 @@
ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
input_flags.dynamic = ${DYNAMIC_LINK-true};
- /* XXX For NetBSD, ----copy-dt-needed-entries by default. */
- input_flags.add_DT_NEEDED_for_dynamic = true;
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`;
link_info.check_relocs_after_open_input = true;
Index: elf.em
===================================================================
RCS file: /cvsroot/src/external/gpl3/binutils/dist/ld/emultempl/elf.em,v
retrieving revision 1.7
diff -u -r1.7 elf.em
--- elf.em 11 Feb 2026 20:15:02 -0000 1.7
+++ elf.em 25 Nov 2026 22:21:36 -0000
@@ -82,8 +82,6 @@
{
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
input_flags.dynamic = ${DYNAMIC_LINK-true};
- /* XXX For NetBSD, ----copy-dt-needed-entries by default. */
- input_flags.add_DT_NEEDED_for_dynamic = true;
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo true ; else echo false ; fi`;
link_info.check_relocs_after_open_input = true;
--j3bfm3o2ubrhhlk5--
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: toolchain-manager@netbsd.org,
gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org,
"wiz@netbsd.org" <wiz@NetBSD.org>
Subject: Re: toolchain/61079: ld compat linker warnings considered harmful
Date: Wed, 25 Nov 2026 17:27:08 -0500
Probably the arm ones are not needed then since this is done centrally.
I mean you need to remove them but they probably a no-op on HEAD.
christos
From: RVP <rvp@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: toolchain/61079: ld compat linker warnings considered harmful
Date: Wed, 25 Nov 2026 22:27:25 +0000 (UTC)
On Wed, 25 Nov 2026, Thomas Klausner via gnats wrote:
> On Wed, Nov 25, 2026 at 04:10:01PM +0100, Christos Zoulas wrote:
> > - take the plunge, make no-copy-dt-needed the default,
> > - and fix whatever breaks in pkgsrc
>
> I'm for this. Can you come up with a patch for src so I can try in a
> limited bulk build how much would break?
>
Revert this:
https://github.com/NetBSD/src/commit/d138d9f7e9bad645835c789d42405d05fb3dd84b
See PR lib/57615 for how Linux and FreeBSD handle this same problem: linker
scripts for the libcurses.so file:
Linux:
```
$ cat /usr/lib/x86_64-linux-gnu/libncurses.so
INPUT(libncurses.so.6 -ltinfo)
```
FreeBSD:
```
$ cat /usr/lib/libncursesw.so
INPUT(/lib/libncursesw.so.9 AS_NEEDED(-ltinfow))
```
-RVP
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: toolchain/61079: ld compat linker warnings considered harmful
Date: Wed, 25 Nov 2026 22:49:09 +0000
On Wed, Nov 25, 2026 at 08:00:00PM +0000, wiz@NetBSD.org via gnats wrote:
> ld: /usr/lib/libm.so.0: warning: warning: reference to compatibility cabs()
As I noted the last time this came up on tech-pkg, often (in fact, as
best as I can recall, always) when I've investigated these they turn
out to be real problems with missing includes.
> In short, a program just doing 'exit' is linked against libgssapi (or
> libroken, both work), and the linker complains:
>
> # gcc -o a a.c -lgssapi
> ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility login_getpwclass(); include <login_cap.h> for correct reference
What is generating the reference to the obsolete login_getpwclass
symbol? Are we sure that libgssapi was built correctly? If it wasn't,
that should be fixed.
Unless the linker is making this reference up on its own, it seems
like mucking with which libraries are pulled in by copying or not
copying DT_NEEDED entries is a bandaid. Which is not to say that we
shouldn't fix this if it's broken.
> RVP pointed out that --no-copy-dt-needed-entries seems to work around this:
>
> https://mail-index.netbsd.org/tech-toolchain/2026/09/18/msg004903.html
>
> but I don't know if that's an appropriate solution or not.
I'd also got as far as discovering that the spurious warnings go away
if you disable the gcc LTO plugin.
--
David A. Holland
dholland@netbsd.org
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: toolchain/61079: ld compat linker warnings considered harmful
Date: Wed, 25 Nov 2026 23:08:39 +0000
On Wed, Nov 25, 2026 at 10:50:01PM +0000, David Holland via gnats wrote:
> > # gcc -o a a.c -lgssapi
> > ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility login_getpwclass(); include <login_cap.h> for correct reference
>
> What is generating the reference to the obsolete login_getpwclass
> symbol? Are we sure that libgssapi was built correctly? If it wasn't,
> that should be fixed.
>
> Unless the linker is making this reference up on its own
...which apparently it is. There are some uses of login_getpwclass in
the tree (though none in kerberos), but the symbol "pw_copyx" that
it's also complaining about doesn't exist in base outside of libutil.
--
David A. Holland
dholland@netbsd.org
From: Taylor R Campbell <riastradh@NetBSD.org>
To: Thomas Klausner <wiz@NetBSD.org>
Cc: gnats-bugs@NetBSD.org, netbsd-bugs@NetBSD.org
Subject: Re: toolchain/61079: ld compat linker warnings considered harmful
Date: Thu, 26 Nov 2026 00:42:15 +0000
> Date: Wed, 25 Nov 2026 20:00:00 +0000 (UTC)
> From: "wiz@NetBSD.org via gnats" <gnats-admin@NetBSD.org>
>=20
> The (known) problem is that this linker warning also triggers when it
> shouldn't, when libraries are pulled in indirectly and the functions
> not even used by the program that (indirectly) links against them.
Someone should really track down why ld(1) issues these warnings when
there is no actual reference to the symbols in question!
> RVP pointed out that --no-copy-dt-needed-entries seems to work around thi=
s:
>=20
> https://mail-index.netbsd.org/tech-toolchain/2026/09/18/msg004903.html
>=20
> but I don't know if that's an appropriate solution or not.
This is kind of a tangent and a much wider issue. I suspect
--no-copy-dt-needed-entries is probably reasonable but I am not sure I
fully understand the change in semantics. It should be discussed on
tech-userlevel@, with a worked example of the change in semantics, to
assess the impact, irrespective of whether it papers over the ld(1)
warning bug.
It's also certainly unfit for pullup to 10 or 11, so we'll have to
live with workarounds until 13 is out and 11 is eol, whereas it's
likely that we could safely pull up fixes to ld(1) (although I guess
that won't help building against 10.0 and 11.0 with the spurious ld(1)
warnings).
> In short, a program just doing 'exit' is linked against libgssapi (or
> libroken, both work), and the linker complains:
>=20
> # gcc -o a a.c -lgssapi
> ld: /usr/lib/libutil.so.7: warning: warning: reference to compatibility l=
ogin_getpwclass(); include <login_cap.h> for correct reference
> [...]
As a tangent on a tangent, libgssapi really shouldn't link against
libutil at all -- that leaks various extremely nonportable NetBSDisms
into the ELF namespace, for a library (libgssapi) that's supposed to
be a reliable, standard, portable interface. Leaking krb5_* symbols
or rk_* symbols may be fine, but others like parsedate(), opendisk(),
&c., are not.
libgsspi pulls in libutil via libroken, which links against libutil
only so that rk_pidfile() can call pidfile() -- which it does _in
addition to_ writing the pidfile itself. So libutil doesn't even
serve any useful purpose for libroken.
I will nix it (though this really requires a recursive major bump of
everything that uses libroken, which also means unfit for pullup).
From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: Ryo ONODERA <ryo@tetera.org>, kikadf@netbsd.org
Subject: Re: toolchain/61079: ld compat linker warnings considered harmful
Date: Thu, 26 Nov 2026 22:53:56 +0100
--zwv5hsvn5dmvcfjf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Wed, Nov 25, 2026 at 10:30:03PM +0100, RVP via gnats wrote:
> Revert this:
> =20
> https://github.com/NetBSD/src/commit/d138d9f7e9bad645835c789d42405d05fb3=
dd84b
With a userland with this patch, I built ~2000 packages (my usual set)
and had two problems.
labwc
[174/178] Linking target clients/labnag
FAILED: [code=3D1] clients/labnag
gcc -o clients/labnag clients/labnag.p/meson-generated_.._tablet-v2-protoc=
ol.c.o clients/labnag.p/meson-generated_.._xdg-shell-protocol.c.o clients/l=
abnag.p/meson-generated_.._cursor-shape-v1-protocol.c.o clients/labnag.p/me=
son-generated_.._wlr-layer-shell-unstable-v1-protocol.c.o clients/labnag.p/=
labnag.c.o clients/labnag.p/pool-buffer.c.o -L/usr/pkg/lib -L/usr/lib -I/us=
r/pkg/include/libepoll-shim -I/usr/pkg/include/glib-2.0 -I/usr/pkg/include/=
gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/include -I/usr/pkg/incl=
ude -I/usr/pkg/include/freetype2 -I/usr/pkg/include/harfbuzz -I/usr/pkg/inc=
lude/libxml2 -I/usr/pkg/include/libdrm -Wl,--as-needed -Wl,--no-undefined -=
Wl,-zrelro -Wl,-znow -Wl,-R/usr/pkg/lib -Wl,-R/usr/lib -O2 -g -fstack-clash=
-protection -Wl,--start-group protocols/libserver_protos.a -Wl,-R/usr/pkg/l=
ib /usr/pkg/lib/libcairo.so /usr/pkg/lib/libpangocairo-1.0.so /usr/pkg/lib/=
libpango-1.0.so /usr/pkg/lib/libharfbuzz.so /usr/pkg/lib/libgobject-2.0.so =
-Wl,-R/usr/pkg/lib /usr/pkg/lib/libglib-2.0.so /usr/lib/libintl.so -Wl,-R/u=
sr/pkg/lib -Wl,-R/usr/pkg/lib /usr/pkg/lib/libwayland-client.so -lm -Wl,-R/=
usr/pkg/lib /usr/pkg/lib/libwayland-cursor.so /usr/pkg/lib/libwlroots-0.20.=
so -Wl,-R/usr/pkg/lib /usr/pkg/lib/libxkbcommon.so -Wl,-R/usr/pkg/lib /usr/=
pkg/lib/libwayland-server.so -Wl,--end-group
ld: clients/labnag.p/labnag.c.o: undefined reference to symbol 'epoll_shim_=
close'
ld: /usr/pkg/lib/libepoll-shim.so.0: error adding symbols: DSO missing from=
command line
[175/178] Generating docs/labwc-theme.5 with a custom command (wrapped by m=
eson to capture output, to feed input)
[176/178] Generating docs/labwc-philosophy.7 with a custom command (wrapped=
by meson to capture output, to feed input)
[177/178] Generating docs/labnag.1 with a custom command (wrapped by meson =
to capture output, to feed input)
[178/178] Linking target labwc
ninja: build stopped: subcommand failed.
*** Error code 1
labnag.c includes epoll-shim's sys/signalfd.h, which pulls in a
function from that library; and later (not visible here) pool-buffer.c
uses shm_open from librt. The attached patch fixes the build for me.
firefox
gmake[3]: Entering directory '/tmp/www/firefox/work/build/toolkit/library/b=
uild'
toolkit/library/build/libxul.so
rm -f ../../../dist/bin/libxul.so
/tmp/www/firefox/work/.cwrapper/bin/c++ -std=3Dgnu++20 -U_FORTIFY_SOURCE -D=
_FORTIFY_SOURCE=3D2 -fstack-protector-strong -fstrict-flex-arrays=3D1 -I/us=
r/pkg/include -I/usr/include -I/usr/pkg/include/libxml2 -I/usr/pkg/include/=
nspr -I/usr/pkg/include/libdrm -I/usr/pkg/include/glib-2.0 -I/usr/pkg/inclu=
de/gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/pkg/include/ffmpeg9 =
-I/usr/pkg/include/freetype2 -I/usr/pkg/include/harfbuzz -fno-rtti -pthread=
-fno-sized-deallocation -fno-aligned-new -ffunction-sections -fdata-sectio=
ns -fno-math-errno -fno-exceptions -pipe -fPIC -O2 -D_GLIBCXX_INCLUDE_NEXT_=
C_HEADERS -msse2 -fstack-clash-protection -D__LOCALE_C_ONLY -I/usr/pkg/incl=
ude -I/usr/include -I/usr/pkg/include/libxml2 -I/usr/pkg/include/nspr -I/us=
r/pkg/include/libdrm -I/usr/pkg/include/glib-2.0 -I/usr/pkg/include/gio-uni=
x-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/pkg/include/ffmpeg9 -I/usr/pkg=
/include/freetype2 -I/usr/pkg/include/harfbuzz -O2 -fomit-frame-pointer -fu=
nwind-tables -shared -Wl,-z,defs -Wl,--ignore-unresolved-symbol,environ -Wl=
,--gc-sections -Wl,-soname,libxul.so -o ../../../dist/bin/libxul.so -Wl,@/t=
mp/www/firefox/work/build/toolkit/library/build/libxul_so.list -Wl,-R/us=
r/pkg/lib/firefox -Wl,-R/usr/pkg/lib -Wl,-zrelro -Wl,-znow -L/usr/pkg/lib -=
lexecinfo -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib/nspr -Wl,-R/usr/pkg/lib/=
nspr -L/usr/pkg/lib/nss -Wl,-R/usr/pkg/lib/nss -L/usr/pkg/lib/ffmpeg9 -Wl,-=
R/usr/pkg/lib/ffmpeg9 -Wl,--build-id=3Dsha1 -Wl,-z,noexecstack -Wl,-z,text =
-Wl,-z,relro -Wl,-z,now -Wl,-z,nocopyreloc -fstack-protector-strong -Wl,-rp=
ath-link,/tmp/www/firefox/work/build/dist/bin ../../../third_party/angle/t=
ranslator_gn/libtranslator_gn.a ../../../third_party/angle/angle_common_gn/=
libangle_common_gn.a ../../../third_party/angle/angle_common_shader_state_g=
n/libangle_common_shader_state_gn.a ../../../third_party/angle/preprocessor=
_gn/libpreprocessor_gn.a ../../../js/src/build/libjs_static.a ../../../buil=
d/pure_virtual/libpure_virtual.a ../../../x86_64-unknown-netbsd/release/lib=
gkrust.a ../../../dist/bin/libgkcodecs.so ../../../dist/bin/liblgpllibs.so =
=2E./../../dist/bin/libmozsqlite3.so ../../../dist/bin/libmozgtk.so ../../.=
=2E/dist/bin/libmozwayland.so -Wl,--version-script,libxul.so.symbols -L/usr=
/pkg/lib -licui18n -Wl,-R/usr/pkg/lib -licuuc -ldl -lX11 -lXcomposite -lXda=
mage -lXext -lXfixes -lXrandr -lXrender -lpthread -lffi -Wl,-R/usr/pkg/lib/=
nspr -L/usr/pkg/lib/nspr -lplds4 -lplc4 -lnspr4 -lz -lm -Wl,-R/usr/pkg/lib/=
nss -L/usr/pkg/lib/nss -lssl3 -lsmime3 -lnss3 -lnssutil3 -lfreetype -lfontc=
onfig -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lc=
airo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -l=
intl -lwebpdemux -lwebp -Wl,-R/usr/lib -levent -lvpx -lpixman-1 -lxcb-shm -=
lX11-xcb -lXcursor -lXi -lxcb
ld: ../../../ipc/glue/Unified_cpp_ipc_glue2.o: in function `mozilla::ipc::s=
hared_memory::CreateImpl(unsigned long, std::unique_ptr<int, mozilla::detai=
l::FileHandleDeleter>*)':
Unified_cpp_ipc_glue2.cpp:(.text._ZN7mozilla3ipc13shared_memoryL10CreateImp=
lEmPSt10unique_ptrIiNS_6detail17FileHandleDeleterEE+0x9d): undefined refere=
nce to `shm_open'
ld: Unified_cpp_ipc_glue2.cpp:(.text._ZN7mozilla3ipc13shared_memoryL10Creat=
eImplEmPSt10unique_ptrIiNS_6detail17FileHandleDeleterEE+0xcc): undefined re=
ference to `shm_open'
ld: Unified_cpp_ipc_glue2.cpp:(.text._ZN7mozilla3ipc13shared_memoryL10Creat=
eImplEmPSt10unique_ptrIiNS_6detail17FileHandleDeleterEE+0xef): undefined re=
ference to `shm_unlink'
ld: Unified_cpp_ipc_glue2.cpp:(.text._ZN7mozilla3ipc13shared_memoryL10Creat=
eImplEmPSt10unique_ptrIiNS_6detail17FileHandleDeleterEE+0x257): undefined r=
eference to `shm_unlink'
gmake[3]: *** [/tmp/www/firefox/work/firefox-159.0.1/config/rules.mk:489: .=
=2E/../../dist/bin/libxul.so] Error 1
gmake[3]: Leaving directory '/tmp/www/firefox/work/build/toolkit/library/bu=
ild'
gmake[2]: *** [/tmp/www/firefox/work/firefox-159.0.1/config/recurse.mk:79: =
toolkit/library/build/target] Error 2
gmake[2]: Leaving directory '/tmp/www/firefox/work/build'
libxul.so uses shm_open, but doesn't link against librt.
I've added a check for the symbol, which fixes the build for me.
I think both of these are correctness fixes (the labwc one should
probably be done in a nicer way.)
Thomas
--zwv5hsvn5dmvcfjf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="labwc.diff"
Index: wayland/labwc/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/wayland/labwc/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- wayland/labwc/Makefile 11 Nov 2026 11:56:06 -0000 1.9
+++ wayland/labwc/Makefile 26 Nov 2026 21:03:19 -0000
@@ -22,6 +22,11 @@
PKG_SYSCONFSUBDIR= xdg/labwc
INSTALL_MAKE_FLAGS+= rcdir=${EGDIR}
+# labnag.c includes epoll-shim's sys/signalfd.h
+LDFLAGS.NetBSD+= -lepoll-shim
+# pool-buffer.c uses shm_unlink from librt
+LDFLAGS.NetBSD+= -lrt
+
# Fix: [../src/main.c:94] no fonts are available
DEPENDS+= nerd-fonts-Hack-[0-9]*:../../fonts/nerd-fonts-Hack
--zwv5hsvn5dmvcfjf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="firefox2.diff"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/www/firefox/distinfo,v
retrieving revision 1.599
diff -u -r1.599 distinfo
--- distinfo 5 Nov 2026 03:16:51 -0000 1.599
+++ distinfo 26 Nov 2026 21:49:10 -0000
@@ -9,6 +9,7 @@
SHA1 (patch-browser_app_profile_firefox.js) = 1168ba368c5ffdcf77e330366848466f48a92642
SHA1 (patch-build_gn__processor.py) = c9b2f31787704c3fec466711010ef632199ae385
SHA1 (patch-build_moz.configure_init.configure) = 65deb3c233df0aab81eb1fca05d708e5a4ed169a
+SHA1 (patch-build_moz.configure_libraries.configure) = dc4a449317aacf1dbaec58e0b64503143104b89a
SHA1 (patch-build_moz.configure_rust.configure) = 25ddfacd29cebbc6db005dbe61a2a7446d480678
SHA1 (patch-config_gcc-stl-wrapper.template.h) = 9360a859e71ebfbead97c0bfbb5153cb2184381a
SHA1 (patch-config_makefiles_rust.mk) = 2e1c6093090b5d49700f381ad7f2d64bc9931ea4
Index: patches/patch-build_moz.configure_libraries.configure
===================================================================
RCS file: patches/patch-build_moz.configure_libraries.configure
diff -N patches/patch-build_moz.configure_libraries.configure
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-build_moz.configure_libraries.configure 26 Nov 2026 21:49:10 -0000
@@ -0,0 +1,54 @@
+$NetBSD$
+
+Check for shm_open in librt, needed on at least NetBSD.
+
+--- build/moz.configure/libraries.configure.orig 2026-11-26 21:07:34.327275688 +0000
++++ build/moz.configure/libraries.configure
+@@ -4,6 +4,28 @@
+
+
+ @template
++def check_shm_open(lib=None, when=None):
++ check_msg = "for shm_open"
++ flags = []
++
++ if lib is not None:
++ check_msg += f" in {lib}"
++ flags.append(f"-l{lib}")
++
++ check_when = building_with_gnu_compatible_cc
++ if when is not None:
++ check_when &= when
++
++ return try_link(
++ includes=["sys/types.h", "sys/mman.h", "fcntl.h"],
++ body="shm_open(\"shmtest\", O_RDONLY|O_CREAT, 0444);",
++ check_msg=check_msg,
++ flags=flags,
++ when=check_when,
++ )
++
++
++@template
+ def check_clock_monotonic_support(lib=None, when=None):
+ check_msg = "for clock_gettime(CLOCK_MONOTONIC)"
+ flags = []
+@@ -30,6 +52,9 @@ have_rt_clock_monotonic_support = check_clock_monotoni
+ lib="rt", when=~have_raw_clock_monotonic_support
+ )
+
++have_raw_shm_open = check_shm_open()
++have_rt_shm_open = check_shm_open(lib="rt", when=~have_raw_shm_open)
++
+ set_define(
+ "HAVE_CLOCK_MONOTONIC",
+ have_raw_clock_monotonic_support | have_rt_clock_monotonic_support,
+@@ -39,7 +64,7 @@ set_config(
+ have_raw_clock_monotonic_support | have_rt_clock_monotonic_support,
+ )
+
+-set_config("REALTIME_LIBS", ["-lrt"], when=have_rt_clock_monotonic_support)
++set_config("REALTIME_LIBS", ["-lrt"], when=have_rt_clock_monotonic_support | have_rt_shm_open)
+
+
+ have_res_ninit = try_link(
--zwv5hsvn5dmvcfjf--
From: "Robert Bagdan" <kikadf@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/61079 CVS commit: pkgsrc/wayland/labwc
Date: Fri, 27 Nov 2026 17:17:17 +0000
Module Name: pkgsrc
Committed By: kikadf
Date: Fri Nov 27 17:17:17 UTC 2026
Modified Files:
pkgsrc/wayland/labwc: Makefile distinfo
Added Files:
pkgsrc/wayland/labwc/patches: patch-clients_meson.build
Log Message:
labwc: add NetBSD suport for labnag
Reflect to PR61079
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 pkgsrc/wayland/labwc/Makefile
cvs rdiff -u -r1.5 -r1.6 pkgsrc/wayland/labwc/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/wayland/labwc/patches/patch-clients_meson.build
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(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.