FreeBSD/src b6d823elib/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
DeltaFile
+4-0lib/clang/include/llvm/Config/config.h
+4-01 files

FreeBSD/src 4137c67stand/man loader.efi.8

loader.efi(8): Document LoaderEnv and NextLoaderEnv EFI variables

Describe how the LoaderEnv and NextLoaderEnv variables can be used.

PR:                     293054
Reviewed by:            imp
Sponsored by:           Wiesbaden Hackathon 202604
Differential Revision:  https://reviews.freebsd.org/D56633
DeltaFile
+37-4stand/man/loader.efi.8
+37-41 files

FreeBSD/src ed82c43stand/man loader.efi.8

Revert "loader.efi(8): Document LoaderEnv and NextLoaderEnv EFI variables"

This reverts commit cf7d4b04e9ae890f2a0f5811234e926f75a0c237.

I attributed the wrong author of the patch.
DeltaFile
+4-37stand/man/loader.efi.8
+4-371 files

FreeBSD/src cf7d4b0stand/man loader.efi.8

loader.efi(8): Document LoaderEnv and NextLoaderEnv EFI variables

Describe how the LoaderEnv and NextLoaderEnv variables can be used.

PR:                     293054
Reviewed by:            imp
Sponsored by:           Wiesbaden Hackathon 202604
Differential Revision:  https://reviews.freebsd.org/D56633
DeltaFile
+37-4stand/man/loader.efi.8
+37-41 files

FreeBSD/src 1566386usr.sbin/bsdinstall/scripts rootpass

bsdinstall: fix root password prompt with backslashes

Use "read -r" to set the root password in "bsdinstall rootpass" to
prevent issues with passwords containing one or more backslash
characters.

PR:             294781
Discussed with: tuexen, crest
Approved by:    khorben
MFC after:      3 days
Event:          Wiesbaden Hackathon 202604
DeltaFile
+2-2usr.sbin/bsdinstall/scripts/rootpass
+2-21 files

FreeBSD/src f890f8eusr.sbin/mfiutil mfi_drive.c Makefile

mfiutil(8): "show drives" truncates information

Improve mfi_pd_inq_string() by
* Reusing buffer sizes from cam/cam.h according to SCSI specification + NULL byte
* Don't truncate vendor-specific information by escaping into a too small buffer
* Use cam_strvis() from libcam instead of old, outdated local copy
* Recaculate size of inq_string based on the reused buffer sizes and
  format statements

PR:             294354
Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56328

(cherry picked from commit 850eb149e7ab0733fcf9469a607dca223ff467ad)
DeltaFile
+12-47usr.sbin/mfiutil/mfi_drive.c
+1-1usr.sbin/mfiutil/Makefile
+13-482 files

FreeBSD/src eb55ca2usr.sbin/mfiutil mfi_drive.c Makefile

mfiutil(8)/mrsasutil(8): "show drives" truncates information

Improve mfi_pd_inq_string() by
* Reusing buffer sizes from cam/cam.h according to SCSI specification + NULL byte
* Don't truncate vendor-specific information by escaping into a too small buffer
* Use cam_strvis() from libcam instead of old, outdated local copy
* Recaculate size of inq_string based on the reused buffer sizes and
  format statements

PR:             294354
Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56328

(cherry picked from commit 850eb149e7ab0733fcf9469a607dca223ff467ad)
DeltaFile
+12-47usr.sbin/mfiutil/mfi_drive.c
+1-1usr.sbin/mfiutil/Makefile
+13-482 files

FreeBSD/src 3541e09usr.sbin/mfiutil mfi_drive.c Makefile

mfiutil(8)/mrsasutil(8): "show drives" truncates information

Improve mfi_pd_inq_string() by
* Reusing buffer sizes from cam/cam.h according to SCSI specification + NULL byte
* Don't truncate vendor-specific information by escaping into a too small buffer
* Use cam_strvis() from libcam instead of old, outdated local copy
* Recaculate size of inq_string based on the reused buffer sizes and
  format statements

PR:             294354
Reviewed by:    imp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56328

(cherry picked from commit 850eb149e7ab0733fcf9469a607dca223ff467ad)
DeltaFile
+12-47usr.sbin/mfiutil/mfi_drive.c
+1-1usr.sbin/mfiutil/Makefile
+13-482 files

FreeBSD/src 8f95b8bsys/sys param.h

Bump __FreeBSD_version for llvm 21.1.8 merge

PR:             292067
MFC after:      1 month
DeltaFile
+1-1sys/sys/param.h
+1-11 files

FreeBSD/src 3cbf898contrib/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
DeltaFile
+2-0contrib/llvm-project/llvm/include/llvm/Option/OptParser.td
+2-01 files

FreeBSD/src 20450c2contrib/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
DeltaFile
+0-4contrib/llvm-project/clang/lib/Headers/emmintrin.h
+0-1contrib/llvm-project/clang/lib/Headers/xmmintrin.h
+0-52 files

FreeBSD/src 0f15398contrib/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
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 4fc1fddcontrib/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
DeltaFile
+55-36contrib/llvm-project/libcxx/src/iostream.cpp
+55-361 files

FreeBSD/src 1dfe63econtrib/llvm-project/clang/lib/Sema SemaOverload.cpp

Merge commit d803c61aca0d from llvm git (by Corentin Jabot):

  [Clang] Fix a regression introduced by #147046 (#150893)

  Static functions have an implicit object argument during deduction.

This fixes an assertion while compiling the devel/corrade port.

PR:             292067
MFC after:      1 month
DeltaFile
+2-2contrib/llvm-project/clang/lib/Sema/SemaOverload.cpp
+2-21 files

FreeBSD/src 5ac8745contrib/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
DeltaFile
+2-0contrib/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp
+2-01 files

FreeBSD/src 987ac31contrib/llvm-project/libcxx/include/__exception exception_ptr.h

libcxx-compat: fix llvmorg-21-init-18351-gfcc09b6f0267:

  [libc++] Fix std::make_exception_ptr interaction with ObjC (#135386)

  Clang treats throwing/catching ObjC types differently from C++ types,
  and omitting the `throw` in `std::make_exception_ptr` breaks ObjC
  invariants about how types are thrown/caught.

  Fixes #135089

  Co-authored-by: Louis Dionne <ldionne.2 at gmail.com>

Only use lambdas when in !defined(_LIBCPP_CXX03_LANG), so this will
compile with clang 18 and lower, in C++03 mode and earlier.

PR:             292067
MFC after:      1 month
DeltaFile
+1-1contrib/llvm-project/libcxx/include/__exception/exception_ptr.h
+1-11 files

FreeBSD/src 17f1a5econtrib/llvm-project/libcxx/include istream streambuf

libcxx-compat: fix llvmorg-21-init-12415-g3a86e0bd29f3:

  [libc++] Optimize std::getline (#121346)

  ```
  -----------------------------------------------
  Benchmark                   old             new
  -----------------------------------------------
  BM_getline_string        318 ns         32.4 ns
  ```

Move the __bump_stream() lamda in <istream> to a separate function, so
this will compile with clang 18 and lower, in C++03 mode and earlier.

PR:             292067
MFC after:      1 month
DeltaFile
+15-13contrib/llvm-project/libcxx/include/istream
+4-0contrib/llvm-project/libcxx/include/streambuf
+19-132 files

FreeBSD/src b99d020. ObsoleteFiles.inc

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

PR:             292067
MFC after:      1 month
DeltaFile
+0-1ObsoleteFiles.inc
+0-11 files

FreeBSD/src 3fd7962contrib/llvm-project/clang/lib/Sema SemaExpr.cpp

Merge commit 924f773f5e26 from llvm git (by Younan Zhang):

  [Clang] Don't diagnose missing members when looking at the instantiating class template (#180725)

  The perfect matching patch revealed another bug where recursive
  instantiations could lead to the escape of SFINAE errors, as shown in
  the issue.

  Fixes https://github.com/llvm/llvm-project/issues/179118

This fixes compile errors in the www/qt5-webengine port.

PR:             292067
MFC after:      1 month
DeltaFile
+1-1contrib/llvm-project/clang/lib/Sema/SemaExpr.cpp
+1-11 files

FreeBSD/src a114ececontrib/llvm-project/libcxx/include/__type_traits remove_reference.h

libcxx-compat: revert llvmorg-19-init-5639-ga10aa4485e83:

  [libc++] Simplify the implementation of remove_reference (#85207)

  GCC 13 introduced the type trait `__remove_reference`. We can simplify
  the implementation of `remove_reference` a bit by using it.

This is part of making libc++ 21 build with clang 18.

PR:             292067
MFC after:      1 month
DeltaFile
+8-1contrib/llvm-project/libcxx/include/__type_traits/remove_reference.h
+8-11 files

FreeBSD/src 035396ccontrib/llvm-project/libcxx/include/__type_traits is_convertible.h

libcxx-compat: revert llvmorg-21-init-10154-ge43e8ec7afbd:

  [libc++] Remove dead implementation of is_nothrow_convertible and merge the remaining code into is_convertible.h (#137717)

  We can use the `__is_nothrow_convertible` builtin unconditionally now,
  which makes the implementation very simple, so there isn't much of a
  need to keep a separate header around.

This is part of making libc++ 21 build with clang 18.

PR:             292067
MFC after:      1 month
DeltaFile
+26-0contrib/llvm-project/libcxx/include/__type_traits/is_convertible.h
+26-01 files

FreeBSD/src 5465db3contrib/llvm-project/libcxx/include/__bit popcount.h

libcxx-compat: revert llvmorg-21-init-8400-g703cfe745b96:

  [libc++] Replace __libcpp_popcount by __builtin_popcountg (#133937)

  `__libcpp_popcount` was previously used as a fallback for `__builtin_popcountg` to ensure compatibility with older compilers (Clang 18 and earlier), as `__builtin_popcountg` became available in Clang 19. Now that support for Clang 18 has been officially dropped in #130142, we can now safely  replace all instances of `__libcpp_popcount` with `__builtin_popcountg` and eliminate the fallback logic.

This is part of making libc++ 21 build with clang 18.

PR:             292067
MFC after:      1 month
DeltaFile
+29-0contrib/llvm-project/libcxx/include/__bit/popcount.h
+29-01 files

FreeBSD/src bb6713dcontrib/llvm-project/libcxx/include/__memory pointer_traits.h

libcxx-compat: revert llvmorg-21-init-15984-g650b451d0065:

  [libc++] Simplify the implementation of pointer_traits a bit (#142260)

This is part of making libc++ 21 build with clang 18.

PR:             292067
MFC after:      1 month
DeltaFile
+84-34contrib/llvm-project/libcxx/include/__memory/pointer_traits.h
+84-341 files

FreeBSD/src 821fc64contrib/llvm-project/libcxx/include/__bit countr.h countl.h

libcxx-compat: revert llvmorg-21-init-9130-g9e3982d9ae81:

  [libc++] Replace __libcpp_{ctz, clz} with __builtin_{ctzg, clzg} (#133920)

  `__libcpp_{ctz, clz}` were previously used as fallbacks for `__builtin_{ctzg, clzg}` to ensure compatibility with older compilers (Clang 18 and earlier), as `__builtin_{ctzg, clzg}` became available in Clang 19. Now that support for Clang 18 has been officially dropped in #130142, we can now safely  replace all instances of `__libcpp_{ctz, clz}` with `__count{l,r}_zero` (which internally call `__builtin_{ctzg, clzg}` and eliminate the fallback logic.

  Closes #131179.

This is part of making libc++ 21 build with clang 18.

PR:             292067
MFC after:      1 month
DeltaFile
+33-0contrib/llvm-project/libcxx/include/__bit/countr.h
+28-0contrib/llvm-project/libcxx/include/__bit/countl.h
+61-02 files

FreeBSD/src 7351d00contrib/llvm-project/clang/lib/Format QualifierAlignmentFixer.cpp UnwrappedLineParser.cpp, contrib/llvm-project/compiler-rt/lib/sanitizer_common sanitizer_linux.cpp

Merge llvm-project release/21.x llvmorg-21.1.8-0-g2078da43e25a

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/21.x llvmorg-21.1.8-0-g2078da43e25a,
a.k.a. 21.1.8 release.

PR:             292067
MFC after:      1 month
DeltaFile
+13-4contrib/llvm-project/clang/lib/Format/QualifierAlignmentFixer.cpp
+14-0contrib/llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp
+10-2contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+4-4contrib/llvm-project/clang/lib/Format/UnwrappedLineParser.cpp
+3-3lib/clang/include/lldb/Version/Version.inc
+3-3lib/clang/include/VCSVersion.inc
+47-1612 files not shown
+74-3018 files

FreeBSD/src 4822a2cstand/powerpc/boot1.chrp Makefile

Tentative fix for powerpc boot1.chrp linking problem.

PR:             292067
MFC after:      1 month
DeltaFile
+6-0stand/powerpc/boot1.chrp/Makefile
+6-01 files

FreeBSD/src 48c35aecontrib/llvm-project/llvm/lib/Target/PowerPC PPCReduceCRLogicals.cpp

Merge commit 598f21e9fcf7 from llvm git (by zhijian lin):

  [PowerPC] need to set CallFrameSize for the pass  PPCReduceCRLogicals when insert a new block (#151017)

  In the [ [CodeGen] Store call frame size in
  MachineBasicBlock](https://reviews.llvm.org/D156113), it mentions When a
  basic block has been split in the middle of a call sequence. the call
  frame size may not be zero, it need to set the setCallFrameSize for the
  new MachineBasicBlock. but in the function `splitMBB(BlockSplitInfo
  &BSI)` in the llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp , it do
  not setCallFrameSzie for the new MachineBasicBlock `NewMBB`, we will
  setCallFrameSzie in the patch.

  the patch fix the crash mention in
  https://github.com/llvm/llvm-project/pull/144594#issuecomment-2993736654

This fixes "error in backend: Found 1 machine code errors" while
crypto/openssh/packet.c for PowerPC64.


    [2 lines not shown]
DeltaFile
+4-0contrib/llvm-project/llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp
+4-01 files

FreeBSD/src f7bcd8dcontrib/llvm-project/libcxx/include/__type_traits add_reference.h decay.h

libcxx-compat: revert llvmorg-21-init-17684-gae9990ed9651:

  [libc++] Remove dead code from <type_traits> (#143854)

  Since we've upgraded to GCC 15 now, we can remove a bunch of dead code
  from `<type_traits>`.

This is part of making libc++ 21 build with GCC 14.

PR:             292067
MFC after:      1 month
DeltaFile
+45-18contrib/llvm-project/libcxx/include/__type_traits/add_reference.h
+42-10contrib/llvm-project/libcxx/include/__type_traits/decay.h
+33-0contrib/llvm-project/libcxx/include/__type_traits/is_pointer.h
+22-2contrib/llvm-project/libcxx/include/__type_traits/is_array.h
+18-5contrib/llvm-project/libcxx/include/__type_traits/remove_all_extents.h
+18-5contrib/llvm-project/libcxx/include/__type_traits/remove_extent.h
+178-404 files not shown
+223-5710 files

FreeBSD/src 718e587contrib/llvm-project/libc/include/llvm-libc-macros float-macros.h

llvm-libc-macros: work around gcc defining LDBL_MANT_DIG as 53 on i386

Otherwise, gcc will not be able to compile parts of libc++ 21 in -m32
mode, resulting in errors similar to:

    In file included from /usr/src/contrib/llvm-project/libc/shared/str_to_float.h:13,
                     from /usr/src/contrib/llvm-project/libcxx/src/include/from_chars_floating_point.h:14,
                     from /usr/src/contrib/llvm-project/libcxx/src/charconv.cpp:12:
    /usr/src/contrib/llvm-project/libc/src/__support/str_to_float.h: In function 'void __llvm_libc::internal::set_implicit_bit(__llvm_libc::fputil::FPBits<T>&) [with T = long double]':
    /usr/src/contrib/llvm-project/libc/src/__support/str_to_float.h:77:10: error: 'struct __llvm_libc::fputil::FPBits<long double>' has no member named 'set_implicit_bit'
       77 |   result.set_implicit_bit(result.get_biased_exponent() != 0);
          |          ^~~~~~~~~~~~~~~~

PR:             292067
MFC after:      1 month
DeltaFile
+5-0contrib/llvm-project/libc/include/llvm-libc-macros/float-macros.h
+5-01 files

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

Partially revert libc++ commit aa7f377c965c, restoring stdint.h

This partially reverts upstream libc++ commit aa7f377c965c:

  [libc++] Remove libc++'s own stdint.h and locale.h (#107436)

  These headers are not doing anything beyond the system or compiler
  provided equivalent headers, so there's no real reason to keep them
  around. Reducing the number of C headers we provide in libc++ simplifies
  our header layering and reduces the potential for confusion when headers
  are layered incorrectly.

The problem is that libc++'s own `stdint.h` _does_ do something: it
defines `__STDC_LIMIT_MACROS` and `__STDC_CONSTANT_MACROS` before
including the system `stdint.h`, causing the latter to expose macros
like `SIZE_MAX`, `UINT64_C`, and others.

If the `__STDC_LIMIT_MACROS` and `__STDC_CONSTANT_MACROS` macros are not
exposed, C++ programs compiled for standards before C++11 can fail with

    [4 lines not shown]
DeltaFile
+127-0contrib/llvm-project/libcxx/include/stdint.h
+8-0contrib/llvm-project/libcxx/include/cstdint
+4-0lib/libc++/module.modulemap
+1-0lib/libc++/Makefile
+0-1ObsoleteFiles.inc
+140-15 files