Repository navigation
netbsd: Upgrade to 11, and switch to GCC NG - #573715
Merged
Merged
Conversation
Ericson2314
force-pushed
the
netbsd-11/1-upgrade
branch
from
October 13, 2026 18:44
125e460 to
3ca6063
Compare
Ericson2314
commented
Oct 13, 2026
Update to the latest major release. 10 is skipped: it is no longer the newest, and an older tree is less likely to build with the compilers we use, such as GCC 16. Note that this commit just updates the source code, and doesn't unbreak the packages. NetBSD in Nixpkgs was already rather bitrotten, so this isn't a regresion TODO CHECK. The fixes 11.0 needs follow in separate commits. The source now comes from the release's source sets rather than a `fetchcvs` export of `src`, which takes on the order of ten hours; the sets download in about a minute. Their hashes are taken from the `SHA512` file NetBSD publishes beside them. Only `src`, `syssrc` and `sharesrc` are fetched, since nothing here builds the imported GNU tools (`gnusrc`) or X11 (`xsrc`). Assisted-by: Claude Code (Claude Opus 5.5)
Ericson2314
force-pushed
the
netbsd-11/1-upgrade
branch
from
October 13, 2026 18:49
3ca6063 to
05167c8
Compare
Ericson2314
force-pushed
the
netbsd-11/1-upgrade
branch
2 times, most recently
from
October 13, 2026 19:18
edf0765 to
dd330f6
Compare
Ericson2314
commented
Oct 13, 2026
Ericson2314
force-pushed
the
netbsd-11/1-upgrade
branch
from
October 13, 2026 19:20
dd330f6 to
870d750
Compare
Ericson2314
commented
Oct 13, 2026
This comment was marked as resolved.
This comment was marked as resolved.
`name` was the literal `"netbsd-headers-9.2"`, so the join advertised 9.2 while joining 11.0 inputs. Take `version` from the scope like everything else. Assisted-by: Claude Code (Claude Opus 5.5)
Make `useGccNG` the default for every NetBSD platform, as Cygwin's already is, rather than opting in one example system. NetBSD 11.0 is only supported with the split set, so this comes straight after the version bump: the monolithic `gcc` is not kept working for it. NetBSD is low tier and has to use GCC rather than LLVM, so it is a good place to dogfood the split set. With the fixes that follow, GCC 16 builds `hello`, `zlib`, `bash`, `perl`, `python3` and the NetBSD libc for it. `x86_64-netbsd-llvm` is unaffected, since `useLLVM` takes precedence. Assisted-by: Claude Code (Claude Opus 5.5)
…ripts
The release source sets ship `tools/*/configure` without the executable
bit. NetBSD's own build never cared, because it invokes them as
`${HOST_SH} configure` rather than executing them directly. `fetchcvs`
preserved the bit, so this only surfaced with the switch to the sets.
stdenv's `configurePhase` tests for an *executable* `./configure`, so
without it the phase quietly reports "no configure script, doing
nothing", and the failure only shows up later and further away:
sh: ./buildmake.sh: No such file or directory
because `buildmake.sh` is generated from `buildmake.sh.in` by exactly the
configure run that got skipped.
Assisted-by: Claude Code (Claude Opus 5.5)
Ericson2314
force-pushed
the
netbsd-11/1-upgrade
branch
from
October 13, 2026 19:29
870d750 to
a189bca
Compare
`compat-dont-configure-twice`: rebased. The `config.cache` rule now
stages through `${.TARGET}.tmp` and passes `CPPFLAGS`/`CONFIGURE_ARGS`.
The fix is unchanged -- delete the rule, because we run `configure`
ourselves in `configurePhase` and letting `make` run it again from inside
the build discards that.
`compat-no-force-native`: rebased, with one substantive change. 9.2
accumulated `tools/compat`'s include flags in `CPPFLAGS` and only moved
them into `HOST_CPPFLAGS` at the bottom of the Makefile, beside the
`bsd.hostlib.mk` include -- so deleting that tail, as the patch already
did, left them in `CPPFLAGS` where `bsd.lib.mk` reads them. 11.0 assigns
them straight to `HOST_CPPFLAGS`, which `bsd.lib.mk` never reads, so the
`lib/libc` sources that `tools/compat` pulls in via `.PATH` stopped
finding their headers:
lib/libc/gen/dirname.c:37:10: fatal error: namespace.h: No such file or directory
The patch now redirects those two assignments to `CPPFLAGS` explicitly.
`compat-host-locale-t`: new. NetBSD's `<nl_types.h>` typedefs `locale_t`
behind `__LOCALE_T_DECLARED`, a macro no non-NetBSD libc defines.
`tools/compat` builds against the *host* libc and `compat_defs.h` includes
`<ctype.h>`, which on glibc already declares `locale_t`, so the typedef
fires twice and `gencat` fails to compile. Claim the declaration in
`compat_defs.h`, right after `<ctype.h>` -- it is included by every host
tool via `nbtool_config.h`, so that is both sufficient and correctly
ordered. This is latent upstream because it only bites when the build host
is not NetBSD.
Assisted-by: Claude Code (Claude Opus 5.5)
Upstream added
LDFLAGS+= --no-dynamic-linker --noinhibit-exec
to `Makefile.efiboot` in revision 1.17, so the patch no longer applies:
https://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/i386/stand/efiboot/Makefile.efiboot.diff?r1=1.16&r2=1.17
`sys-headers` shares this patch list with `sys`, and every package needs
the headers, so this breaks the whole package set, not just the kernel.
Assisted-by: Claude Code (Claude Opus 5.5)
Three things 11.0 needs that 9.2 did not.
`genassym` was already an argument but never reached
`nativeBuildInputs`. 9.2 got away with it; 11.0's libc has
`arch/x86_64/genassym.cf`, so `assym.h` is now generated while building
libc rather than only the kernel, and the build died with
`genassym: command not found`.
`lib/csu` joins `extraPaths`. 11.0 added `lib/csu/common/csu-common.h`
and made `lib/libc/gen` include it. The include path already pointed at
`lib/csu/common`; the sources simply were not in the filtered tree.
`nslexer-declare-strdup.patch` declares `_strdup`. `nslexer.l` calls
`strdup`, which `namespace.h` rewrites to `_strdup` -- fine when the
file's own includes come first, because `<string.h>` is then read after
the rename. Built with flex instead of NetBSD's lex it is not: flex's
skeleton emits `#include <string.h>` ahead of the `%{ %}` block, so
`strdup` is declared under its ordinary name and the later `<string.h>`
is a no-op behind its guard.
Declaring the renamed symbol fixes the actual defect. The alternative,
demoting `-Wimplicit-function-declaration` and `-Wint-conversion` to
warnings, is far too blunt for a libc build -- `-Wno-error=int-conversion`
would hide genuine pointer/integer confusion everywhere else in the tree.
This one is not version-specific: `nslexer.l` is byte-identical in 9.2,
10, 11 and -current. It depends on our flex, not on NetBSD's release.
Assisted-by: Claude Code (Claude Opus 5.5)
Two more places where 11.0 needs something 9.2 did not.
`libcrypt` grew an argon2 password hash, implemented by the vendored
`phc-winner-argon2` under `external/apache2/argon2`. Its Makefile reaches
those sources through `.PATH`, so without them in the filtered tree the
build stops at `don't know how to make argon2.c`.
`librpcsvc` needs `RPCGEN_CPP`. `rpcgen` shells out to a C preprocessor,
and 11.0 defaults that to `/usr/bin/clang-cpp`, which does not exist
here. It fails *softly*: the generated stubs come out empty, so the
library still builds and links, and the first sign of trouble is NetBSD's
own expected-symbol check, at which point 283 symbols are missing and
none are extra:
librpcsvc.so.1.0: error: actual symbols differ from expected symbols
`include` already passes this flag; librpcsvc needs it for the same
reason. It has to name the *build* compiler, since `rpcgen` runs here and
the cross gcc installs only target-prefixed binaries, so it has no plain
`cpp`.
Assisted-by: Claude Code (Claude Opus 5.5)
Ericson2314
force-pushed
the
netbsd-11/1-upgrade
branch
from
October 13, 2026 19:55
a189bca to
b550712
Compare
Ericson2314
marked this pull request as ready for review
October 13, 2026 20:11
Member
Author
|
OK I am happy with this now. BTW the patch commits come from https://github.com/Ericson2314/netbsd-src, but NetBSD doesn't do a CVS->Git export with stable hashes, so these git hashes aren't so useful anyways. Further maintainership on this should feel free to ignore my repo and just deal with the patches manually. That is why I don't |
1 of 13 tasks
This was referenced Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See each commit for details.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.