FreeBSD/src a64148esys/compat/linux linux_misc.c linux_misc.h

linux: Add support for PR_SET_VMA to prctl(2)

Implement dummy support for PR_SET_VMA with PR_SET_VMA_ANON_NAME in
prctl(2).  This prevents applications from receiving EINVAL when
attempting to name anonymous memory regions.
DeltaFile
+7-0sys/compat/linux/linux_misc.c
+2-0sys/compat/linux/linux_misc.h
+9-02 files

FreeBSD/src eda74felib/libc/stdlib rand.3

rand(3): Normalize function ordering

Align ordering between NAME & SYNOPSIS sections.

Obtained from:  https://github.com/apple-oss-distributions/libc
Sponsored by:   Klara, Inc.
DeltaFile
+5-5lib/libc/stdlib/rand.3
+5-51 files

FreeBSD/src 7f421c7share/mk bsd.sys.mk

bsd.sys.mk: also suppress gcc -Wc++1[47]-extensions warnings for >= 12

This is a direct commit to stable/14, which does not yet default to
C++17 for most in-tree programs. In some cases, this would trigger gcc
-Wc++1[47]-extensions warnings with libc++ 21.
DeltaFile
+2-0share/mk/bsd.sys.mk
+2-01 files

FreeBSD/src c115aadshare/man/man3 assert.3

assert.3: Update as per C23

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+61-15share/man/man3/assert.3
+61-151 files

FreeBSD/src 0fe73dcinclude assert.h

libc: Add <assert.h> C23 feature test macro

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+3-3include/assert.h
+3-31 files

FreeBSD/src 157c184include assert.h

assert.h: Remove leading tabs for whitespace consistency

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+9-9include/assert.h
+9-91 files

FreeBSD/src 6450212sbin/mdmfs mdmfs.c

mdmfs: Use standard bool definition

Include `<stdbool.h>` instead of defining a local bool enum.
This avoids duplicating a standard type name and keeps the
source compatible with headers that provide bool as a macro,
or in case of C23 that compilers provide it as keyword.

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+1-2sbin/mdmfs/mdmfs.c
+1-21 files

FreeBSD/src c5c7d18include assert.h

libc: Restrict the static_assert macro to pre-C23 modes

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+4-1include/assert.h
+4-11 files

FreeBSD/src 867b514include assert.h

libc: Add variadic assert in accordance with C23

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+35-7include/assert.h
+35-71 files

FreeBSD/src 60c11e7include/rpcsvc yp_prot.h

rpcsvc: Remove obsolete bool definition from yp_prot.h

`yp_prot.h` has carried a SunRPC-era typedef of `bool` guarded by
`BOOL_DEFINED`, but the header itself does not use it. The YP/RPC
interfaces use `bool_t` for protocol booleans.

Defining `bool` in a public header collides with modern C headers
that provide `bool` as a macro or keyword, such as `<stdbool.h>`
and C23-aware assert handling. Drop the compatibility typedef and
leave `bool` definition to the consumer's language mode.

Signed-off-by:  Faraz Vahedi <kfv at kfv.io>
Reviewed by:    fuz
MFC after:      1 month
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
DeltaFile
+0-5include/rpcsvc/yp_prot.h
+0-51 files

FreeBSD/src 2010906sys/kern imgact_elf.c

imgact_elf: add sysctl kern.elfXX.phnums for the number of program headers

that are accepted in the activated image or interpreter.

Requested by:   jhb
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57328
DeltaFile
+12-10sys/kern/imgact_elf.c
+12-101 files

FreeBSD/src 2fa4bddsys/contrib/edk2/Include Base.h

edk2: enable static asserts for *INT64 alignment

The ia32 loader is now built with -malign-double, so these should pass.

Differential Revision:  https://reviews.freebsd.org/D55386
DeltaFile
+0-2sys/contrib/edk2/Include/Base.h
+0-21 files

FreeBSD/src d15cc76stand loader.mk defs.mk, stand/efi Makefile Makefile.inc

stand: compile ia32 EFI loader with -malign-double

The UEFI spec says:
> Structures are aligned on boundaries equal to the largest internal
> datum of the structure and internal data are implicitly padded to
> achieve natural alignment.

Unlike the old Intel EFI toolkit, the EDK2 headers expect ia32 builds to
use -malign-double to achive this.

Make EFI versions of libsa32, liblua32, and ficl32. With the difference
being that they are compiled with -malign-double.

Differential Revision:  https://reviews.freebsd.org/D55385
DeltaFile
+7-1stand/efi/Makefile
+5-0stand/efi/Makefile.inc
+2-2stand/loader.mk
+3-0stand/efi/liblua32efi/Makefile
+3-0stand/efi/ficl32efi/Makefile
+1-1stand/defs.mk
+21-41 files not shown
+22-47 files

FreeBSD/src f048a1atests/sys/netipsec/tunnel Makefile

tests/ipsec: Run in parallel

Use execenv=jail to enable this.

MFC after:      1 week
DeltaFile
+2-2tests/sys/netipsec/tunnel/Makefile
+2-21 files

FreeBSD/src e492ad0sys/netlink/route rt.c

netlink/route: extend pre-2.6.19 Linux compat shim to del/getroute

Commit f34aca55adef ("netlink/route: provide pre-2.6.19 Linux compat shim",
2024-06) fixed the partial fix for net/bird2 on the netlink path by mapping the
legacy 8-bit struct rtmsg::rtm_table field onto the modern 32-bit RTA_TABLE
attribute when the latter is absent.

That fix, however, was only applied to rtnl_handle_newroute. The two sibling
handlers: rtnl_handle_delroute and rtnl_handle_getroute were left looking at
attrs.rta_table directly. They are reachable from exactly the same client
(bird, in its netlink scan path), so any FIB number that fits in 8 bits
silently maps to RT_TABLE_UNSPEC in those handlers.

Reviewed by:    melifaro (previous version)
Approved by:    emaste
MFC after:      1 week
Sponsored by:   Netflix
DeltaFile
+11-3sys/netlink/route/rt.c
+11-31 files

FreeBSD/src 96dbc9asys/netlink/route iface_drivers.c

netlink: Check permissions for interface flag changes

Reviewed by:    pouria, melifaro
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57332
DeltaFile
+10-1sys/netlink/route/iface_drivers.c
+10-11 files

FreeBSD/src 9ddb606sys/netlink/route iface_drivers.c

netlink: Use early exit pattern in _nl_modify_ifp_generic

No functional change.

Reviewed by:    pouria, melifaro
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57349
DeltaFile
+25-28sys/netlink/route/iface_drivers.c
+25-281 files

FreeBSD/src 11f23d7tools/test/stress2/misc msdos22.sh msdos23.sh

tools/test/stress2/misc: Fix and enable new tests

The previously committed versions of these tests failed to prevent
duplicate file names in the list of files to process, leading to
missing files when a "mv" commando tried to operate on a file that
had already been renamed.

The test for filenames containing UTF-16 surrogate pairs stays
disabled, since the required kernel changes have not been committed,
yet.
DeltaFile
+6-8tools/test/stress2/misc/msdos22.sh
+5-7tools/test/stress2/misc/msdos23.sh
+5-7tools/test/stress2/misc/msdos24.sh
+0-2tools/test/stress2/misc/all.exclude
+16-244 files

FreeBSD/src e021144usr.sbin/acpi/acpidb Makefile

Work around unterminated-string-initialization warnings in acpidb

ACPICA 20250807 fixes these warnings by adding nonstring attributes, but
since ACPICA in stable/14 has not been updated for quite some time,
suppress the warning for clang >= 21 instead. Direct commit to
stable/14, since stable/15 and main already have ACPICA 20250807.
DeltaFile
+4-0usr.sbin/acpi/acpidb/Makefile
+4-01 files

FreeBSD/src 47f4f76sys/sys param.h

Bump __FreeBSD_version for llvm 21.1.8 merge

PR:             292067
MFC after:      1 month

(cherry picked from commit 8f95b8b19088bd8d73f6d14dab7afe848dfc0c35)
DeltaFile
+1-1sys/sys/param.h
+1-11 files

FreeBSD/src ec67978lib/clang/include/llvm/Config config.h

Fix up builds on Linux hosts after llvm 21.1.8 merge

This is because contrib/llvm-project/llvm/lib/Support/Unix/Threading.inc
attempts to use pthread_get_name_np(3) and pthread_set_name_np(3), which
are not defined on Linux.

Reported by:    ivy
PR:             292067
MFC after:      1 month

(cherry picked from commit b6d823e39072daae9df4b47a15ea7142b7a55f1a)
DeltaFile
+4-0lib/clang/include/llvm/Config/config.h
+4-01 files

FreeBSD/src 0c6a058contrib/llvm-project/clang/lib/Headers emmintrin.h xmmintrin.h

Merge commit b0d2b57f7e47 from llvm git (by Phoebe Wang):

  [Headers][X86] Remove more duplicated typedefs (#153820)

  They are defined in mmintrin.h

This fixes a -Werror warning in openzfs, which compiles for C99, and C99
does not allow for typedef redefinitions.

PR:             292067
MFC after:      1 month

(cherry picked from commit 20450c2e792084f06974cff9d2338e2d0406883f)
DeltaFile
+0-4contrib/llvm-project/clang/lib/Headers/emmintrin.h
+0-1contrib/llvm-project/clang/lib/Headers/xmmintrin.h
+0-52 files

FreeBSD/src 2e97bf2contrib/llvm-project/libcxx/src iostream.cpp

Merge commit c1d26c3c2510 from llvm git (by Nikolas Klauser):

  [libc++] Fix iostream size ABI break (#185839)

  In #124103 we changed the size of various iostream objects, which turns
  out to be ABI breaking when compiling non-PIE code.

  This ABI break is safe to fix, since for any programs allocating more
  memory for the iostream objects, the remaining bytes are simply unused
  now.

  Fixes #185724

This fixes the ABI break that causes programs that use the standard
streams to terminate in various interesting ways, usually by throwing an
unexpected std::bad_cast exception.

PR:             292067
MFC after:      1 month

    [2 lines not shown]
DeltaFile
+55-36contrib/llvm-project/libcxx/src/iostream.cpp
+55-361 files

FreeBSD/src 0b78483contrib/llvm-project/llvm/include/llvm/Option OptParser.td

Add a comment to llvm's OptParser.td, so dependent files get rebuilt.

PR:             292067
MFC after:      1 month

(cherry picked from commit 3cbf898fb49fe087cdcafe2745cca3f7a20f4388)
DeltaFile
+2-0contrib/llvm-project/llvm/include/llvm/Option/OptParser.td
+2-01 files

FreeBSD/src e4ec227. ObsoleteFiles.inc

Remove usr/include/c++/v1/__fwd/get.h from ObsoleteFiles.inc.

PR:             292067
MFC after:      1 month

(cherry picked from commit b99d02027a0fe2e9f9a4aeb6fa3484847ddc5a57)
DeltaFile
+0-1ObsoleteFiles.inc
+0-11 files

FreeBSD/src b50d6ddshare/mk bsd.sys.mk

bsd.sys.mk: also suppress clang -Wc++1[47]-extensions warnings for >= 19

This is a direct commit to stable/14, which does not yet default to
C++17 for most in-tree programs. In some cases, this would trigger
-Wc++1[47]-extensions warnings with libc++ 21.
DeltaFile
+2-0share/mk/bsd.sys.mk
+2-01 files

FreeBSD/src 8bf7343. ObsoleteFiles.inc, contrib/llvm-project/libcxx/include stdint.h cstdint

Revert 00bee6fcd77f, which partially reverted libc++ commit aa7f377c965c

After base 966fb94cb357, this revert is no longer necessary: stdint.h
will unconditionally define macros such as `SIZE_MAX`, `UINT64_C`, and
others.

Submitted by:   Nikolas Klauser <nikolasklauser at berlin.de>
MFC after:      1 month
Reviewed by:    imp
Differential Revision: https://reviews.freebsd.org/D56746

(cherry picked from commit 19ff93c921a9d31770bcfc194c078e7a42a5f14f)
DeltaFile
+0-127contrib/llvm-project/libcxx/include/stdint.h
+0-8contrib/llvm-project/libcxx/include/cstdint
+0-4lib/libc++/module.modulemap
+3-0ObsoleteFiles.inc
+0-1lib/libc++/Makefile
+3-1405 files

FreeBSD/src 2e6734econtrib/llvm-project/clang/lib/Sema SemaTemplateDeduction.cpp

Merge commit 787ba2426148 from llvm git (by Matheus Izvekov):

  [clang] create local instantiation scope for matching template template parameters (#183219)

  This fixes a bug where a partial substitution from the enclosing scope
  is used to prepopulate an unrelated template argument deduction.

  Fixes #181166

This fixes an expected error when building the devel/catch port.

PR:             292067
MFC after:      1 month

(cherry picked from commit 5ac874516b27474ab5b3d195544c72fb04b4b86e)
DeltaFile
+2-0contrib/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp
+2-01 files

FreeBSD/src 4a5ad04contrib/llvm-project/libcxx/include/__cxx03/__type_traits add_lvalue_reference.h add_rvalue_reference.h

Fixup mismerge in __cxx03/__type_traits/add_[lr]value_reference.h.

PR:             292067
MFC after:      1 month

(cherry picked from commit 0f15398d123a9cf02711efddf5e4040f0066c6de)
DeltaFile
+1-1contrib/llvm-project/libcxx/include/__cxx03/__type_traits/add_lvalue_reference.h
+1-1contrib/llvm-project/libcxx/include/__cxx03/__type_traits/add_rvalue_reference.h
+2-22 files

FreeBSD/src fc1ab22contrib/llvm-project/clang/lib/Sema AnalysisBasedWarnings.cpp

Merge commit 871038759afb from llvm git (by Marco Elver):

  Thread Safety Analysis: Fix pointer handling of variables with deprecated attributes (#148974)

  de10e44b6fe7 ("Thread Safety Analysis: Support warning on
  passing/returning pointers to guarded variables") added checks for
  passing pointer to guarded variables. While new features do not
  necessarily need to support the deprecated attributes (`guarded_var`,
  and `pt_guarded_var`), we need to ensure that such features do not cause
  the compiler to crash.

  As such, code such as this:

          struct {
            int v __attribute__((guarded_var));
          } p;

          int *g() {
            return &p.v;  // handleNoMutexHeld() with POK_ReturnPointer

    [26 lines not shown]
DeltaFile
+20-5contrib/llvm-project/clang/lib/Sema/AnalysisBasedWarnings.cpp
+20-51 files