[libc] Don't declare vector_size types that cannot be compiled (#221119)
On machines where [[gnu::vector_size(N)]] types are generally
supported, each given N can only be used when the corresponding
CPU features are enabled by the particular -m switches et al.
Don't make any use of a type that's not enabled for native
register use according to the predefines reflecting -m switches.
Even inline and template functions that wind up being unused can
make the compiler give errors about the use of a type whose use
is disabled for ABI or ISA configuration reasons.
[HIP] Use new spelling in buildbot script (#223491)
This adds the new spelling to enable HIP Kokkos tests in the buildbot
script.
The old spelling will be removed.
[bazel][libc][test] Allow LLVM-libc tests to be run in full-build mode
This PR makes the required changes to run LLVM-libc full build tests in Bazel. After this PR, most tests pass:
```
bazel test @llvm-project//libc/test/... --config=ci --@llvm-project//libc:build_mode=full --keep_going
Executed 680 out of 853 tests: 681 tests pass and 172 fail to build.
```
Follow on PRs will fix specific tests that are failing (lots of missing deps etc).
This PR mostly involves propagating the correct dependencies and compiler/linker options from [`add_libc_hermetic`](https://github.com/llvm/llvm-project/blob/4098f568c46e06b6df470111868b4c165dd80f4d/libc/cmake/modules/LLVMLibCTestRules.cmake#L750). Slightly more involved changes:
- `BazelFilePath.cpp` also had to be fixed so that it doesn't depend on the non-namespaced `getenv` function. This PR models after https://github.com/llvm/llvm-project/commit/ee407f7e7069cccfdc1815de07e17cebf83d19f9 in order to conditionally use LLVM-libc's getenv under full-build mode.
- All tests have a dependency against `crt1.o` when run under full-build. This PR updates `merge_relocatable_object` so it also exposes a `CcInfo` with the merged object file and its transitive deps. In order to do so, this PR also makes the logic a little more careful about PIC vs non-PIC deps.
[Clang] Enable UBSan for AMDGPU device offload (#219973)
Summary:
This enables the device UBSan runtime for AMDGPU devices. Primarily this
required modifications to the `addSanitizerRuntime` interface so we can
query the compilation's offload status. Also need to forward it through
the linker wrapper interface. Works on all AMDGPU offload, slight hacks
around the other targets as they do not advertise sanitizer
runtimes properly.
This is linked in via a new `-u __ubsan_offload_init` hook to pull
in the side library. This is standard behavior and keeps the core logic
mostly unchanged and re-used.
---
<sub>Stack created with <a
href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a
href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
[compiler-rt] Add AMDGPU Device UndefinedBehaviorSanitizer runtime (#219972)
Summary:
This adds support for full UBSan on the AMDGPU target. The GPU build of
`compiler-rt` will now build `libclang_rt.ubsan_standalone.a` and the
host build will now provide `libclang_rt.ubsan_offload.a` for the
host-side formatting.
The **core** approach is to simply gather arguments from the device and
replay them on the host. The RPC interface acts as the narrow shim to
pass data between the CPU and GPU.
The changes to the core runtime are kept minimal, only exposing a few
needed hooks to re-run and symbolize reports coming from an external
caller. The device archive is a side-library which will only be present
for GPU offloading builds.
Putting this in `compiler-rt` via interceptors avoids an ABI edge
between many consumers, (OpenMP, HIP, Pytorch, etc). The runtime code is
[47 lines not shown]
textproc/py-affine-gaps: New port: JIT-compiled string edit-distances
PR: 298330
Approved by: Baptiste Daroussin <bapt at FreeBSD.org> (on behalf of portmgr@)
math/py-cbcbox: New port: Python access to the CBC MILP solver
PR: 298331
Approved by: Baptiste Daroussin <bapt at FreeBSD.org> (on behalf of portmgr@)
devel/py-types-s3transfer: New port: Type annotations and code completion for s3transfer
PR: 298334
Approved by: Baptiste Daroussin <bapt at FreeBSD.org> (on behalf of portmgr@)
18403 zpool: things get messy with 0 columns
Reviewed by: Bill Sommerfeld <sommerfeld at hamachi.org>
Approved by: Dan McDonald <danmcd at oxide.computer>
x11-wm/jwm: Make SVG option depend on CAIRO option
It seems that only enabling SVG option isn't enough for SVG-based
icon themes to work, so add SVG_IMPLIES=CAIRO.
Reported by: fernandel (on forums.freebsd.org)
URL: https://forums.freebsd.org/threads/jwm-pkg.103838/
Fixes: 4e3c1e294511 ("x11-wm/jwm: Enable SVG option by default")
Approved by: osa, vvd (Mentors, implicit)
libzfs_core: block delivery of SIGUSR1 in send_worker thread
This fixes a Linux-specific bug.
3a909fe33 (libzfs, libzfs_core: send: always write to pipe, 2022-02-21)
introduced a subtle bug where zfs send -RPv would not print status
information periodically anymore when the stdout is redirected to
something that isn't a pipe (e.g. >/dev/null).
This is because the send_worker thread introduced by this commit
is created with an unmodified signal mask from libzfs. When
zfs_send_space is called it creates this thread. When we request
verbose status information another thread is created which, in
theory, should periodically receive a SIGUSR1 via a POSIX timer.
The main thread blocks USR1 delivery *after* the creation of the
progress thread, leaving the send_worker thread's signal mask
unmodified. The delivery of SIGUSR1 is now random and for at least
Debian Trixie with kernel 6.12.107+deb13-amd64 this causes the
[12 lines not shown]
build: Fix building kernel module when builddir is different from srcdir
It was noticed and fixed in f2f4ada24 (Linux 6.10 compat: fix rpm-kmod
and builtin) that the kernel was changed in 6.10 to make it difficult
have the build directory be different from the source directory. The
fix is to copy the module sources to the build directory. However, the
fix was only applied to building distro packages. This same problem
exists when building outside of the root of the source tree.
Instead do the copy when building the modules-Linux target, which
initiates the kernel module build. Commit f2f4ada24 hardlinks the
source files because it knows they are on the same filesystem. However,
this is not necessarily true generally when having a separate build
directory. So make a symlink tree instead of hardlinks. Also, only do
the copy if the build directory is different from the source tree.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Glenn Washburn <development at efficientek.com>
Closes #19105
[DebugInfo][NVPTX]Avoid adding per line .loc in the ptx output for the compiler-generated inline ptx block. (#222764)
`NVPTXAsmPrinter::emitInlineAsm` splits the asm string on newlines and
emits a `.loc` per PTX instruction, incrementing the source line for
every physical line of the block. For a compiler-generated block, this
attributes the generated code to unrelated source lines, and for a long
enough block, to lines beyond the end of the file.
A DSL frontend can lower one source-level construct -- an assert, a
barrier, an intrinsic -- into a single block of inline PTX. The
individual lines of that block have no source correspondence; they all
belong to the one construct.
This change adds a check for isImplicitCode on the inline asm's
DILocation and skips the per-line path when it is set.
[Support] Make formatted_raw_ostream::has_colors() delegate to the wrapped stream (#223092)
Without this override, has_colors() falls back to is_displayed(), which
isn't always expected to give the same answer as the underlying stream's
has_colors().
This also fixes a compile-time regression when the underlying stream is
a raw_fd_ostream: raw_fd_ostream::has_colors() memoizes its result, but
without this override that memoization was bypassed in favor of the
uncached is_displayed(), issuing an isatty() syscall on every call.
#202441 is what surfaced this, by adding a has_colors() call to
TextDiagnostic's per-character hot loop.
rdar://186469856
Co-authored-by: Fred Riss <friss at apple.com>
[NFC] Hoist DiagOpts.showColors(OS.has_colors()) out of emitSnippet's per-character loop (#223095)
The result of DiagOpts.showColors(OS.has_colors()) does not change while
printing a single source snippet, so recomputing it for every character
is unnecessary. Compute it once per snippet instead.
rdar://186469856
Co-authored-by: Fred Riss <friss at apple.com>
18412 libproc checks core files for an ELF OSABI that is never set
Reviewed by: Robert Mustacchi <rm at fingolfin.org>
Approved by: Dan McDonald <danmcd at oxide.computer>
[llvm][test] Quote args in -print-on-crash test (#223472)
Passing `-passes=cgscc(trigger-crash-cgscc)` in lit works because of its
shell handling, but fails when passing directly to a shell: ` syntax
error near unexpected token '('`.