[Driver] Support -rtlib=none (#245001)
This is helpful in situations when linking the runtime library is
undesirable, for example when building the runtime library itself. It
also makes the --rtlib= option consistent with --unwindlib=.
[IPO] Declare sample profile inliner command line options in TableGen (#244670)
SampleProfile.h replaces the exported cl::opts with
SampleProfileInlineOptions, which
SampleProfileLoaderPass::getInlineOptions fills from the options given
over the caller's defaults. llvm-profgen's preinliner reads its
thresholds this way instead of writing the cl::opts, and the loader no
longer writes the global size limits for non-CS profiles.
capsicum-test: Disable `HAVE_SEND_RECV_MMSG` again
04c4b2084eb9 accidentally added some changes from another WIP commit into that
diff. Instead of wholesale reverting the change, just revert the part that's
currently broken (`HAVE_SEND_RECV_MMSG`). While some of the related tests pass,
one of the testcases (`capmode.cc:AllowedMmsgSendRecv`) doesn't currently pass.
Revert the change to make the CI run more green again.
MFC after: 1 week
Fixes: 04c4b2084eb9 ("capsicum-test: make the code WARNS=6 clean")
(cherry picked from commit 71eddb44d7dfa60e43f77c90b51bd091f0693f85)
contrib/kyua: update config.h for 0.15.1 -> 0.15.2
This was accidentally missed in the prior commit.
This commit addresses a largely cosmetic issue.
MFC after: 6 days
MFC with: c16da33701d0
Fixes: c16da33701d0 contrib/kyua: update to 0.15.2
(cherry picked from commit d9daf5ae796518af1793f919156fb6feba05959d)
tests/sys/capsicum: Fix -Wshadow issue with `fd_set`
`fd_set` is defined in `sys/select.h`, and prior to this change, was in fcntl.cc as well.
This change renames `fd_set` to `fd_set_` to avoid the name collision.
MFC after: 1 week
Reported by: gcc 14
Fixes: 04c4b2084eb9 ("capsicum-test: make the code WARNS=6 clean")
(cherry picked from commit a479301abb2c7b384f574fcc641e502f70654835)
capsicum-test: make the code WARNS=6 clean
Make the code WARNS=6 clean by doing the following:
- Renaming variables (-Wshadow).
- Use memcpy instead of assigning the result of CMSG_DATA to a variable
(-Wcast-align).
- Wrap some macros with do-while(0) to avoid variable collisions
(-Wshadow).
- Push one of the TRACE statements up by 1 layer to avoid a collision
between 2 calls of TRACE via the same overarching macro.
This was needed in order for the code to build properly with D61066,
since the code was not compiling with WARNS set to 3 at the testcase
level.
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D61080
(cherry picked from commit 04c4b2084eb93fc2374dbb89f343f3941585a640)
GoogleTest: run several tests as plain C++ tests
Some of the tests provided by GoogleTest don't play well with the kyua
GoogleTest engine available in 0.15.0, in part because they test
edgecases that the kyua GoogleTest engine does not expect or handle
gracefully.
Treat the tests as plain C++ tests to keep parity (result-wise) before
switching the testcase type from `plain` (what it is today under the
covers) to `googletest`.
MFC after: 1 month
MFC with: 3fb03fb35b20 ("[tests] switch GoogleTest tests to ...")
(cherry picked from commit eecc84de3572d1ee6caac1fa14dd3140c9601c9c)
tests/sys/capsicum: restore test coverage with root user
This change builds capsicum_test and installs/runs it as an unprivileged
user ("tests" in vanilla FreeBSD) and root.
This required adjusting logic in the Makefile in order to build two
binaries with the same sources and running them as separate binaries.
Moreover, in order to restore coverage and ensure that some tests which
require `other_uid` (typically specified via `-u` on the CLI with the
test program) don't fail, become the "tests" user when run as root. This
technically doesn't honor unprivileged_user property in kyua.conf: the
property needs to be passed via a command-line parameter to the test
program.
MFC after: 1 week
Reported by: markj
Fixes: 3fb03fb35b20 ("[tests] switch GoogleTest tests ...")
[4 lines not shown]
[tests] switch GoogleTest tests to `googletest` interface
The new `googletest` kyua test interface--added in 0.15.0 and fixed in
0.15.1--allows tests to be executed and handled in a more fine-grained
manner than the way it was prior to this commit.
This change deletes the `capsicum-test` ATF wrapper script,
`functional.sh`, and all supporting logic in `googletest.test.mk` as
well as this change makes that logic unnecessary.
MFC after: 1 month
MFC with: b68969979d6b ("contrib/kyua: update to 0.15.1")
(cherry picked from commit 3fb03fb35b20d259e0a3a07fc48f2ecc3c5da6e8)
[orc-rt] Define _GNU_SOURCE in the dlfcn-host regression test. (#245124)
glibc's <dlfcn.h> only declares Dl_info (along with dladdr) when
_GNU_SOURCE is defined. C++ compilers define it by default on Linux, but
C compilers don't, so the dlfcn-host regression test, which is compiled
as C, failed to compile on Linux.
Define _GNU_SOURCE in the test, and document the requirement in
dlfcn-host.h for other C clients.
Assisted-by: Claude
src: Use gnu++17 as the default C++ standard
Previously the compiler's default C++ standard was used unlike C where
bsd.sys.mk explicitly sets a default language version. Setting an
explicit default version will give a more uniform experience across
different compilers and compiler versions.
gnu++17 was chosen to match the default C standard. It is well
supported by a wide range of clang (5+) and GCC (9+) versions.
gnu++17 is also the default C++ standard in recent versions of clang
(16+) and GCC (11+). As a result, many of the explicit CXXSTD
settings in Makefiles had the effect of lowering the C++ standard
instead of raising it as was originally intended and are removed.
Note that the remaining explicit CXXSTD settings for atf and liblutok
explicitly lower the standard to C++11 due to use of the deprecated
auto_ptr<> template which is removed in later versions.
[4 lines not shown]
LowerTypeTests: Only invalidate analyses of modified functions in SimplifyTypeTests (#244852)
SimplifyTypeTests tried to preserve the CFG analyses, but did not
preserve the function analysis manager proxy, so all function analyses
were invalidated.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[LFI][AArch64] Use BTI JC for function landing pads due to tail calls (#244058)
LFI rewrites every indirect branch through x28, including tail calls
that would normally use x16/x17, so we get a fault if a tail call lands
on a `bti c`. This patch makes codegen emit `bti jc` for indirect call
targets under LFI, even before `paciasp`/`pacibsp`, and makes the MC
rewriter turn `bti c` into `bti jc` so hand-written assembly is covered
too.
Assisted by: Claude Opus 5.5
capsicum-tests: remove Linux support
Now that this project is part of freebsd-src, it no longer needs to be
portable. Remove Linux-only tests, cross-os compatibility code, and
compatibility with older FreeBSD versions. Leave in place some
originally Linux-only tests that could now be ported to FreeBSD, like the
pipe2 tests.
Sponsored by: ConnectWise
Reviewed by: oshogbo
Differential Revision: https://reviews.freebsd.org/D54985
(cherry picked from commit fba81b33aabff74ad03d5f9f9663c176cf060fa6)
tests: sys/capsicum/functional requires mqueuefs
Skip this test if mqueuefs isn't loaded. Unfortunately, that will skip
the entire googletest test program, including test cases that don't
require mqueuefs. But the test's own skipping logic doesn't work, and
we don't yet have a googletest-compatible require_kmods() function.
MFC after: 2 weeks
Sponsored by: ConnectWise
Reviewed by: emaste, ngie
Differential Revision: https://reviews.freebsd.org/D54902
(cherry picked from commit df68a09ea2ec18ee975fb937d46a18250d4663c8)
MAINTAINERS, CODEOWNERS: Update capsicum-test
Fixes: 670b568ec1c3 ("capsicum-test: Move out of contrib")
Sponsored by: The FreeBSD Foundation
(cherry picked from commit b773da180e02c0c27de48dbba72f3fb7a64656da)
capsicum-test: Move out of contrib
Google developed the Capsicum unit test suite[1] as part of the
Capsicum-Linux[2] project, based on unit tests that existed in FreeBSD
and unit tests developed as part of the initial Capsicum-Linux port.
Capsicum-Linux was archived as of October 31, 2022 and is no longer
being maintained. FreeBSD is currently the only consumer of and
contributor to the test suite. Move the src into tests/sys/capsicum to
simplify ongoing maintenance.
The makefiles were deleted as we (continue to) use the existing bespoke
FreeBSD Makefile, and CONTRIBUTING.md was removed as the Google CLA is
no longer applicable.
[1] https://github.com/google/capsicum-test
[2] https://github.com/google/capsicum-linux
Reviewed by: asomers, oshogbo
[4 lines not shown]
CI: install the live ISO onto a blank disk and boot the installed system
install-test (nextbsd/nextbsd#686) boots each live ISO in QEMU with a
blank 32 GB disk, runs the installer engine on it as Installer.app's
helper does (do-install.sh -d vtbd0), powers off, then boots the
installed disk alone and checks it. The file system is read off the
booted system: UFS installs are checked today, and the full ZFS layout
(pool NextBSD, the six datasets, bootfs, host ID, bectl) strictly as
soon as the ISO's engine installs ZFS. Both also check the login
account's home under /Local/Users, dsstatus and dspromote's
same-file-system rule; Desktop also checks WindowServer and loginwindow.
The harness pieces are assembled in tests/install-test.sh (no harness
change). The job runs on pushes, manual runs and PRs touching the
workflow, tests/ or build.sh, and is not in release's needs.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[CodeGen] Disable passes requiring NoVRegs on virtual-register targets (#245089)
NVPTX, SPIR-V, and WebAssembly keep virtual registers until emission.
Each disables the same post-RA passes, which require NoVRegs, in both
TargetPassConfig and its CodeGenPassBuilder, and overrides hooks so no
register allocator is added. Key both on
TargetMachine::usesPhysRegsForValues() instead: TargetPassConfig and
CodeGenPassBuilder disable the passes in one list, and addFastRegAlloc
and addOptimizedRegAlloc skip allocation. NVPTX now returns false from
usesPhysRegsForValues().
addRegAssignAndRewriteFast and addRegAssignAndRewriteOptimized returned
bool, or Expected<bool>, only to let these targets report that nothing
was added. They now return void, or Error.
LLM-aided
release: make sure each Preview release is public, as a visitor sees it (#689)
softprops/action-gh-release creates a release as a draft, uploads its
files, then clears the draft flag. In run 45109117441 it logged
"Finalizing release... Release ready" for continuous-desktop but left it
a draft: only the repo owner could see its files, visitors and the tag
page saw just the source archives, and the public API returned 404.
continuous-server, in the same job, was published normally. The job
still reported success.
After each publish step, clear the draft flag ourselves (harmless when
the release is already public), then fetch the release from the public
API without a token and require all four files (two ISOs, the Pi image,
SHA256SUMS), retrying for up to a minute. A release that isn't public
now fails the job instead of passing silently.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[mlir][AMDGPU] Fix canonicalize crash on trailing memory_counter_wait (#245028)
FuseMemoryCounterWaitOp called dyn_cast on the possibly-null next node,
which asserts when the op is last in its block. Use dyn_cast_or_null.
Fixes #239940.
[Clang][CUDA] Guard curand_mtgp32_kernel.h include with has_include (#244945)
`__clang_cuda_runtime_wrapper.h` forcefully includes
`curand_mtgp32_kernel.h`. On a minimal CUDA setup (`cuda -nvcc` and
`cuda-cudart-dev` installed), compiling any CUDA code using `clang++`
fails with `fatal error: 'curand_mtgp32_kernel.h' file not found`, even
when the code does not use cuRAND.
The fix guards `#include "curand_mtgp32_kernel.h"` and its surrounding
`dim3`/`uint3`, `push_macro`/`define`/`pop_macro` "hack" in
`clang/lib/Headers/__clang_cuda_runtime_wrapper.h` with `#if
__has_include("curand_mtgp32_kernel.h")`.
Removed the stub
`clang/test/Headers/Inputs/include/curand_mtgp32_kernel.h`, as keeping
the stub in the shared `Inputs/include/` mock tree made the
missing-header case really hard to test, as they would vacuously pass
even on an unpatched wrapper. It also makes existing tests like
`gpu_disabled_math.cpp` and `cuda_with_openmp.cu` exercise the
[5 lines not shown]
[RISCV] Fix scalar minimum/maximum cost without Zfa (#239996)
Cost them as fmin/fmax plus a NaN compare and select instead of the
generic libcall cost, or just fmin/fmax with nnan. Also add nnan tests.
[flang] Reject INTENT on non-pointer dummy procedure (#240042)
### Summary
Fix missing semantic diagnostic for INTENT on non-pointer dummy
procedures. The existing check only covered `ProcEntityDetails`, missing
procedures represented by `SubprogramDetails`. Moved the validation to
the shared `CheckHelper::Check()` path to ensure consistent enforcement
across both representations, with regression tests added.
Fixes #229220.
---------
Co-authored-by: Jay Satish Kumar Patel <kumarpat at pe31.hpc.amslabs.hpecorp.net>
Co-authored-by: Copilot <223556219+Copilot at users.noreply.github.com>