Commit graph

277381 commits

Author SHA1 Message Date
Colin Percival 6b8ca8c4e4 release: Support r/o /usr/ports for cloudware
Set WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles when building tools
needed for uploading cloudware images.

While I'm here, adjust the bsdec2-image-upload build target to match
the style used by the Azure/GCE/Vagrant Makefiles.

MFC after:	3 days

(cherry picked from commit 6c87aed39c)
2024-04-23 22:04:06 -07:00
Colin Percival 1b0e859897 release/Makefile.vm: Support read-only ports tree
Build qemu (if needed) with WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles
so that we can have a read-only /usr/ports and don't contaminate it.  This
became an issue when I enabled parallel release building, since one image
might be creating its ports.txz file at the same time as we're building
qemu as a prerequisite for building another image.

MFC after:	5 days

(cherry picked from commit 6f454c211b)
2024-04-23 22:02:02 -07:00
Dimitry Andric 7929070fb7 Merge llvm-project release/18.x llvmorg-18.1.4-0-ge6c3289804a6
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.4-0-ge6c3289804a6.

PR:		276104
MFC after:	3 days

(cherry picked from commit dfa39133b3)
2024-04-23 19:33:14 +02:00
Gordon Bergling 78de6a587c NOTES: Remove a double word in comment
- s/of of/of/

(cherry picked from commit 1ff65c57e3)
2024-04-23 07:26:55 +02:00
Gordon Bergling 4cea50b47d arm64: Remove a double word in a source code comment
- s/of of/of/

(cherry picked from commit 516e591db1)
2024-04-23 07:26:42 +02:00
Gordon Bergling cdadad917e ifconfig(8): Fix two typos in source code comments
- s/the the/the/

(cherry picked from commit 68b9eb9185)
2024-04-23 07:26:30 +02:00
Gordon Bergling 4fef442e75 bhnd(4): Remove a double word in a source code comment
- s/of of/of/

(cherry picked from commit d2747968c0)
2024-04-23 07:26:15 +02:00
Gordon Bergling 8e73397eb6 safe(4): Remove a double word in a source code comment
- s/of of/of/

(cherry picked from commit 1bbdcf62d3)
2024-04-23 07:26:00 +02:00
Gordon Bergling b6ddbb47e1 binmiscctl.8: Remove a double word
- s/the the/the/

(cherry picked from commit 5235e9d646)
2024-04-23 07:25:10 +02:00
Gordon Bergling db6bf2d09b usb(4): Remove a double word in a source code comment
- s/of of/of/

(cherry picked from commit 604511f84a)
2024-04-23 07:24:57 +02:00
Konstantin Belousov ed9f44083d rtld(1): minor clarification for LD_STATIC_TLS_EXTRA
(cherry picked from commit 8d74737035)
2024-04-23 03:32:54 +03:00
Stephen J. Kiernan 57d49c4bcb rtld: introduce STATIC_TLS_EXTRA
(cherry picked from commit 95335dd3c1)
2024-04-23 03:32:54 +03:00
Dimitry Andric b449894978 share/mk/bsd.cpu.mk: add F16C feature for i386 and amd64 architectures
As discussed in bug 278417, some ports require the F16C instruction set
to compile, but there is no way yet to detect whether the currently
chosen CPUTYPE supports this feature.

Add the feature to the MACHINE_CPU variable, for each processor that
supports it. The list of processors was extracted from clang 18's -dM
output, filtered on the __F16C__ define.

PR:		278417
Reviewed by:	brooks, emaste
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D44848

(cherry picked from commit 2fd73b7126)
2024-04-21 21:02:09 +02:00
Daniel Engberg a45dd98445 share/mk/bsd.cpu.mk: Add AMD Zen 4 for x86
Main difference between older Zen variants is that this supports AVX-512

Reviewed by:	imp (previous version), emaste
Approved by:	emaste
Differential Revision:	https://reviews.freebsd.org/D41331

(cherry picked from commit ed3fb74e44)
2024-04-21 21:02:09 +02:00
Greg V ce159ac62d bsd.cpu.mk: add support for x86-64-v[234] levels as CPUTYPE
These are supported in LLVM 12 and GCC 11:

https://github.com/llvm/llvm-project/commit/012dd42e027e
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=324bec558e95584e8c1997575ae9d75978af59f1

Differential Revision:	https://reviews.freebsd.org/D29150

(cherry picked from commit 362fef2f4a)
2024-04-21 21:02:08 +02:00
Jung-uk Kim 445aa3bcc5 bsd.cpu.mk: Correct MACHINE_CPU for Intel Alder Lake
Apparently Intel Alder Lake lacks AVX-512 instructions.

Fixes:		09e7341c5e "Catch up with Clang 12"
(cherry picked from commit e80145525b)
2024-04-21 21:02:08 +02:00
Jung-uk Kim 562855795e Catch up with Clang 12.
Add "znver3" for AMD and "alderlake" and "sapphirerapids" for Intel.

(cherry picked from commit 09e7341c5e)
2024-04-21 21:02:07 +02:00
Andriy Gapon 9c444571ab aw_gpio: temporarily switch to input function if read in eint mode
This is needed for gpiokeys driver that needs to read input state after
receiving an interrupt for either edge.

PR:		248138

(cherry picked from commit b98558e69b)
2024-04-21 15:32:16 +03:00
Andriy Gapon f12a50fed2 Revert "dtrace: make 'ring' and 'fill' policies imply 'noswitch' flag"
This reverts commit e92491d95f.
It was cherry-picked as f0ed49921c.

The general idea looked good to me.  In particular, it allowed to save
some memory and avoid memory allocation failures when a large buffer
size was requested along with ring and fill policies.

But I didn't take into account that the second, supposedly unused
buffer, was actually used as the scratch buffer.  The scratch buffer is
used as a temporary space for DTrace subroutines like copyin, copyinstr,
and alloca.

I think that the change can be fixed by allocating a separate smaller
buffer for the scratch buffer, but that fix would require more work than
I am able to do now.  Hence the revert.

Reported by:	Domagoj Stolfa
Diagnosed by:	Domagoj Stolfa, markj

(cherry picked from commit b9827c007a)
2024-04-21 15:28:59 +03:00
Gordon Bergling c61eb1679d oce(4): Fix a typo in a source code comment
- s/addres/address/

(cherry picked from commit e991acd5d0)
2024-04-21 09:35:02 +02:00
Gordon Bergling 39ccab474a muge(4): Fix a typo in a source code comment
- s/addres/address/

(cherry picked from commit 046fe202e7)
2024-04-21 09:34:51 +02:00
Gordon Bergling 36a642a06d netpfil: Fix typos in source code comments
- s/addres/address/

(cherry picked from commit 8ce3ef5f35)
2024-04-21 09:34:36 +02:00
Xin LI c5179c2b8a amdsmn(4), amdtemp(4): add support for AMD Family 19h Models 10h-1Fh.
Tested on AMD Threadripper 7960X.

PR:		kern/278311
Tested by:	jbo

(cherry picked from commit 51c69c8682)
2024-04-20 20:19:01 -07:00
Dimitry Andric 055e875e60 Bump __FreeBSD_version for llvm 18.1.3 merge
PR:		276104
MFC after:	1 month

(cherry picked from commit 0192eda105)
2024-04-20 12:29:10 +02:00
Dimitry Andric 667a595fee tau32-ddk.c: suppress warning about ignored attributes
This driver is heavily obfuscated, and causes a -Werror warning with
clang 18 now:

  sys/dev/ce/tau32-ddk.c:358:10: error: 'const' attribute on function returning 'void'; attribute ignored [-Werror,-Wignored-attributes]
    358 | ((const))nvqbt(void){__asm __volatile("repe; nop; repe; nop;"
        |          ^

Supress the warning since the driver can never be fixed. Direct commit
to stable/13, since the driver has been removed in 14.x and later.

PR:		276104
2024-04-20 12:29:10 +02:00
Brooks Davis 82d22a88c3 libgcc_{eh,s}: restore __*_frame_info symbols post llvm18
The upstream llvm commit 5eb44df1b64d made the addition of these GCC
compatability symbols dependent on build configuration rather than
hardcoded for amd64, i386, and powerpc.  Reenable them.

Reviewed by:	dim
Differential Revision:	https://reviews.freebsd.org/D44877

(cherry picked from commit 0b9e358580)
2024-04-20 12:29:10 +02:00
Dimitry Andric 50fd2fbec9 libcompiler_rt Makefile.inc: update _Float16/__bf16 checks
Clang supports __bf16 for riscv from version 18.0 onwards, so update the
checks for it. While here, rewrite the checks so they are hopefully more
readable, and also handle gcc a little better.

In addition, define COMPILER_RT_HAS_FLOAT16 and COMPILER_RT_HAS_BFLOAT16
when these features should be available, since there are some parts in
compiler-rt that check for these defines.

PR:		276104
MFC after:	1 month

(cherry picked from commit f276adc148)
2024-04-20 12:29:10 +02:00
Dimitry Andric 5b763c0e1f Merge commit 37b7207651b4 from llvm-project (by zhongyunde@huawei.com):
[SimplifyCFG] Fix crash when there is unreachable large index (#88616)

  The large case index out of scope is dead code, but it is still be
  created for TableContents in SwitchLookupTable::SwitchLookupTable,
  so make sure the table size after growing should not get smaller.

  Fix https://github.com/llvm/llvm-project/issues/88607

This should fix "Assertion failed: (idx < size()), function operator[]"
when building the science/dynare port.

PR:		276104, 278320
Reported by:	yuri
MFC after:	1 month

(cherry picked from commit 514c98ba14)
2024-04-20 12:29:10 +02:00
Dimitry Andric bf7e13e690 sanitizers: mark __elf_aux_vector as weak, to allow linking without libsys
After libsys was introduced, linking sanitized programs started failing
with:

  # c++ -fsanitize=address main.cc
  ld: error: undefined symbol: __elf_aux_vector
  >>> referenced by sanitizer_linux_libcdep.cpp:950 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp:950)
  >>>		    sanitizer_linux_libcdep.o:(__sanitizer::ReExec()) in archive /usr/lib/clang/17/lib/freebsd/libclang_rt.asan-x86_64.a
  c++: error: linker command failed with exit code 1 (use -v to see invocation)

Mark __elf_aux_vector as weak in the internal sanitizer declaration, so
the linker will accept it at link time. The dynamic linker will then
take care of the symbol at run time.

Suggestion by:	brooks
PR:		276104, 277393
MFC after:	1 month

(cherry picked from commit 8b181c2fba)
2024-04-20 12:29:10 +02:00
Dimitry Andric 70ab6e9b18 Revert commit 925a11a5f221 from llvm-project (by Nikolas Klauser):
[libc++] Simplify is_convertible

  GCC 13 has added __is_convertible(), so we don't need to keep the fallback implementation around.

  Reviewed By: #libc, Mordante

  Spies: Mordante, libcxx-commits

  Differential Revision: https://reviews.llvm.org/D157939

This should allow buildworld with gcc 12 to work again.

PR:		276104
MFC after:	1 month

(cherry picked from commit 2365f01295)
2024-04-20 12:29:10 +02:00
Dimitry Andric ac652ee7fb Merge commit 55c466da2f2f from llvm-project (by Benjamin Kramer):
[X86][AVX512BF16] Add a few missing insert/extract patterns

  These are really the same as the f16 (and i16) instructions, but we need
  them for any type that can occur.

Merge commit 2e4e04c59043 from llvm-project (by Phoebe Wang):

  [X86][BF16] Do not lower to VCVTNEPS2BF16 without AVX512VL (#86395)

  Fixes: #86305

These should fix "fatal error: error in backend: Cannot select: t71:
v32bf16 = insert_subvector t67, t64, Constant:i32<16>" when building the
misc/ncnn port.

PR:		278305
Reported by:	yuri
MFC after:	1 month

(cherry picked from commit 78d3648e73)
2024-04-20 12:29:10 +02:00
Dimitry Andric 3f0f6c9806 libllvm: add missed tlbgen headers and sources for BPF target
Noticed by:	vishwin
PR:		276104
MFC after:	1 month

(cherry picked from commit 442d351bd2)
2024-04-20 12:29:09 +02:00
Dimitry Andric 7334d08a3a libcompiler_rt Makefile.inc: include bsd.compiler.mk to fix build
Apparently libgcc_s has always included libcompiler_rt's Makefile.inc
without first including bsd.compiler.mk, even though Makefile.inc used
COMPILER_TYPE already. It looks like we were just lucky that the
expression was not malformed.

PR:		276104
Reported by:	Herbert J. Skuhra <herbert@gojira.at>
MFC after:	1 month

(cherry picked from commit 4c983a2886)
2024-04-20 12:29:09 +02:00
Dimitry Andric e2e4022725 libcompiler_rt Makefile.inc: don't build bfloat16 support for gcc < 13
Older versions of gcc produce "error: unknown type name '__bf16'".

PR:		276104
MFC after:	1 month

(cherry picked from commit 2e226748a9)
2024-04-20 12:29:09 +02:00
Dimitry Andric 5018444b28 libcompiler_rt Makefile.inc: remove debugging messages
PR:		276104
MFC after:	1 month

(cherry picked from commit d00b9344bb)
2024-04-20 12:29:09 +02:00
Dimitry Andric 89cc83362f Fix GENERIC-KASAN kernel build for amd64
Work around https://github.com/llvm/llvm-project/issues/87923, which
leads to an assertion failure compiling several kernel source files with
asan enabled.

PR:		276104
MFC after:	1 month

(cherry picked from commit b811dac211)
2024-04-20 12:29:09 +02:00
Dimitry Andric 0764680cf8 Fix arm64 build after llvm 18.1.3 upgrade (take 2)
Instead of compiling the whole sys/arm64/arm64/vfp.c file without
-mgeneral-regs-only, which might have unwanted side effects, add
".arch_extension fp" / ".arch_extension nofp" pairs to the inline
assembly.

PR:		276104
Suggested by:	andrew
MFC after:	1 month

(cherry picked from commit 61e482f2fc)
2024-04-20 12:29:09 +02:00
Dimitry Andric 7b86b92ec1 Fix arm64 build after llvm 18.1.3 upgrade
Apparently clang 18 has become more strict about using floating point
registers in inline assembly when -mgeneral-regs-only is used. This
causes sys/arm64/arm64/vfp.c to fail to compile, with "error:
instruction requires: fp-armv8", and "error: expected readable system
register".

To fix it, similar to other files compiled for arm64, disable
-mgeneral-regs-only for this particular file.

PR:		276104
MFC after:	1 month

(cherry picked from commit f4d93b6761)
2024-04-20 12:29:09 +02:00
Dimitry Andric 3a287a03cf Merge llvm-project release/18.x llvmorg-18.1.3-0-gc13b7485b879
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.3-0-gc13b7485b879.

PR:		276104
MFC after:	1 month

(cherry picked from commit 439352ac82)
2024-04-19 23:24:48 +02:00
Dimitry Andric 8e0b0a2827 Merge commit f5f3d5d6534f from llvm-project (by Qizhi Hu):
[Clang][Sema] Fix a crash in lambda instantiation (#85565)

  Fix https://github.com/llvm/llvm-project/issues/85343
  When build lambda expression in lambda instantiation, `ThisType` is
  required in `Sema::CheckCXXThisCapture` to build `this` capture. Set
  `this` type by import `Sema::CXXThisScopeRAII` and it will be used later
  in lambda expression transformation.

  Co-authored-by: huqizhi <836744285@qq.com>

This fixes 'Assertion failed: (!isNull() && "Cannot retrieve a NULL type
pointer"), function getCommonPtr" when building the x11-wm/wayfire port.

PR:		276104
MFC after:	1 month

(cherry picked from commit 49a6e426df)
2024-04-19 23:24:48 +02:00
Dimitry Andric 64816cf50d Revert commit 6255157d24e2 from llvm-project (by Dimitry Andric):
[libc++] Re-enable std::pair trivial copy constructor for FreeBSD >= 14

  After many years of using the really old std::pair ABI which did not yet
  have a trivial copy constructor, FreeBSD 14 and later will finally get
  rid of it. Only use the old ABI for FreeBSD 13 and earlier.

  Note: on the FreeBSD side, we will bump our libc++.so version for this,
  and keep an old compatibility library in a separate package.

  Differential Revision: https://reviews.llvm.org/D126462

This ABI change can cause crashes when binaries compiled against older
libc++ versions are run against binaries compiled against this libc++
version.

For example, lang/ldc uses a precompiled bootstrap ldc2 binary that was
compiled against the old libc++, but also links against libLLVM-15.so.
If libLLVM-15.so is compiled against the new libc++ version, the ABI
mismatch results in segfaults or even stack overflows.

Note: we can only re-enable the std::pair trivial copy constructors
again when the official libc++ ABI version is bumped to 2.

PR:		276104
MFC after:	1 month

(cherry picked from commit ce4f1f49e0)
2024-04-19 23:24:48 +02:00
Dimitry Andric b09953d54d Merge llvm-project release/18.x llvmorg-18.1.1-0-gdba2a75e9c7e
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.1-0-gdba2a75e9c7e.

PR:		276104
MFC after:	1 month

(cherry picked from commit 4c2d3b022a)
2024-04-19 23:24:47 +02:00
Dimitry Andric 7032a43521 Merge llvm-project release/18.x llvmorg-18.1.0-rc3-0-g6c90f8dd5463
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.0-rc3-0-g6c90f8dd5463.

PR:		276104
MFC after:	1 month

(cherry picked from commit 56727255ad)
2024-04-19 23:24:47 +02:00
Dimitry Andric c80674ff65 Merge llvm-project release/18.x llvmorg-18.1.0-rc2-53-gc7b0a6ecd442
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.0-rc2-53-gc7b0a6ecd442.

PR:		276104
MFC after:	1 month

(cherry picked from commit 74626c16ff)
2024-04-19 23:24:47 +02:00
Dimitry Andric 83e37ae556 Merge llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.0-rc2-0-gc6c86965d967.

PR:		276104
MFC after:	1 month

(cherry picked from commit b3edf44679)
2024-04-19 23:24:46 +02:00
Dimitry Andric af050415f0 [libc++] Rename __bit_reference template parameter to avoid conflict
As of 4d20cfcf4eb08217ed37c4d4c38dc395d7a66d26, `__bit_reference`
contains a template `__fill_n` with a bool `_FillValue` parameter.

Unfortunately there is a relatively widely used piece of scientific
software called NetCDF, which exposes a (C) macro `_FillValue` in its
public headers.

When building the NetCDF C++ bindings, this quickly leads to compilation
errors when the macro interferes with the template in `__bit_reference`.

Rename the parameter to `_FillVal` to avoid the conflict.

PR:		276104
MFC after:	1 month

(cherry picked from commit 868ee3f285)
2024-04-19 23:24:46 +02:00
Dimitry Andric 6c596be665 Merge commit 5f4ee5a2dfa9 from llvm-project (by Shanzhi):
[Clang][AST] Fix a crash on attaching doc comments (#78716)

  This crash is basically caused by calling
  `ASTContext::getRawCommentForDeclNoCacheImp` with its input arguments
  `RepresentativeLocForDecl` and `CommentsInTheFile` refering to different
  files. A reduced reproducer is provided in this patch.

  After the source locations for instantiations of funtion template are
  corrected in the commit 256a0b298c68b89688b80350b034daf2f7785b67, the
  variable `CommitsInThisFile` in the function
  `ASTContext::attachCommentsToJustParsedDecls` would refer to the source
  file rather than the header file for implicit function template
  instantiation. Therefore, in the first loop in
  `ASTContext::attachCommentsToJustParsedDecls`, `D` should also be
  adjusted for relevant scenarios like the second loop.

  Fixes #67979
  Fixes #68524
  Fixes #70550

This should fix a segfault when compiling graphics/gdal.

PR:		276104
MFC after:	1 month

(cherry picked from commit dc36515b62)
2024-04-19 23:24:46 +02:00
Dimitry Andric 3731f53de1 Merge commit 6e4930c67508 from llvm-project (by Alexander Kornienko):
Revert "[SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (#77768)"

  This reverts commit 924701311aa79180e86ad8ce43d253f27d25ec7d. Causes compilation
  errors on valid code, see
  https://github.com/llvm/llvm-project/pull/77768#issuecomment-1908062472.

In particular, this fixes bogus "call to constructor of 'SomeType' is
ambiguous" errors.

PR:		276104
MFC after:	1 month

(cherry picked from commit ddbac700c2)
2024-04-19 23:24:45 +02:00
Dimitry Andric a1f98ae0a8 Merge llvm-project release/18.x llvmorg-18-init-18361-g22683463740e
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18-init-18361-g22683463740e.

PR:		276104
MFC after:	1 month

(cherry picked from commit 878ed4957e)
2024-04-19 23:24:45 +02:00
Dimitry Andric 206cf542ef Tentatively apply https://github.com/libcxxrt/libcxxrt/pull/27
This marks __cxa_allocate_exception, __cxa_free_exception and
__cxa_init_primary_exception noexcept, to ensure compatibility with
libc++'s declarations.

PR:		276104
MFC after:	1 month

(cherry picked from commit 3fb2e04579)
2024-04-19 23:24:45 +02:00