Skip to content

Conversation

@kinke
Copy link
Member

@kinke kinke commented Jul 27, 2024

No description provided.

@kinke kinke force-pushed the bump_ldc_llvm branch 2 times, most recently from 45fce4f to e0dca75 Compare July 28, 2024 10:13
@kinke
Copy link
Member Author

kinke commented Jul 29, 2024

Sigh, that macOS arm64 thing... no improvements with Xcode 16 by the looks of it (beta 3 used for both LLVM and LDC).

The unsupported-stack-probing-method (when enabling LTO for the C++ parts) seems to originate from https://github.com/llvm/llvm-project/blob/3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff/llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.cpp#L142, only supporting inline-asm apparently. Edit: Ah, introduced in LLVM 18: llvm/llvm-project#66524

According to https://stackoverflow.com/questions/78697653/how-do-i-get-a-clang-compiler-invocation-to-generate-debug-information, Apple clang might specify probe-stack=__chkstk_darwin.

So I guess what happens is that Apple have modified this in their fork, including patching that check for inline-asm. I've tried using -mno-stack-arg-probe -fno-stack-protector for the C++ parts then, in the hopes of turning off these stack probes for good, but no, the same error remains.

@kinke
Copy link
Member Author

kinke commented Jul 29, 2024

Btw, @ Apple users reading this: is there a way to figure out what LLVM version Apple-clang v16 is based on?

@kinke kinke marked this pull request as ready for review August 10, 2024 13:22
@kinke
Copy link
Member Author

kinke commented Aug 10, 2024

Okay, what seems to be working on macOS arm64 is skipping the bootstrap LDC build, using a pinned LDC v1.39 host compiler (based on LLVM 17, as Xcode 16) instead for the PGO-instrumented and final builds. I guess there's a breaking change in LLVM 18 wrt. stack checks on Apple arm64, causing these sporadic 'pure virtual func called' crashes with the C++ parts built with LLVM 17.

@kinke kinke merged commit 843844d into ldc-developers:master Aug 10, 2024
@kinke kinke deleted the bump_ldc_llvm branch August 10, 2024 16:12
@JohanEngelen
Copy link
Member

Okay, what seems to be working on macOS arm64 is skipping the bootstrap LDC build, using a pinned LDC v1.39 host compiler (based on LLVM 17, as Xcode 16) instead for the PGO-instrumented and final builds. I guess there's a breaking change in LLVM 18 wrt. stack checks on Apple arm64, causing these sporadic 'pure virtual func called' crashes with the C++ parts built with LLVM 17.

Thanks for the hard work of figuring out a solution!!

JohanEngelen pushed a commit to weka/ldc that referenced this pull request Aug 20, 2024
Get rid of cycles in DtoType() Merge pull request ldc-developers#4712 from kinke/bump_ldc_llvm Bump LDC-LLVM to v18.1.8 Revert "Merge pull request ldc-developers#4736 from kinke/fix4734" This reverts commit 53dc56a73f0704bee6fc5db82bae5e0d0b98f82b.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants