DragonFlyBSD/src 92a70ebcontrib/gcc-12 README.DRAGONFLY, doc upgrading_gcc.txt

doc: Document the steps to import and upgrade GCC

This is partially based on a README created by Scott Parlane (sparlane).

Credit: Scott Parlane (sparlane)
DeltaFile
+150-0doc/upgrading_gcc.txt
+2-0contrib/gcc-12/README.DRAGONFLY
+152-02 files

DragonFlyBSD/src 6c2bca4share/man/man7 hier.7

hier.7: Update a bit.
DeltaFile
+12-1share/man/man7/hier.7
+12-11 files

DragonFlyBSD/src ef1ba79share/misc pci_vendors

Update the pciconf(8) database.

Aug 5, 2026 snapshot from https://pci-ids.ucw.cz
DeltaFile
+2,162-776share/misc/pci_vendors
+2,162-7761 files

DragonFlyBSD/src 5dff546share/misc bsd-family-tree

bsd-family-tree: Sync with FreeBSD.
DeltaFile
+15-5share/misc/bsd-family-tree
+15-51 files

DragonFlyBSD/src 8aa3a09sys/dev/apple/fw apple_fw.c

kernel/apple_fw: Remove unused malloc type.
DeltaFile
+0-2sys/dev/apple/fw/apple_fw.c
+0-21 files

DragonFlyBSD/src 39b2956share/mk bsd.libnames.mk

bsd.libnames.mk: Remove libsupc++.
DeltaFile
+0-1share/mk/bsd.libnames.mk
+0-11 files

DragonFlyBSD/src 357c69clib/libutil pty.3, sbin/gpt gpt.8

Fix some typos in manual pages and visible text.
DeltaFile
+2-2sys/kern/vfs_lock.c
+1-1usr.bin/setcaps/setcaps.1
+1-1sbin/gpt/gpt.8
+1-1lib/libutil/pty.3
+5-54 files

DragonFlyBSD/src 97241calib/libutil Makefile

libutil: Remove ineffective COPTS in the Makefile.
DeltaFile
+0-2lib/libutil/Makefile
+0-21 files

DragonFlyBSD/src 728aaaausr.bin/bmake Makefile

bmake: Use FLAGS_GROUPS et al. for file specific options.

No need to hand roll this.
DeltaFile
+3-2usr.bin/bmake/Makefile
+3-21 files

DragonFlyBSD/src fac5240lib/libfetch http.c

libfetch: Fix GCC 12.5's -Wstringop-overread.

Taken-from: FreeBSD (57fbafb8deac75b924faf1fa6c2222a7719fdfec)
DeltaFile
+3-2lib/libfetch/http.c
+3-21 files

DragonFlyBSD/src 7e7c534contrib/ncurses/ncurses/base lib_screen.c

Merge branch 'vendor/NCURSES'
DeltaFile
+1-1contrib/ncurses/ncurses/base/lib_screen.c
+1-11 files

DragonFlyBSD/src 333ea1fusr.sbin/installer/dfuibe_installer fn_install.c

installer: Fix GCC 12's -Waddress in world. cp_src[i] is never NULL.
DeltaFile
+3-3usr.sbin/installer/dfuibe_installer/fn_install.c
+3-31 files

DragonFlyBSD/src dc79421contrib/ncurses/ncurses/base lib_screen.c

vendor/ncurses: Add a trailing nul for magic-string in putwin.

This was flagged by GCC 12.5's -Wstringop-overread.

Patch is from upstream, therefore fixing on the vendor branch.
DeltaFile
+1-1contrib/ncurses/ncurses/base/lib_screen.c
+1-11 files

DragonFlyBSD/src f48dc6ainitrd mkinitrd.sh

initrd/mkinitrd.sh: Force strip the binaries to fix size exceeding

A user may set DEBUG_FLAGS in /etc/make.conf to retain debug symbols
during the installation phase, so the copied /rescue tools containing
the debug symbols would exceed the allowed maximum initrd image (current
15MB) and then break the installworld phase.

This issue was introduced by my commit 9d10863cc2df1e9077eb6405dd8572c243ba94d7
that removed the hardcoded 'strip' invocation from crunchgen(1)-
generated makefiles.

Now we force strip the binaries after copying them to the initrd build
directory.

Reported-by: swildner
Discussed-with: swildner
DeltaFile
+18-6initrd/mkinitrd.sh
+18-61 files

DragonFlyBSD/src cb392f0initrd/oinit Makefile oinit.c

initrd/oinit: Implement login_tty() to avoid depending on libutil

Copy the login_tty() from libutil and thus remove the dependency on
libutil.  However, this doesn't reduce the final binary size...

Meanwhile, remove unnecessary header inclusions.
DeltaFile
+18-14initrd/oinit/oinit.c
+0-7initrd/oinit/Makefile
+18-212 files

DragonFlyBSD/src fe73fd3. Makefile_upgrade.inc, initrd Makefile

initrd: Exclude 'oinit' from rescue tools

oinit is a stripped-down init(8), so it's only useful on an initrd
image.  Move it from ${RESCUE_SUBDIRS} to ${INITRD_SUBDIRS} and remove
the existing /rescue/oinit.  Adjust the makefiles to simplify the
installation logic.
DeltaFile
+3-4initrd/Makefile
+5-0initrd/oinit/Makefile
+5-0initrd/etc/Makefile
+1-0Makefile_upgrade.inc
+14-44 files

DragonFlyBSD/src 4cb09ffinitrd mkinitrd.sh

initrd/mkinitrd.sh: Actually use check_initrd() and small changes

* The check_initrd() was not used. Now use it before making the image.
* Simplify the awk command to be bc(1) to round up the image size.
* Shell syntax and style cleanups.
DeltaFile
+17-26initrd/mkinitrd.sh
+17-261 files

DragonFlyBSD/src 54c9212sys/conf bsd.kern.mk

kernel: Disable -Wzero-length-bounds for the kernel build.
DeltaFile
+3-0sys/conf/bsd.kern.mk
+3-01 files

DragonFlyBSD/src 66383c5stand/boot/pc32/boot2 Makefile

boot2: Lower minimum pagesize the compiler assumes for warnings to 1024.

This silences a few -Warray-bounds we were getting from GCC 12.5.
DeltaFile
+9-0stand/boot/pc32/boot2/Makefile
+9-01 files

DragonFlyBSD/src 634062alib/libc/sys mincore.2, sys/vm vm_mmap.c

mincore(2): Fix several bugs

* Return ENOMEN when the requested range is not fully mapped.
  (obtained from FreeBSD: 455dd7d4c79bc7bef5401721f617e64eca7ef422)

  This change should fix a crash in Mesa where it calls mincore() to
  determine whether a protocol field is a valid pointer in order to
  keep compatible with an old protocol version.

* Fix an off-by-one error in filling the skipped entries.  lastvecindex
  refers to the last valid byte, so the new bytes should come after it.
  (obtained from FreeBSD: 6a87d217e2da2a63d4431aeb871783e1dd7349ae)

* Fix the calculation of the 'end' boundary.
  (obtained from FreeBSD: d0c9294b810f8b42b7ac27a46db44b94ddca3160)

* Update the man page.

Reported-by: peeterm
DeltaFile
+46-14lib/libc/sys/mincore.2
+28-14sys/vm/vm_mmap.c
+74-282 files

DragonFlyBSD/src 49eae19lib/libc/sys mlock.2

mlock.2: Add a missing '.Pp' after list
DeltaFile
+1-0lib/libc/sys/mlock.2
+1-01 files

DragonFlyBSD/src 9c2637alib/libc/sys mincore.2, sys/vm vm_mmap.c

mincore(2): Add 'vm.mincore_mapped' sysctl to control reporting

Add the 'vm.mincore_mapped' (default ON!) to control whether to report
only the mapping status (if set to a non-zero value) or the physical
residency (if set to a zero value; the old behavior).

The idea of implementing this and enabling it by default is to help
mitigate page cache attacks [1].

[1] Page Cache Attacks: https://arxiv.org/abs/1901.01161

Obtain-from: FreeBSD (https://reviews.freebsd.org/D18764)
DeltaFile
+16-3lib/libc/sys/mincore.2
+7-3sys/vm/vm_mmap.c
+23-62 files

DragonFlyBSD/src e8a6211sys/conf kern.post.mk newvers.sh

kernel: Refactor newvers.sh script

* Require and directly use 'KERN_IDENT' from the environment.  This
  avoids the 'make -V KERN_IDENT' command and thus fix the following
  warning from bmake since the last upgrade to 20260619:
  ```
  make[3]: warning: Invalid internal option "-J" in "/usr/obj/usr/src/sys/ALY"; see the manual page
  ```

* Leverage the new tools/gencopyright.sh script to generate the
  copyright header.

* Simplify the awk command that extracts '__DragonFly_version' from
  <sys/param.h> (referred to FreeBSD).

* Clean up code and styles.
DeltaFile
+51-52sys/conf/newvers.sh
+2-1sys/conf/kern.post.mk
+53-532 files

DragonFlyBSD/src 18323e1include Makefile, tools gencopyright.sh

include: Rewrite generation of <osreldate.h>

* Add the new tools/gencopyright.sh script to generate the copyright
  header.  Prefer the copyright year extracted from top-level COPYRIGHT,
  similar to FreeBSD's.

* Directly extract the __DragonFly_version from <sys/param.h> as RELDATE
  instead of calling newvers.sh.  As a result, no need to clean up the
  extra-generated files: version, vers.c and vers.txt.

By the way, this also avoids a few bmake warnings appeared after the
recent bmake upgrade (to 20260619):
```
make[2]: warning: Invalid internal option "-J" in "/usr/src"; see the manual page
make[2]: warning: Invalid internal option "-J" in "/usr/src"; see the manual page
make[2]: warning: Invalid internal option "-J" in "/usr/src"; see the manual page
make[5]: warning: Invalid internal option "-J" in "/usr/obj/usr/src/world_x86_64/usr/src/include"; see the manual page
make[2]: warning: Invalid internal option "-J" in "/usr/src"; see the manual page
make[2]: warning: Invalid internal option "-J" in "/usr/src"; see the manual page

    [4 lines not shown]
DeltaFile
+26-0tools/gencopyright.sh
+12-12include/Makefile
+38-122 files

DragonFlyBSD/src f56704fshare/man/man9 kprintf.9

kprintf.9: Document the return value of ksnprintf()/kvsnprintf()
DeltaFile
+15-4share/man/man9/kprintf.9
+15-41 files

DragonFlyBSD/src 6303926sys/netinet6 icmp6.c nd6.c

kernel: Change ip6_sprintf() not to use static buffers

Now the caller must pass a buffer of size at least INET6_ADDRSTRLEN.

Derived-from: FreeBSD (commit 1d54aa3ba94f4d9883b0746ce45123d5b5be773b)
DeltaFile
+73-41sys/netinet6/ip6_mroute.c
+52-31sys/netinet6/nd6_rtr.c
+29-28sys/netinet6/in6.c
+36-21sys/netinet6/nd6_nbr.c
+32-18sys/netinet6/nd6.c
+23-10sys/netinet6/icmp6.c
+245-14912 files not shown
+307-19218 files

DragonFlyBSD/src fdf5103sys/kern kern_jail.c

jail: Fix potential buffer overflow in sysctl_jail_list()

sysctl_jail_list() allocates a buffer of size = count*1024, and then
uses ksnprintf() to format the jail information and advance the write
position. However, ksnprintf() returns the would-be length (i.e., the
number of bytes would be written if the buffer is big enough). So a jail
that has a very long path and/or many IPs would overflow the allocated
buffer.

Fix the bug by correctly handling the return value of ksnprintf().

GitHub-PR: #45
Reported-by: Nathan Sapwell (jewbird)
DeltaFile
+6-6sys/kern/kern_jail.c
+6-61 files

DragonFlyBSD/src 9257500sys/kern kern_jail.c

jail: Clean up sysctl_jail_list()

No functional changes.
DeltaFile
+23-31sys/kern/kern_jail.c
+23-311 files

DragonFlyBSD/src 23fad20sys/conf files, sys/dev/apple/fw Makefile

Fix LINT64 build (add smc_thermal.c).

While here, break too long lines in apple_{fw,ir,smc}'s Makefiles.
DeltaFile
+3-2sys/dev/apple/ir/Makefile
+3-1sys/dev/apple/smc/Makefile
+3-1sys/dev/apple/fw/Makefile
+1-0sys/conf/files
+10-44 files

DragonFlyBSD/src 896ad35share/man/man5 make.conf.5, sys/conf bsd.kern.mk

kernel: Add WARNS_AUDIT for the kernel.

Analogous to world. If specified, any warning options that we normally
disable in buildkernel using -Wno-* will be active.

While here, move -Wold-style-declaration from CFLAGS to CWARNFLAGS.
DeltaFile
+11-4sys/conf/bsd.kern.mk
+2-5share/man/man5/make.conf.5
+13-92 files