[sanitizer_common][test] Limit signal_segv_handler test time (#236538)
The test runs 1,000,000 iterations of mprotect + SEGV. On slow software
emulators (e.g. QEMU TCG for arm/aarch64), this can take several minutes
or exceed the 600s test timeout. Check elapsed time every 1,000
iterations and stop after 10 seconds.
Assisted-by: Gemini
[SPARC] Pass the optimization level to the instruction selector (#235249)
SparcDAGToDAGISel is constructed without an optimization level, so
SelectionDAGISel uses the default and the DAG combiner runs as it does
at -O2 even when compiling with -O0. Among other things it then drops a
store that is overwritten by the next one, so a variable assigned twice
has no instruction for its first assignment and a debugger cannot stop
there or see the first value. clang -O0 is not affected because it marks
functions optnone, but rustc and llc -O0 are.
Pass the target machine's level, as RISC-V does.
Fixes #235236
Assisted-by: Claude Code (Claude Opus 5.5)
[libc][math] Implement double precision tanh correctly rounded to all rounding modes. (#235618)
- Evaluate `tanh(x) = 1 - (2 * m) / (e^u + m)` for `|x| >= 2^-3` using
shared exp range reduction and lookup tables from `exp_utils.h` and
`exp2_accurate_128.h`
- For `2^-27 < |x| < 2^-3`, use a degree-5 minimax polynomial in `x^2`
with exact leading cubic split in the fast pass, and a degree-11 minimax
polynomial in Frac128 in the accurate pass.
- Add a no-LUT (N = 0) sinh(x) / cosh(x) evaluation when
`LIBC_MATH_HAS_SKIP_ACCURATE_PASS` is enabled.
Assisted-by: Gemini for analysis and refactoring.
[llvm] Add ELF.def to the module map (#236541)
Follow-up to https://github.com/llvm/llvm-project/pull/236143, which
added the file without listing it. Fixes "expected identifier" errors at
the `ELF.def` include in `ELF.h` in modular builds.
@aengelke Hi there, could you sign this off please?
sysutils/py-salt: Fix service status/stop with Python 3.14
Salt pins the multiprocessing start method to "fork" on Python 3.14
only on Linux. On FreeBSD the default "forkserver" is used, the
daemonized minion gets the forkserver's command line, and rc.subr no
longer finds it. Apply the same pin on FreeBSD.
Reported by: Thomas Kotzian <thomas.kotzian at lausa.at>
[AArch64] Disable MADD combine for Apple targets (#235345)
The combine has been introduced by
https://github.com/llvm/llvm-project/pull/231356.
I measured the 2 forms on Apple silicon and the original form performs
better.
[lldb][OpenBSD] Fix sysctl usage for process info (#122534)
The OpenBSD Host code used FreeBSD-style sysctl MIBs, which don't
match OpenBSD's interface, so process lookups failed.
- GetOpenBSDProcessArgs: use {CTL_KERN, KERN_PROC_ARGS, pid,
KERN_PROC_ARGV}. OpenBSD returns a NULL-terminated argv array
whose pointers point into the returned buffer, so iterate it
directly.
- GetOpenBSDProcessUserAndGroup, FindProcessesImpl: KERN_PROC
takes a 6-element MIB on OpenBSD, with the kinfo_proc element
size and element count as the last two entries.
(cherry picked from commit b880f44cbad751b0784a5fbbfbdaacea25e167f8)
[RISCV] Correctly restore libcall CSRs with SCS
Fixes #233318
Before this change, we were restoring some callee-saved registers twice
when using save/restore libcalls with shadow call stack (SCS), and the
second restore was happening after the stack was deallocated using the
wrong register and offset calculation, which was causing lots of access
problems.
The problems were:
- We were using the entire list of Callee Saves rather than just the
subset that would have been restored by the libcall. This caused
duplicate restores because of how the CSI subsetting works.
- We were not using the correct offset calculation in
eliminateFrameIndex, which was causing us to calculate the wrong
address for the saves/restores.
Assisted-by: AI
Co-authored-by: Mitch Briles <mitchbriles at gmail.com>
[RISCV] Ensure Shadow Stack checks correct RA
This primarliy applies to the save-restore case, which was using
`__riscv_restore_<N>` incorrectly, entirely circumventing the software
shadow call stack.
This fix keeps the code size improvements of `__riscv_save_<N>` when
there is a shadow call stack, but it avoids the incorrect use of
`__riscv_restore_<N>`, instead emitting the correct sequence inline.
In the future, when there are better versions of `__riscv_save_<N>` and
`__riscv_restore_<N>` which support the shadow call stack variants (both
hardware and software), then we can revisit this approach and use the
correct pairs in all cases.
System: Routes: Status - refactor configd call "interface routes list" to use libxo and add additional fields needed for ECMP, for https://github.com/opnsense/core/issues/10569
Change view to show child entries for duplicate destinations using _children property (which tabulator can use)
[SystemZ][z/OS] Alias for a function needs reference to ADA
When emitting function aliases, the current code misses to set the
reference to the ADA. Thus, the ADA register is 0 in the called
function, causing a crash e.g. when another function is called.
Fix is to set the references to the ADA.
Assisted by: IBM Bob
[AMDGPU] Precommit tests for ordered XDL VA_VDST waits (#233712)
Add MIR tests for VA_VDST waits in gfx1250 expert scheduling mode around
XDL instructions, covering wide and narrow destinations, mixed TRANS,
XDL and core VALU events, matrix scale, partial and explicit waits, and
CFG merges. The checks show the current conservative waits.
[AMDGPU] Select nop postRA scheduler with coexec (#233662)
The coexec strategy places instructions in the open cycles of WMMA and
MFMA co-execution windows, and the generic post-RA scheduler then
reorders that schedule. Use the nop post-RA scheduler for functions that
use the coexec strategy, unless amdgpu-post-sched-strategy is set.
Impacts gfx1250 and gfx950 when the coexec strategy is enabled.
[SPARC] Use GOTDATA_OP relocations for PIC address loads (#235763)
In the pic32 code model, the address of every global, constant pool
entry and block address was loaded from the GOT with a %got22/%got10
sequence. The linker has no way to know such a load could be avoided,
so even symbols that bind locally were read from the GOT at run time.
That breaks code which runs before dynamic relocations are applied:
glibc's ld.so built with clang crashes in _dl_start, because the GOT
slot for a file-scope static is still zero at that point.
Emit the GOTDATA_OP sequence that GCC uses instead:
sethi %gdop_hix22(sym), %r1
xor %r1, %gdop_lox10(sym), %r1
ld[x] [%gotbase + %r1], %r2, %gdop(sym)
When sym binds locally, GNU ld and lld rewrite the sethi/xor into a
GOT-relative offset and the load into an add, so nothing is read from
the GOT. For preemptible symbols the GOT load is kept.
[15 lines not shown]
[AMDGPU] Detect score wraparound when VA_VDST increments by two (#233708)
On subtargets with hasVOP3PX2IncrementsVaVdstTwice, VOP3PX2 instructions
such as V_WMMA_SCALE increment VA_VDST by two. If the upper bound is
UINT_MAX at that point, UB + 2 wraps to 1, which the CurrScore == 0
check does not catch. Check CurrScore <= UB instead, which catches a
wrap for any positive increment.