Change:
Running a build of , as part of a Koiji (Fedora Build System) job, I get the following for the target: Also see:
To my understanding this should be Rust
I think this is "just" an OOM situation. Fedora builds with full debuginfo by default, and this package is configured for fat LTO as well, which will all get quite heavy. When I tried to reproduce this with the stable toolchain, I got: It completed when I turned off debuginfo though. With Fedora's toolchain, I can reproduce your SIGSEGV in LLVM, but it also completes the build when debuginfo is off. My guess is that it is also hitting an allocation failure, but perhaps in a place that doesn't properly check the pointer before trying to use it.
With the rustup toolchain, it's running out of memory in LLVM's , which calls allocation methods that abort on failure. That's where we get the "LLVM ERROR: out of memory", "Allocation failed". With the Fedora toolchain, it's running out of memory in LLVM's , which calls to plain , throwing . Rust runs its own destructors during that unwind, in particular dropping that calls , and this segfaults in a (presumably the same one).
I encontered this when compiling a big proprietary project to --target=i686-unknown-linux-musl using nightly-2024-03-01 on a x86_64 host
with an x86_64 host and a different backtrace, I doubt that yours has the same root cause. I suggest filing a separate issue -- but it's going to be hard for anyone to help if they can't reproduce it, since your code is proprietary.

Discussion:
#[link(name = "llvm-wrapper", kind = "static")] extern "C" { <del> pub fn LLVMRustInstallFatalErrorHandler(); </del> <ins> pub fn LLVMRustInstallErrorHandlers(); </ins> pub fn LLVMRustDisableSystemDialogsOnCrash(); // Create and destroy contexts.

let mut llvm_c_strs = Vec::with_capacity(n_args + 1); let mut llvm_args = Vec::with_capacity(n_args + 1); <del> llvm::LLVMRustInstallFatalErrorHandler(); </del> <ins> llvm::LLVMRustInstallErrorHandlers(); </ins> // On Windows, an LLVM assertion will open an Abort/Retry/Ignore dialog // box for the purpose of launching a debugger. However, on CI this will // cause it to hang until it times out, which can take several hours.

#include <iostream> <ins> // for raw `write` in the bad-alloc handler #ifdef _MSC_VER #include <io.h> #else #include <unistd.h> #endif </ins> //===----------------------------------------------------------------------=== // // This file defines alternate interfaces to core functions that are more

exit(101); } <del> extern "C" void LLVMRustInstallFatalErrorHandler() { </del> <ins> // Custom error handler for bad-alloc LLVM errors. // // It aborts the process without any further allocations, similar to LLVM's // default except that may be configured to `throw std::bad_alloc()` instead. static void BadAllocErrorHandler(void *UserData, const char* Reason, bool GenCrashDiag) { const char *OOM = "rustc-LLVM ERROR: out of memoryn"; (void)!::write(2, OOM, strlen(OOM)); (void)!::write(2, Reason, strlen(Reason)); (void)!::write(2, "n", 1); abort(); } extern "C" void LLVMRustInstallErrorHandlers() { install_bad_alloc_error_handler(BadAllocErrorHandler); </ins> install_fatal_error_handler(FatalErrorHandler); <ins> install_out_of_memory_new_handler(); </ins> } extern "C" void LLVMRustDisableSystemDialogsOnCrash() {