Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ldc-profgen tool #4536

Merged
merged 5 commits into from
Dec 2, 2023
Merged

Conversation

JohanEngelen
Copy link
Member

Needed for Sample-based PGO. See #4531

@JohanEngelen
Copy link
Member Author

JohanEngelen commented Nov 30, 2023

I don't understand the macOS arm64 failure.
The problem is that LLVM is downloaded without asserts enabled, but somehow CMake reports Building LDC with enabled assertions (LDC_ENABLE_ASSERTIONS): ON. Then when building ldc-profgen, there is a link error due to missing debug-only function symbol (asserts enabled, NDEBUG not defined (-UNDEBUG in compile commandline)). However, if this is the problem, then how did this ever work? There'd be an ABI mismatch and LDC should crash..?

Edit: Ah I see the cross build is using llvm-config of the host (not of the cross package). So then it makes sense that asserts are enabled. And perhaps we are just lucky that there are no ABI mismatches happening.

@kinke
Copy link
Member

kinke commented Dec 1, 2023

Ah, good catch wrt. llvm-config. I think I've added an LLVM arm64 build with enabled assertions a bit later, for the native Cirrus CI jobs.

There'd be an ABI mismatch and LDC should crash..?

The cross-compiled compiler isn't tested because it's not runnable on the host anyway. So we wouldn't have seen any CI runtime failures for untagged pipelines. So using enabled assertions doesn't make a lot of sense for these cross-builds; for the 1st native compiler it does though, so that we would see assertions while cross-compiling the compiler itself and its druntime/Phobos. But yeah, the host llvm-config on macOS diverging wrt. assertions mode and that potentially causing problems was a side effect that didn't cross my mind at all so far.

@JohanEngelen
Copy link
Member Author

All green now :)

@JohanEngelen JohanEngelen merged commit fff2bad into ldc-developers:master Dec 2, 2023
23 checks passed
@JohanEngelen JohanEngelen deleted the profgen branch December 2, 2023 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants