[libc] Introduce a typed syscall wrapper and use it in mmap (#197459)
Linux reserves a range of values (everything above -4096u, aka
MAX_ERRNO) as an error value, so the check can be performed without
knowing the details of the specific syscall. libc functions where these
values would be a valid result (e.g. PTRACE_PEEKDATA) are implemented
differently at the kernel level (e.g. returning the result through a
pointer argument). The only exception are a handful of syscalls (getpid,
getuid, ...) which can never fail, and where this could be an actual
user/group ID (particularly on 32-bit systems).
Specifically, for mmap, this lets us remove the is_valid_mmap helper and
SYS_mmap2 ifdefs in various places.
More generally, this can simplify many syscall wrappers as often the
only thing they are doing is converting the return value into an
ErrorOr.
[MLIR][NVVM] Add sqrt Ops (#197422)
Adds two NVVM dialect ops covering all 14 floating-point `sqrt` forms:
- `nvvm.sqrt` -- IEEE-compliant sqrt with explicit rounding mode
(`sqrt.<RM>[.ftz].{f32,f64}`), 12 forms.
- `nvvm.sqrt.approx` -- fast approximate sqrt (`sqrt.approx[.ftz].f32`),
2 forms; uses the `NVVM_F32UnaryApproxOp` base class.
The two ops are split because the rounded forms require an explicit rounding mode and support both f32 and f64, while the approx forms have no rounding mode and are f32-only.
glib2-introspection: depend on latest gobject-introspection
just to make sure we get a consistent package set if the
gobject-introspection change is problematic after all.
Bump PKGREVISION.
gobject-introspection: remove patches that seem unneeded
No change to gobject-introspection or glib2-introspection
(except the actual change in maintransformer.py)
Bump PKGREVISION.
[flang-rt][test] Fix write01.f90 missing LD_LIBRARY_PATH (introduced in #187662)
The test binary was run without setting LD_LIBRARY_PATH, causing
libflang_rt.runtime.so to not be found at runtime. Match the pattern
used by exec.f90 and ctofortran.f90.
Co-Authored-By: Claude Sonnet 4.6 <noreply at anthropic.com>
[libc][math] Fix pow() subnormal base exponent computation (#198134)
For subnormal inputs, get_exponent() returns -1023. The code subtracted
64 after normalizing but didn't recompute e_x from the normalized value.
This set e_x to -1087 for every subnormal.
To fix, compute e_x from the normalized value.
powf() doesn't have this bug because it adds
`x_u >> FloatBits::FRACTION_LEN` to ex, where x_u is `x_u =
FloatBits(x).uintval();` with `x` being the normalized value. Added
subnormal base tests for powf to show that it works fine as-is.
Fixes #197212.
[llvm-debuginfo-analyzer] Fix missed 'else' (LVCodeViewReader / LVDWARFReader) (#192923)
Issues found PVS studio static analyzer.
LVCodeViewReader.cpp. PR for #170117.
4. Potent UB: manipulation of invalid object.
The PVS-Studio warning: V519 The 'FeaturesValue' variable is assigned
values twice successively.
The original patch caused fail tests for linker error and it was reverted.
This PR include original (#188578) + necessary edit in CMakeList.
Committed on behalf of @Seraphimt
x509_addr: do not call memcmp() on NULL
If the minimum length is 0, either a->data or b->data could be NULL, so
do not call memcmp() and let the length comparison decide. Doing it this
way preserves the RFC 3779, section 2.2.3.3 semantics and avoids the UB.
A valid IPAddressFamily has an addressFamily element of 2 or 3 octets:
2 octets for the AFI and 1 octet for the optional SAFI. The check as
it is written compares the AFIs and, if they're equal, lets absent SAFI
be smaller than any other SAFI. So IPv4 (0x0001) sorts before IPv4
unicast (0x000101) and that in turn sorts before IPv6 (0x0002).
Found by beck while breaking OpenSSL
ok kenjiro
[CUF] Fix CompilerGeneratedNamesConversion renaming managed companion globals
CUFAddConstructor creates a companion pointer global (e.g. foo.managed.ptr)
for each non-allocatable managed variable. When CompilerGeneratedNamesConversion
ran after CUFAddConstructor, it replaced the dots with 'X',
so CUFOpConversionLate could no longer find the companion by name and fell back
to CUFGetDeviceAddress with the wrong host pointer, causing cudaErrorInvalidSymbol.
Fix: mark the companion global with a cuf.managed_ptr unit attribute in
CUFAddConstructor and skip it in CompilerGeneratedNamesConversionPass.
Co-authored-by: Claude Sonnet 4.6 <noreply at anthropic.com>
chacha: avoid -Wunterminated-string-initialization warning
The sizes of sigma[] and tau[] aren't used, so include a trailing NUL and
thereby avoid upsetting modern compilers about use of dangerous, valid C.
ok deraadt djm
devel/electron42: Add port: Build cross-platform desktop apps with JavaScript, HTML, and CSS
Build cross platform desktop apps with JavaScript, HTML, and CSS.
It's easier than you think.
If you can build a website, you can build a desktop app. Electron is a
framework for creating native applications with web technologies like
JavaScript, HTML, and CSS. It takes care of the hard parts so you can
focus on the core of your application.
WWW: https://electronjs.org/
[BPF] Remove getMaxNumArgs() from BPFTargetTransformInfo (#198223)
The function getMaxNumArgs() hardcoded the maximum number of function
arguments to 5. LLVM now supports more than 5 arguments with stack
argument support. Remove this leftover.
[mlir][linalg] Add splat transpose canonicalization patterns (#195991)
All elements in a dense splat are identical, transposing it only changes
the shape, but still maintaining the value. Add a pattern where it would
replace the `linalg.transpose` of a splat constant with a
`arith.constant` of the transposed result shape.
Assisted-by: Cursor (GPT-5.5)
[Clang] Instantiate ParmVarDecls on-demand for FunctionParmPackExpr (#196919)
This is missed when we implemented CWG2369, where their instantiations
should be built in place when they are needed.
Fixes #173086