[clang] [llvm] Reland: [llvm][clang] Allocate a new stack instead of spawning a new thread to get more stack space (PR #136046)

David Spickett via cfe-commits cfe-commits at lists.llvm.org
Fri May 2 02:41:22 PDT 2025


DavidSpickett wrote:

That build sets `-DLLVM_ENABLE_THREADS=OFF`. `LLVM_HAS_SPLIT_STACKS_AARCH64` and `LLVM_HAS_SPLIT_STACKS` are false, which means we use:
```
void llvm::runOnNewStack(unsigned StackSize, function_ref<void()> Fn) {
  llvm::thread Thread(
      StackSize == 0 ? std::nullopt : std::optional<unsigned>(StackSize), Fn);
  Thread.join();
}
```
Without threading I think this just calls the function.

So this test may need to 1 - only run on Apple Silicon and 2 - only when threading is enabled. I wonder if it passes on other platforms because stack protections make the offset look correct, something like that. We did not see this failing on AArch64 Linux for example.

https://github.com/llvm/llvm-project/pull/136046


More information about the cfe-commits mailing list