Cause src/lib/libc/get/sysctl.o to depend upon /dev/null
This is ugly in the extreme, unreliable really, and just bad.
Yet it seems to be reasonably effective in causing sysctl.o to
be rebuilt every time libc is being rebuilt (which is an aim).
There surely must be a better way. If someone knows what that is,
and it actually works, please replace this with that better way.
x86: Redo boot-time XSAVE area size ABI check.
Instead of checking each component's offset+size from
size = CPUID[EAX=0x0d,ECX=i].EAX,
offset = CPUID[EAX=0x0d,ECX=i].EBX,
to make sure it fits in the XSAVE_MAX_BYTES implied by the
MINSIGSTKSZ ABI parameter, just check the total _enabled_ XSAVE area
size from
CPUID[EAX=0x0d,ECX=0].EBX,
which is what we use to allocate the XSAVE area in software anyway.
The Intel documentation[1] is not very clear on exactly what
CPUID[EAX=0x0d,ECX=i] reports for i >= 2, saying `valid bit in the
XCR0 register' without distinguishing `supported' from `enabled'
bits, and the AMD documentation I skimmed didn't have these leaves in
[16 lines not shown]
Redo the sysctl user.osrevision (etc) impl method
This is not intended to affect the results, but is a different
method of getting there, without ephemeral generated include files.
It is unlikely that this is the final version, but it seems better
for now (update builds probably don't do what I'd intended for now,
but that's a minor concern - they should still work).
x86: Save and restore all supported extended CPU state on signals.
While here, disable Intel AMX, whose state size (>>8 KiB) exceeds
MINSIGSTKSZ (8 KiB), until we are ready to safely update the ABI for
sigaltstack(2). This isn't a regression: we've never had a release
with Intel AMX support.
Previously, on signal delivery, we would only save and restore at
most what FXSAVE does, which is the x87 and SSE registers that always
exist on amd64.
To save and restore the upper halves of the YMM or ZMM registers
(AVX/AVX2/AVX512), or the AVX512 registers ZMM16..ZMM31, or the
enormous AMX state, we need to do more. And we need to do that even if
the signal handler doesn't use AVX instructions, because an SSE
instruction modifying xmmN (e.g., in a vectorized memcpy) will, as a
side effect, zero the high half of ymmN.
Fortunately, the x86 architecture has an extensible mechanism for
[47 lines not shown]
kqueue(2): Tighten branch in previous change.
If sleepok is true, then kmem_zalloc should never fail, and this
routine is inline with constant arguments at every call site, so
let's let the compiler prune dead branches for the call sites that
can sleep.
PR kern/60436: kqueue(2): random kernel null pointer deref in
EVFILT_PROC NOTE_TRACK
PR/60362 (gdb can not insert breakpoints on aarch64)
Update aarch64-netbsd-tdep.c to use modern gdb initialisation method and
re-gen libgdb/arch/aarch64/init.c
PR bin/58577 - install(1) -d issues
Fix issues where "install -d" (with no directory) simply
exit(0)s. That one is kind of marginal, installing nothing
when nothing is needed could be treated as OK, but the man
page does indicate in the SYNOPSIS that with -d, at least
one directory is needed (it says nothing at all about that
in the text).
Second, after creating a directory, if a later operation
(chown, chmod) fails, that is not success, a warning was
issued (good), a bad metalog was being created (bad).
That is clearly a bug (though probably doesn't happen
very often).
And third, when install -d fails, and issues an error,
(warn()) the exit status from install(1) should not be zero.
This only applies after the (rare, I'd assume) errors
from the 2nd fix (which were not previously regarded as
[22 lines not shown]
PR lib/59067 (wctrans got error member)
Patches from the OP (ru_j217) and from RVP - see the PR
This looks to be just correcting what appear to be simple
errors in the code.
XXX pullup -11
Properly fix the libc build
I had this change in early testing, but convinced myself it couldn't
possibly be required, so deleted it - and all worked. But that's
because I do update builds, and this extra dependency required after
the first build.
It shouldn't be required ever, it is insane, but there will shortly
be a PR about that! For now, this does no harm.
PR xsrc/59858 (locale fixes for xsrc)
From RVP - see the PR
Oversimplifying: this causes Mesa to use LC_NUMERIC=C when using
strtod() to parse stuff (ie: the radix char (decimal point) is '.',
regardless of the user's locale).
XXX pullup -11
Fix builds - limit new user.stuff in sysctl to real libc
Keep the user.ostype (etc) new sysctls for the real libc (and
suitable facsimilies) - other places that "borrow" syctl.c for
their own purposes can survive without, if any of those want
to include these mib vars in their version, all that is required
is to add the appropriate Makefile glue to create the header file
in the appropriate place, and add -Ipath to the sysctl.o build, and
the new magic -D to enable it.
Add new user.* nodes to sysctl
This adds the nodes (and documentation for them):
user.ostype = NetBSD
user.osrevision = 1199000600
user.osrelease = 11.99.6
user.built = 2026-07-10 02:46:18 UTC
to the sysctl mib (the values shown there just what happened for a test build).
The first three are more or less identical to the kern.* mib variables of the
same names - the difference is that these reflect userland, or at least, libc
so do not alter just because a new updated kernel is booted without updating
the rest of the system. The fourth gives either the date when libc was
built (as shown) or if the value contains a trailing "!" (after a space
after UTC) the value is the MKREPERO_TIMESTAMP for the build (keep building
with the same value and the date/time there won't alter). The date/time
are always in UTC.
[11 lines not shown]
Adding src/lib/libc/gen/grab-version.sh
A simple script that gets current system version information and
builds a header file containing it. To be used in a following commit.