share/mk: Skip non-existent libraries in .depend for bootstrap/cross tools
Bootstrap and cross tools link against host libraries for target libraries
that the stage does not build into ${DESTDIR}. Skip those missing entries;
otherwise, make would compalin with "ignoring stale .depend", e.g.,
```
make[3]: /usr/obj/usr/src/btools_x86_64/usr/src/bin/chmod/.depend:26: ignoring stale .depend for /usr/obj/usr/src/btools_x86_64/usr/lib/libc.a
make[3]: /usr/obj/usr/src/btools_x86_64/usr/src/usr.bin/m4/.depend:293: ignoring stale .depend for /usr/obj/usr/src/btools_x86_64/usr/lib/libc.a
make[3]: /usr/obj/usr/src/btools_x86_64/usr/src/usr.bin/m4/.depend:293: ignoring stale .depend for /usr/obj/usr/src/btools_x86_64/usr/lib/liby.a
make[3]: /usr/obj/usr/src/btools_x86_64/usr/src/usr.bin/m4/.depend:293: ignoring stale .depend for /usr/obj/usr/src/btools_x86_64/usr/lib/libl.a
make[3]: /usr/obj/usr/src/btools_x86_64/usr/src/usr.bin/m4/.depend:293: ignoring stale .depend for /usr/obj/usr/src/btools_x86_64/usr/lib/libm.a
```
cc120: Move main.cc from guts-common to libbackend
The vendor makefile specifies 'main.o' with 'libbackend.a' as in:
```
BACKEND = libbackend.a main.o libcommon-target.a libcommon.a \
$(CPPLIB) $(LIBDECNUMBER)
```
In addition, backend 'lto-wrapper' and 'collect2' have their own
'main()' definition, so don't need the 'main.o' object.
So it's more correct to move 'main.cc' from guts-common to libbackend.
bsd.{dep,lib}.mk: Simplify the sed modification to .depend
Just call sed to perform in-place modification to the .depend file,
without creating a temporary file and moving it. This practice is
already used in <bsd.hostprog.mk>.
bsd.dep.mk: Hide the command echo of appending .depend
Don't echo the unhelpful ">> .depend" commands.
In addition, tweak the ">>" shell redirection to a test + touch, since
touch(1) is available as a bootstrap tool and already used in many
places.
world: Use NULL instead of ""/0 for the nlist(3) last element's n_name
This is a follow-up cleanup to the previous commit.
Derived-from: FreeBSD (commit cdfc673811ac)
bsd.hostlib.mk: Apply '.o' to '.no' modification to .depend
Similar to <bsd.hostprog.mk>, use sed to fix the generated .depend file
to change the target's suffix from '.o' to the actual '.no'.
libkvm(3): Drop the a.out underscore special handling
We've moved from a.out to ELF for a long time, so this special handling
of leading underscore for a.out is obsolete. Remove it.
world: drop the a.out underscore from nlist(3) names
Since 49479ff7b7 ("nlist(3): Sync with FreeBSD") nlist(3) matches
symbol names exactly and no longer treats "_foo" as "foo". When
reading a kernel image, kvm_nlist() passes the names to __fdnlist()
unchanged, so every consumer still asking for a.out-style "_foo" names
stopped working on crash dumps: kgdb finds no threads ("No
registers"), and ps, fstat, vmstat, pstat, dmesg, netstat, ipcs and
nfsstat fail with -M/-N. Live kernels were not affected, because the
kldsym(2) path of kvm_nlist() strips one leading underscore.
Follow FreeBSD and fix the consumers rather than bring the underscore
matching back. This is the counterpart of FreeBSD cdfc673811ac
("various: Fix nlist invocations").
In addition, drop the underscore from VRS_SYM in kvm.h (nothing in base
uses it).
See-also: https://www.mail-archive.com/dev-commits-src-all@freebsd.org/msg90959.html
[3 lines not shown]
Revert "kern: Fix write-open "." or ".." to return EISDIR instead of EEXIST"
This reverts commit d5838e7c8154895375e3f278fa0c03a2b913132c.
That change broke mkdir() and maybe others, causing them to return
the wrong EISDIR instead of EEXIST. For example:
```
% mkdir .
mkdir: .: Is a directory
```
We'll need to fix the original issue in another way.
Reported-by: swildner, mneumann
Merge remote-tracking branch 'crater/vendor/OPENSSH'
* Update to 10.6p2 CVE-2026-123158 ("SSHole") (DFly not affected)
* Note: DragonFlyBSD is not affected by the security bug being fixed
vidcontrol: keep the failing ioctl's errno across revert()
revert() calls ioctls of its own, so if one of them fails it replaces the
error that made us revert in the first place and the message names the wrong
error. Save errno before calling revert().
Following FreeBSD commit 1b8c842e ("Fix some parsing and error handling
bugs"), which does this for the mode-set failure; done here for all
three calls in video_mode() (CONS_MODEINFO, CONS_SET, KDRASTER).
Bug: https://bugs.dragonflybsd.org/issues/2493
vidcontrol: accept the documented [mode] [fg [bg]] [show] forms
Fixes the syntax documented in vidcontrol(1).
video_mode() treated any unrecognized first positional argument as an
invalid video mode, so the documented color-only form
vidcontrol yellow blue
failed with "invalid video mode name". Leave such an argument to
get_normal_colors() instead, as FreeBSD does (see FreeBSD commit
1b8c842e: "Fix some parsing and error handling bugs"). A mistyped mode
name then reaches usage() with exit status 1, and MODE_<non-digit> still
reports "invalid video mode number".
The "show" handling also sat before the mode and color arguments, so it was
only accepted as the *first* positional argument and the documented
vidcontrol 80x25 white black show
[8 lines not shown]
bsd.sys.mk: A few more cleanups
* Add WERROR variable to help manage -Werror, similar to the handling in
<bsd.kern.mk>.
* Reorgnize a few feature cases to group -fxxx flags together.
bsd.sys.mk: Fix regression to make CWARNFLAGS be appended at last
CWARNFLAGS allows a user to specify custom warning flags, so it should
be appended to CFLAGS at last. This commit fixes the regression
introduced in commit 6dd738473955429dcfc85a5829c422837216bb26.
Meanwhile, document CWARNFLAGS in make.conf(5) man page.
Discussed-with: swildner
bsd.sys.mk: Adjust _cnowarnflags for WARNS=3
* -Wunused-but-set-parameter is included in -Wextra, which is enabled at
WARNS=3, so move the -Wno-unused-but-set-parameter flag to WARNS=3.
* Merge -Wno-unused-but-set-parameter and -Wno-unused-parameter, and
remove the GCC check because it also applies to Clang (its -Wextra
also enables the two warnings).
* Adjust the -Wno-implicit-fallthrough case to clean up the condition a
bit.
Reviewed-by: swildner
dsynth - Fix improper deletions with "prepare-system"
* Don't delete "obsolete" packages for "prepare-system"
* Obsolete packages can only be properly deleted when
a full scan is done. "prepare-system" only does a
partial scan so it winds up deleting stuff it
should not delete.
kernel - Fix page fault in the jail unmount check
sys_unmount() printed the "does not belong to this jail" message using
uap->path, a user-space pointer. With SMAP enabled, kprintf() -> strlen()
faults on it.
Use nd.nl_path, the kernel copy that nlookup_init() already made.
Panic reproduce steps, assuming a jail is prepared at `/jail`:
```
jail# umount /dev
```
Reported-by: tuxillo
Bug: https://bugs.dragonflybsd.org/issues/3386
gcc120,gcc80: Reuse COMPILE.cc to avoid duplicating explicit rules
Make use of COMPILE.cc from <sys.mk> to avoid duplicating explicit rules
(in particular the various flags) in libstdc++/components/libconv_2011.
In addition, create a ".USE" reusable rule to further reduce duplicate
code.
bsd.sys.mk: Adjust -Wno-unused-value for WARNS level
Without this adjustment, building gnu/usr.bin/gdb/libdecnumber with
WARNS=2 would fail with the -Werror=unused-value warning, but with
WARNS=3 the building would succeed.
Discussed-with: swildner
gcc120,gcc80: Get rid of duplicate explicit compile rules
Make use of the new features implemented in the last commit.
Actually, this fixed one mistake in gcc80/libgcc that the 'raise'
flags group was ignored, because the explicit compile rules didn't refer
to the group flags. Luckily, the build result was good; md5 checksums
of the libraries don't change.
stand/pxeldr_tftp: Remove obsolete AFLAGS
Two reasons:
- AFLAGS is not used by the .S suffix rule; should use CFLAGS instead.
- This is no longer needed after the commit
6c644be32975767831a57868196e63523af13989 that collapsed makefile with
parent to avoid duplication.
gnu/lib: Add missing WARNS to gcc120 and gcc80
Note that the following libraries require WARNS=0:
- gcc80/libstdc++/components/libconv_supc
- gcc120/libstdc++/components/libconv_1998
- gcc120/libstdc++/components/libconv_supc