[lld] Fix undefined behavior with misaligned SHT_GROUP section. (#180848)
read32() allows misaligned values, but a `uint32_t &` must be properly
aligned even if it isn't directly read. ubsan detects this. To fix the
issue, replace the `uint32_t &` with a value that doesn't require
alignment.
Also added an assertion to catch similar misuse of getDataAs().
(Alternatively, we could make the input validation more strict, and
reject files with a misaligned SHT_GROUP, but I don't see any obvious
reason to require that.)
[CIR] Implement flattening for cleanup scopes with multiple exits (#180627)
This implements CFG flattening for cir.cleanup.scope operations where
the scope body has multiple exits that must all branch through the
cleanup region.
This uses the same strategy that Clang uses when generating LLVM IR for
equivalent cases -- a cleanup destination slot is allocated on the
stack, and a value is stored to this slot before each branch to the
cleanup, indicating where control must go after the cleanup is executed.
Substantial amounts of this PR were created using agentic AI tools, but
I have carefully reviewed the code, comments, and tests and made changes
as needed.
[RISCV] Combine Xqci Extensions in Arch Strings (#181033)
There are no instructions in the Xqci extension itself, it is just an
alias of a group. If we have all the items in the group, then we should
add `xqci` to the list of extensions we have.
This helps with multilib matching.
[lldb] Flatten GetCompilerType-MaybeCalculateCompleteType (NFC) (#181215)
`MaybeCalculateCompleteType` is not overridden anywhere, and is called
only from `GetCompilerType`.
emulators/playonbsd: Fix unwanted files in extract stage
Fix unwanted __pycache__ dir in extract stage instead of deletion in post
install.
PR: 287658
Reported by: diizzy
[WebAssembly] Error on Wasm SjLj if +exception-handling is missing (#181070)
This checks every user function of `setjmp` or `longjmp` and if any of
them does not have `+exception-handling` target feature, errors out.
Hopefully this gives a clearer error message to the users in case they
do not provide consistent SjLj flags at compile time vs. link time.
Closes #178135 and closes
https://github.com/emscripten-core/emscripten/issues/26165.
[llvm] Force TLSDESC for all TLS access in Fuchsia code
Fuchsia no longer supports TLS access via __tls_get_addr, and only
supports the TLSDESC ABI on all target machines.
Though we already set Fuchsia as enabling TLSDESC by default, LLD's LTO
pipeline is initialized with an empty target triple, and thus does not
correctly select the correct codegen options for Fuchsia's ABI. Instead,
we can additionally check if Fuchsia is the actual target if the option
isn't set, since useTLSDESC() is only called later, when a non-default
target triple will be available.
The alternative is to rework how LLD initializes the LTO code generation
options, so that it selects the correct target, and initializes them
correctly. However, that's a more invasive change, and would need some
discussion to make sure that is handled correctly across all of LLDs
supported formats (e.g. ELF, Mach-O, COFF, etc.).