kernel - Fix console access by non-root
* Fix console access via /dev/tty or /dev/ttyv* via a user login,
when logged in as that user.
The priv check was only allowing root access and needed a flag to
also allow matching users access.
* Note that console access from a restricted root "root" user such
as from a jail is not allowed (intentionally), because console ioctls
can be dangerous.
Reported-by: aly, peeterm
[OpenMP][OMPIRBuilder] Support complex types in atomic update/capture
Route struct-typed values through the libcall path in
`emitAtomicUpdate`.
Previously, the libcall path was gated on `RMWOp == BAD_BINOP`, so
atomic capture swap patterns (`v = x; x = expr`) for complex values
lowered as structs fell through to the cmpxchg path. That path called
`getScalarSizeInBits()` on a struct type, produced 0, and triggered an
assertion in `IntegerType::get()`.
Remove the `BAD_BINOP` restriction so struct types always use the
libcall path. This is safe because the libcall path does not use
`RMWOp` and already handles arbitrary type sizes correctly.
Also fix `LoadSize` in the libcall path to use `XElemTy` rather than
the pointer type, which previously gave the wrong size for larger
complex types such as `complex(8)`.
[3 lines not shown]
[XRay] Remove unused argument of DataExtractor constructor (NFC) (#191864)
`AddressSize` parameter is not used by `DataExtractor` and will be
removed in the future. See #190519 for more context.
[LoongArch] Select VSUBI for add with negative splat immediates
Currently, vector add with a negative splat immediate is lowered as a
vector splat followed by a register-register add, e.g.:
```
vrepli.b $vr1, -1
vadd.b $vr0, $vr0, $vr1
```
This misses the opportunity to use the more efficient VSUBI instruction
with a positive immediate.
This patch introduces `selectVSplatImmNeg` to detect negative splat
immediates whose negated value fits in a 5-bit unsigned immediate. New
patterns `(Pat{Vr,Xr}Nimm5)` are added to match:
```
add v, splat(-imm) --> vsubi v, v, imm
[12 lines not shown]
[bolt] Remove unused argument of DataExtractor constructor (NFC) (#191841)
`AddressSize` parameter is not used by `DataExtractor` and will be
removed in the future. See #190519 for more context.
I took the liberty of switching from using the `StringRef` constructor
overload to `ArrayRef` where appropriate.
[flang][OpenMP] Avoid marking named main programs as declare target (#190250)
A bare `!$omp declare target` could incorrectly mark `_QQmain` as
`omp.declare_target` when it appeared in an interface body inside a
named
main program. That pulled host-only callees into device compilation and
caused offload link failures.
Fix this by skipping main programs in the implicit-capture path.
Also add a regression test for the named-main interface case and update
`real10.f90` to use a valid container for the bare `declare target`
form.
This fixes offload link failures where `_QQmain` was incorrectly treated
as
a device function and pulled in host-only symbols such as Fortran I/O
runtime calls.
Minimal reproducer:
[13 lines not shown]
[ToolChains][FreeBSD] Set default Linker to LLD for FreeBSD (#190596)
When the linker is specified as ld, toolchain applies special handling
by invoking (triple)-ld instead of resolving ld via standard PATH
lookup. This causes GNU ld installed via the system package manager to
take the precedence (since (triple)-ld appears earlier in the search
path), effectively overriding ld.lld.
As a result, we set the default Linker on FreeBSD to ld.lld to indicate
we want to use lld by default.