[fuzzer] Restrict merge-sigusr.test to Linux (#216702)
The `fuzzer/merge-sigusr.test` test causes the whole `ninja check-all`
run on NetBSD to be killed with `SIGUSR2`.
It turns out the test is highly Linux-specific in at least two ways:
- The `setsid` command doesn't exist on any of Darwin, FreeBSD, and
NetBSD.
- `ps -o sess= <pid>` is highly unportable, too:
- FreeBSD `ps` doesn't have the `sess` keyword at all.
- NetBSD `ps` does, but with different semantics: it's the session
pointer, not the session id as on Linux, which leads to randomly killing
unrelated processes.
Therefore this patch restricts the test to Linux instead of simply
[3 lines not shown]
[sanitizer] Skip hanging tests on FreeBSD (#216703)
Three sanitizer tests hang indefinitely on FreeBSD:
```
MemorySanitizer-X86_64 :: fork.cpp
SanitizerCommon-tsan-x86_64-FreeBSD :: Posix/fork_threaded.c
ThreadSanitizer-x86_64 :: fork_multithreaded.cpp
```
All of them loop and don't time out, so they need to be terminated
manually for `ninja check-all` to complete. To avoid this, this patch
skips the affected tests.
Tested on `x86_64-pc-freebsd15.1`, `x86_64-pc-netbsd11.0` and
`x86_64-pc-linux-gnu`.
[orc-rt] Add a scheme for system-specific code. (#219648)
System-specific code was written two ad-hoc ways: .cpp files selected by
CMake, and Unix/*.inc textually included behind #if ladders.
Those operations are now declared in orc-rt-internal/support/sys/, with
one implementation per capability directory (posix/, darwin/, windows/).
CMake composes capability lists rather than selecting an OS list. E.g.
POSIX targets get posix/ plus their OS directory. A file belongs in a
shared list only if it is uniform across that list's members; where a
function needs an OS conditional it moves into an OS-specific directory
instead. The "Target OS ... unsupported" #error ladders go away with the
textual includes -- components no longer include system code at all, so
the diagnostic belongs in CMake.
hostOS* becomes the orc_rt::sys namespace, matching llvm::sys.
Cache invalidation is the exception, since it wants to inline: it is
declared in sys/CacheControl.h, which selects a per-system definition
header. Its generic path now uses __builtin___clear_cache instead of
declaring __clear_cache, which forced an opaque call.
[Clang][C++29] Template pack indexing (#218738)
This partially implement p3670r4
(https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3670r4.pdf) I
haven't implemented mangling yet, it part to limit the scope of this
change which is somewhat larger than I thought it would be.
This introduces a new uncommon template name storage kind that stores a
pattern and the expanded parameter, like we do for types and
expressions.
The rest is fairly mechanical.
The feature is backported to C++98 (for type template parameters).
Funnilly, the backport of pack indexing of types was never actually
tested in C++98 mode and did not work.
It should be fixed by this PR but I'll write tests for it as a follow
up.
[8 lines not shown]
[Clang-Tidy] Support lambda's init captures in `readability-identifier-naming`. (#214353)
Add an ability to declare a custom rules for lambda's init-captures. It
recently came up in some of the discussions and people find it useful to
to have rules for those types of identifiers.
Co-authored-by: Dmitrii Kuragin <dkuragin at adobe.com>
Disable the -fomit-frame-pointer optimisation by default.
The frame-pointer is needed to have good backtraces from e.g ddb or
ptrace / btrace. Many other distros did something like this as well since
the benfit of havving easy to work with backtraces outweights the little
overall speedup gained by having an extra register.
Also disable -mno-omit-leaf-frame-pointer by default on llvm.
OK kettenis@
[AArch64] Improve load / store costs for non-power2 vector types. (#214695)
This adjusts the existing non-power-2 load/store cost routines to handle
larger than 128bit vectors, by splitting out the initial 128bit chunks
and costing the remainder with loads + inserts.
Fixes #214475
ldconfig: Revert "ldconfig: Add rootdir support and handle INSTALL_AS_USER"
Something was not properly catched by the exp-run, revert until
I fix the fallouts
arm64 pmap: optimize TLB management by pmap_update_entry()
To date, pmap_update_entry() has unconditionally passed false as
final_only to pmap_s1_invalidate_range(). Passing false means that we
invalidate the intermediate "page walk cache" entries in the TLB as well
as the leaf that is being replaced. However, invalidating intermediate
entries is only necessary when doing a superpage promotion that replaces
a pointer to a page table page by a large page mapping.
Reviewed by: andrew, kib, markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D58917
[Driver][OpenBSD] Pass -pie for static PIE links (#216907)
OpenBSD uses `rcrt0.o` for static PIE executables. This startup object
references the linker-defined `_DYNAMIC` symbol.
OpenBSD's system linker defaults to PIE, which previously masked the
missing driver flag. An LLD cross-linker built on a non-OpenBSD host
does not share that default. Consequently,
`clang --target=...-openbsd -static` selects `rcrt0.o`, but LLD does not
create `_DYNAMIC`, causing the link to fail.
[orc-rt] Group SPS headers under sps/ subdirectories. NFC. (#219614)
The SPS format headers move from support/ to support/sps/, and
SimpleRemoteCA -- whose wire format is SPS, fixed by compatibility with
LLVM's SimpleRemoteEPC -- moves from bedrock/ to bedrock/sps/. Every
file whose contents are SPS-specific now lives under an sps/ directory
in its layer, matching what the sps-ci -> sps rename set up. Tests and
include guards follow.
[ADT] Simplify SmallPtrSetIterator (NFC) (#219087)
This patch simplifies SmallPtrSetIterator by defining it directly
without the type-erased SmallPtrSetIteratorImpl.
In commit cc3fe3c546e0 (#160814), SmallPtrSetIteratorImpl was introduced
to reduce template instantiation bloat. However, because
SmallPtrSetIteratorImpl is defined entirely in the header and its
trivial iterator loops are aggressively inlined at call sites, the
separate base class adds structural complexity without providing
meaningful code size savings.
Assisted-by: Antigravity