[lld][macho] Fix thunks with multiple text sections (#199747)
When there are multiple `__text` sections, LLD might not generate thunks
to stubs sections when they are required, leading to relocation errors.
```
ld64.lld: error: a.o:(symbol _foo+0x0): relocation BRANCH26 is out of range: 134217744 is not in [-134217728, 134217727]; references _extern_sym
```
Create `TextOutputSection::estimateStubsEndVA()` to correctly estimate
the end VA of the last stubs section so we can tell when branches to
stub symbols will be in range.
Technically this could cause lld to generate more thunks in some cases.
If a binary requires thunks (the `__TEXT` segment is >128MiB) and has
multiple `__text` sections like `__text_cold` or `__lcxx_override`, then
all branches to stub symbols will require thunks. Without this change we
could get the relocation errors above. We might be able to workaround
the problem by placing the `__text` section last.
Fixes https://github.com/llvm/llvm-project/issues/195387.
[HIP] Fix `-flto` overriding `--no-lto` not that it is default (#202699)
Summary:
The previous changes to LTO made the flto flag passed by default which
overrode the hack we did to ervert to the old non-LTO pipline. This is a
temporary hack so I'm hacking it even further to fix it.
workflows: Consolidate pr-subscriber and issue-subscriber (#200503)
This consolidates duplicate logic from the pr-subscriber and
issue-subscriber workflows into a single workflow.
[asan] Make exceptions for asan_new_delete.cpp conditional (#202436)
Introduce the COMPILER_RT_ASAN_ENABLE_EXCEPTIONS CMake
option to control whether the ASan C++ runtime
(asan_new_delete.cpp) is compiled with exception
support.
This fixes build failures on platforms with noexcept
toolchains (like Fuchsia's noexcept variant) where
ASan was compiled with exceptions but linked against a
noexcept libc++abi, resulting in undefined symbol
errors for __cxa_begin_catch and __gxx_personality_v0.
The option defaults to ON to preserve the behavior of
#200719, but automatically defaults to OFF if
LIBCXX_ENABLE_EXCEPTIONS or LIBCXXABI_ENABLE_EXCEPTIONS
is set to OFF in the same runtimes build.
[SLP] Recompute copyable operand deps of bundled members in scheduleBlock
An instruction modeled as a copyable element in one node may be used directly
by another node registered only after its deps were last computed. The
deferred recomputation is consumed before that node joins the tree, so the
direct def-use edge is missed and the count stays too low, tripping the
unscheduled-deps assertion. Clear and recompute such bundled members against
the full tree in scheduleBlock.
Fixes #202463
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/202712
[NFC][llvm-exegesis] Disable CFI-icall for JIT-executed function (#202472) (#202682)
Reland of #202472 reverted with #202571.
Here we are going to use LLVM_NO_SANITIZE.
[docs] Release man pages (#201376)
This adds the possibility to generate man pages from the `llvm/utils/release/build-docs.sh` script. Furthermore the `release-documentation` github workflow was modified to build and upload the man pages.
This was done to prevent dependency problems when myst-parser will become a hard dependency to build the documentation in LLVM. See https://discourse.llvm.org/t/rfc-make-myst-markdown-the-llvm-docs-format-rip-rest/90840/26?u=kwk
Additionally the `build-docs.sh` script now determines the release from the source directory if no release was given. Otherwise the generated tarballs would be missing the release entirely. To make it clear that something was generated from any git directory, a short git revision will be attached to the release (e.g. `23.0.0-gc823de88d51f58`).
The script generates a total of 67 man pages for the 22.1.7 release (see below).
`lld` has their own man page hardcoded in [`lld/docs/ld.lld.1`](https://github.com/llvm/llvm-project/blob/main/lld/docs/ld.lld.1). It gets packaged manually because of a missing cmake target. To get all projects install their man pages in the same directory to package up, we have to run the install targets rather than just the build targets (e.g. `install-docs-clang-man` instead of just `docs-clang-man`).
Here's what's in the tarball for the `22.1.7` release when you run the script from this change:
```console
$ rm -rf llvm_man_pages-* docs-build llvm-project
$ ./llvm/utils/release/build-docs.sh -no-sphinx -no-doxygen -release 22.1.7
```
[70 lines not shown]
NAS-141287 / 27.0.0-BETA.1 / Fix TrueCloud Backup hang on restic JSON error messages (by creatorcary) (#19098)
### Problem
`restic_check_progress()` crashed with `KeyError: 'error.message'`
whenever restic emitted an `error` message in its JSON output. restic
nests the text as `{"error": {"message": "..."}}` — the scripting docs
spell it `error.message`, but that is the path to a nested field, not a
flat key.
Two consequences:
- The real restic error was swallowed; the job/UI showed only
`'error.message'`, making failures undiagnosable.
- In the threaded reader, the `KeyError` silently killed the only
consumer of restic's stdout. With nobody draining the pipe, restic
blocked on a full pipe and the job hung in `RUNNING` at 0% indefinitely.
### Fix
[22 lines not shown]
[CIR][NFC] Align emitLValue with classic codegen (#202448)
This reorganizes the `CIRGenFunction::emitLValue` function to align it
with `CodeGenFunction::EmitLValueHelper` in classic codegen. Previously,
the default handler for the switch statement reported an NYI diagnostic
for any l-value class that wasn't handled in the function. This change
adds case handlers for every class that is handled by classic codegen,
giving each their own NYI diagnostic.
The purpose of this is to more explicitly show what is missing and to
make it easier to port the classic codegen implementation to CIR.
The existing CIR handling is not changed, just the order.
NAS-141287 / 26.0.0-RC.1 / Fix TrueCloud Backup hang on restic JSON error messages (#19092)
### Problem
`restic_check_progress()` crashed with `KeyError: 'error.message'`
whenever restic emitted an `error` message in its JSON output. restic
nests the text as `{"error": {"message": "..."}}` — the scripting docs
spell it `error.message`, but that is the path to a nested field, not a
flat key.
Two consequences:
- The real restic error was swallowed; the job/UI showed only
`'error.message'`, making failures undiagnosable.
- In the threaded reader, the `KeyError` silently killed the only
consumer of restic's stdout. With nobody draining the pipe, restic
blocked on a full pipe and the job hung in `RUNNING` at 0% indefinitely.
### Fix
[16 lines not shown]
[clang] Classify binary op value kinds use ClassifyExprValueKind when it's type-dependent (#202696)
The crash is from an internal inconsistency in Clang’s expression
classification.
Expr::ClassifyImpl computes a classification like CL_LValue or
CL_PRValue, then asserts that this agrees with the AST node’s own value
category:
- clang/lib/AST/ExprClassification.cpp:37
- CL_LValue must satisfy E->isLValue()
- CL_PRValue must satisfy E->isPRValue()
Fixes https://github.com/llvm/llvm-project/issues/202693.
Signed-off-by: yronglin <yronglin777 at gmail.com>
[Dexter] Add rewriting for aggregate variables
Following on from the previous patch, this patch allows Dexter to write
disaggregated expected values for aggregate variables. Dexter eagerly tries
to disaggregate whenever subvalues are available, but will fallback to the
root/parent value if all available subvalues are unavailable.
[Dexter] Add ability to rewrite scripts to fill-in unknown values
This patch adds a feature to Dexter that allows scripts to be passed to
Dexter with missing expected values (`null` values in YAML), which Dexter
will attempt to "fill-in" with expected values that match the debugger's
actual output. The result is written to a file with the same name as the
original test file, in the directory given by --results-directory if one
is present; all content outside of the Dexter script itself is preserved
exactly as-is.
unit/zap: key case normalization tests
Testing that normalized lookups work correctly for the supported
normalization forms, and that conflicts are detected and reported
correctly.
Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18654
zap: expose zap_remove_norm_by_dnode()
Just so the test suite can use it.
Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #18654
[lldb][Windows] extend @skipIfWindows to lldb-server or in process (#202688)
Some tests fail when using `lldb-server.exe` and pass when using the in
process plugin and vice-versa.
This patch adds the `skipIfWindowsAndNoLLDBServer` and
`expectedFailureWindowsAndNoLLDBServer` decorators (and their opposites)
to only skip tests if they run on `lldb-server` or the in process
plugin.
This fixes 4 XPASS when running tests with `USE_LLDB_SERVER=1`.
rdar://179117754
[OpenMP] Ignore teams ICV setters in restricted contexts (#194428)
This patch prevents `omp_set_num_teams()` and
`omp_set_teams_thread_limit()` from updating teams-related ICVs when
called from restricted runtime contexts.
The non-implicit parallel-region case follows the OpenMP 5.1
restriction. The active `teams`-region case is handled defensively
because these ICVs are device-scoped and updating them during an active
`teams` region can affect later teams execution.
The calls now warn and return without updating the ICVs.
Fixes #194426.