FreeBSD/src 1091f52.github/workflows cross-bootstrap-tools.yml

.github: Update the path used for the homebrew LLVM install on macOS

Pull Request:   https://github.com/freebsd/freebsd-src/pull/1212
DeltaFile
+1-1.github/workflows/cross-bootstrap-tools.yml
+1-11 files

FreeBSD/src d21c19dsys/cam cam_iosched.c

cam/iosched: Document latency buckets correctly.

Document how latency buckets are actually computed: They are a doubling
from 20us to 10.485s by default, but based at
kern.cam.iosched.bucket_base_us and increase with a ratio of
kern.cam.iosched.bucket_ration / 100 from one to the next.

Sponsored by:           Netflix
DeltaFile
+6-1sys/cam/cam_iosched.c
+6-11 files

FreeBSD/src b25ceb9share/man/man5 src.conf.5, share/mk bsd.opts.mk

Revert "Make WITHOUT_UNDEFINED_VERSION the default"

This is causing failures on gcc13 CI builds so those need to be fixed
or worked around.

This reverts commit 4510f2ca9170927309a423274e03f1eb8e27da27.
DeltaFile
+4-6share/man/man5/src.conf.5
+2-2share/mk/bsd.opts.mk
+0-4tools/build/options/WITH_UNDEFINED_VERSION
+2-0tools/build/options/WITHOUT_UNDEFINED_VERSION
+8-124 files

FreeBSD/src b12cae8sbin/nvmecontrol nvmecontrol.c nvmecontrol.8

nvmecontrol: Allow optional /dev/ for device names

nvmecontrol operates on devices. Allow a user to specify the /dev/ if
they want. Any device that starts with / will be treated as if it was a
full path for maximum flexbility.

Sponsored by:           Netflix
DeltaFile
+5-2sbin/nvmecontrol/nvmecontrol.c
+2-2sbin/nvmecontrol/nvmecontrol.8
+7-42 files

FreeBSD/src eadd4eausr.sbin/bsdinstall/scripts docsinstall

bsdinstall: update comment related to pkg

pkg_add has been gone since 2013(?).  Refer to pkg(8) instead.

Sponsored by:   The FreeBSD Foundation
Reviewed by:    jrtc27
Differential Revision: https://reviews.freebsd.org/D44946

(cherry picked from commit ad31d4764255c0848f1f0fa10760d16b5a2922aa)
DeltaFile
+1-1usr.sbin/bsdinstall/scripts/docsinstall
+1-11 files

FreeBSD/src f609ff5bin/date date.1

date.1: Note that nanosecond support is to appear first in 14.1

Sponsored by:   Klara, Inc.

(cherry picked from commit c40e0bff7257e6d239779a5106dc67429941f63f)
DeltaFile
+2-4bin/date/date.1
+2-41 files

FreeBSD/src 78c209d. RELNOTES

RELNOTES: Mention date(1)'s nanosecond support

This is a direct commit to stable/14.

Sponsored by:   Klara, Inc.
DeltaFile
+5-0RELNOTES
+5-01 files

FreeBSD/src f2ec4bdbin/date date.c

date: Correctly check outcome of mktime().

X-MFC-With:     7b390cb63689
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D44982

(cherry picked from commit dafb424b8d44c7fdc9cfe876a79aad05c438def0)
DeltaFile
+3-1bin/date/date.c
+3-11 files

FreeBSD/src 10c4885bin/date date.c date.1, bin/date/tests format_string_test.sh

date: Add support for nanoseconds

This patch introduces support for a conversion specification for
nanoseconds.

The format of %N is meant to be compatible with that of GNU date.

The nanoseconds conversion specification is implemented directly in
date(1) instead of libc (in strftime(3)) to avoid introducing
non-standard functions to libc at this time and modifying struct tm.

Apart from introducing the nanoseconds conversion specification, this
patch brings the following changes:

- The "ns" format for ISO 8061 dates is now unlocked. E.g., date -Ins
  prints:
      2024-04-22T12:20:28,763742224+02:00
- The -r flag when fed a file is now aware of the nanosecond part of the last
  modification time.

    [11 lines not shown]
DeltaFile
+105-27bin/date/date.c
+22-6bin/date/date.1
+15-2bin/date/tests/format_string_test.sh
+142-353 files

FreeBSD/src a7096a6bin/date date.1

date(1): Grammar fixes

Event:          Advanced UNIX programming course (Fall'23) at NTHU
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1035

(cherry picked from commit 8e9fc2d9f657f99ae368524868dd04080bc390bf)
DeltaFile
+3-3bin/date/date.1
+3-31 files

FreeBSD/src 4fd988ebin/date date.c

date: Fix tests by initializing timespec structure

The tests related to nanosecond support were failing on amd64 due to
uninitialized timespec structure.

Fixes:          eeb04a736cb9 date: Add support for nanoseconds
Reviewed by:    markj
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D44975

(cherry picked from commit 7b390cb636899582243e4daa8edbdb30d686d9fb)
DeltaFile
+2-0bin/date/date.c
+2-01 files

FreeBSD/src c40e0bfbin/date date.1

date.1: Note that nanosecond support is to appear first in 14.1

Sponsored by:   Klara, Inc.
DeltaFile
+2-2bin/date/date.1
+2-21 files

FreeBSD/src 54d6fea. RELNOTES

RELNOTES: Mention date(1)'s nanosecond support

Sponsored by:   Klara, Inc.
DeltaFile
+6-0RELNOTES
+6-01 files

FreeBSD/src f16e205lib/libpmc/pmu-events jevents.c

jevents: fix bootstrapping on Linux with Clang 16

The glibc fts_open() callback type does not have the second const
qualifier and it appears that Clang 16 errors by default for mismatched
function pointer types. Add an ifdef to handle this case.

Reviewed By:    imp, emaste
Differential Revision: https://reviews.freebsd.org/D43000

(cherry picked from commit 60e845ceef25533bfb60450549bea56a17b1e467)
DeltaFile
+4-0lib/libpmc/pmu-events/jevents.c
+4-01 files

FreeBSD/src 91e0b44usr.sbin/kldxref kldxref.c

kldxref: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15

macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:      1 week

(cherry picked from commit 75464941dc17876af2e99ea90c687bd7df873d73)
DeltaFile
+1-1usr.sbin/kldxref/kldxref.c
+1-11 files

FreeBSD/src dbbbe6fcontrib/mandoc config.h

mandoc: fix bootstrapping on Linux with Clang 16

It appears that Clang 16 errors by default for the mismatched function
pointer types that are triggered by the fts callback (since glibc has a
callback type without the second const qualifier).
Fortunately, there is already code to handle glibc inside mandoc, we
just have to edit the checked-in config.h.

Reviewed By:    imp, emaste
Differential Revision: https://reviews.freebsd.org/D42999

(cherry picked from commit 0156465c6d11e1ef064d104443047e4146e5b925)
DeltaFile
+4-0contrib/mandoc/config.h
+4-01 files

FreeBSD/src 89342dblib/libpmc/pmu-events jevents.c

jevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15

macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:      1 week

(cherry picked from commit d8c84215d7675b7940412122b6d7026bd193c9b5)
DeltaFile
+1-1lib/libpmc/pmu-events/jevents.c
+1-11 files

FreeBSD/src 2714c4dcontrib/mandoc config.h

mandoc: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15

macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:      1 week

(cherry picked from commit ce312ef72d91888d332f7f042298001794b66914)
DeltaFile
+1-1contrib/mandoc/config.h
+1-11 files

FreeBSD/src 8cb8acalib/libpmc/pmu-events jevents.c

jevents: fix bootstrapping on Linux with Clang 16

The glibc fts_open() callback type does not have the second const
qualifier and it appears that Clang 16 errors by default for mismatched
function pointer types. Add an ifdef to handle this case.

Reviewed By:    imp, emaste
Differential Revision: https://reviews.freebsd.org/D43000

(cherry picked from commit 60e845ceef25533bfb60450549bea56a17b1e467)
DeltaFile
+4-0lib/libpmc/pmu-events/jevents.c
+4-01 files

FreeBSD/src b2d59a3usr.sbin/kldxref kldxref.c

kldxref: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15

macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:      1 week

(cherry picked from commit 75464941dc17876af2e99ea90c687bd7df873d73)
DeltaFile
+1-1usr.sbin/kldxref/kldxref.c
+1-11 files

FreeBSD/src ef69355contrib/mandoc config.h

mandoc: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15

macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:      1 week

(cherry picked from commit ce312ef72d91888d332f7f042298001794b66914)
DeltaFile
+1-1contrib/mandoc/config.h
+1-11 files

FreeBSD/src 9bfc9eacontrib/mandoc config.h

mandoc: fix bootstrapping on Linux with Clang 16

It appears that Clang 16 errors by default for the mismatched function
pointer types that are triggered by the fts callback (since glibc has a
callback type without the second const qualifier).
Fortunately, there is already code to handle glibc inside mandoc, we
just have to edit the checked-in config.h.

Reviewed By:    imp, emaste
Differential Revision: https://reviews.freebsd.org/D42999

(cherry picked from commit 0156465c6d11e1ef064d104443047e4146e5b925)
DeltaFile
+4-0contrib/mandoc/config.h
+4-01 files

FreeBSD/src 9019baflib/libpmc/pmu-events jevents.c

jevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15

macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:      1 week

(cherry picked from commit d8c84215d7675b7940412122b6d7026bd193c9b5)
DeltaFile
+1-1lib/libpmc/pmu-events/jevents.c
+1-11 files

FreeBSD/src d5eae57sys/kern kern_sysctl.c

sysctl: Make sysctl_ctx_free() a bit safer

Clear the list before returning so that sysctl_ctx_free() can be called
more than once on the same list without side effects.  This simplifies
error handling in drivers; previously, drivers would have to be careful
to call sysctl_ctx_free() at most once to avoid a use-after-free.

While here, use TAILQ_FOREACH_SAFE in the loop which unregisters OIDs.

Reviewed by:    thj, emaste
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D45041
DeltaFile
+2-4sys/kern/kern_sysctl.c
+2-41 files

FreeBSD/src 4510f2cshare/man/man5 src.conf.5, share/mk bsd.opts.mk

Make WITHOUT_UNDEFINED_VERSION the default

Link with --no-undefined-version by default.  Will detect and prevent
the accidental removal of symbols from versioned libraries.

Reviewed by:    arichardson, kib, dim, emaste
Differential Revision:  https://reviews.freebsd.org/D44216
DeltaFile
+6-4share/man/man5/src.conf.5
+4-0tools/build/options/WITH_UNDEFINED_VERSION
+2-2share/mk/bsd.opts.mk
+0-2tools/build/options/WITHOUT_UNDEFINED_VERSION
+12-84 files

FreeBSD/src 723e60alib/libcompiler_rt Makefile.inc, lib/libgcc_s Symbol.map

libgcc_s: __extendxftf2 and __trunctfxf2 are amd64-only

__extendxftf2 and __trunctfxf2 build on amd64 not aarch64 and riscv.

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D45052
DeltaFile
+6-4lib/libgcc_s/Symbol.map
+6-2lib/libcompiler_rt/Makefile.inc
+12-62 files

FreeBSD/src afd0c20usr.sbin/ctladm ctladm.c

ctladm: Use nitems() in a few more places

Sponsored by:   Chelsio Communications

Differential Revision:  https://reviews.freebsd.org/D45017
DeltaFile
+3-6usr.sbin/ctladm/ctladm.c
+3-61 files

FreeBSD/src eb3dbf2sys/netinet6 in6.h

in6.h: expose s6_addr* definitions to user level

The only element of of in6_addr that is specified in RFC 3493 or
in POSIX.1-2017 is s6_addr, implemented via a #define to a union
member.  However, FreeBSD and other BSD systems have additional
definitions for the other union members, s6_addr{8,16,32} which
are defined for the kernel and loader.  Some Linux applications
also use them, and they seem to be allowed by the RFC and POSIX.
Remove the current ifdefs, exposing the additional fields to user
level, and replace with #if __BSD_VISIBLE.  Add an explanatory
comment expanding on the previous "nonstandard" comment.

MFC after:      1 week
Reviewed by:    bz
Differential Revision:  https://reviews.freebsd.org/D44979
DeltaFile
+7-1sys/netinet6/in6.h
+7-11 files

FreeBSD/src 19e3355sys/kern kern_kthread.c

kthread: Set *tdptr earlier in kproc_kthread_add()

See commit ae77041e0714 ("kthread: Set *newtdp earlier in
kthread_add1()") for details.  That commit was incomplete since
g_init()'s first call to kproc_kthread_add() will cause
kproc_kthread_add() to take the `*procptr == NULL` branch, which avoids
kthread_create().

To ensure that the thread pointer is initialized before the thread
starts running, we have to start the kernel process with RFSTOPPED.
We could perhaps go further and use RFSTOPPED only when tdptr != NULL,
but it's probably better to have consistent behaviour.

Reviewed by:    olce, kib
Reported by:    syzbot+e91e798f3c088215ace6 at syzkaller.appspotmail.com
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D44927

(cherry picked from commit d66399326cb4f89d1565fb62c1c07974886893c5)
DeltaFile
+9-1sys/kern/kern_kthread.c
+9-11 files

FreeBSD/src 4ee7b8esys/dev/dpaa if_dtsec_rm.c

dpaa: uma_zcreate() does not fail

No functional change intended.

MFC after:      1 week

(cherry picked from commit 964064937ea04519bd400668dc1ce38848d50901)
DeltaFile
+0-4sys/dev/dpaa/if_dtsec_rm.c
+0-41 files