-
Notifications
You must be signed in to change notification settings - Fork 360
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 linkage attributes to extern "C" blocks #429
base: master
Are you sure you want to change the base?
Conversation
Interesting, yes, let's fix this. CI is showing some build failures in |
Oh I see what you mean, the avx512 situation adds another dimension to the matrix. I'll need a bit to untangle this. |
Oh dear it's the workflow approval dance. |
A bit of scope creep later, now I've:
|
Works on my machine too! |
👋 Just generating a notification to make sure this PR isn't lost. |
This crate is now used in the compiler since rust-lang/rust#126930.
The problem I'm fixing is just like rust-lang/rust#118084; if you try to run
After around 30 minutes (
-Zcross-crate-inline-threshold=always
makes compilation much slower) you getI think this is exactly the same problem as the above-linked issue: the blake3 crate does not have any
link(name =
attributes, so it only links correctly if all calls to theextern "C"
functions are monomorphized byblake3
crate. But with-Zcross-crate-inline-threshold=always
, nearly all monomorphization is done by the last crate to be compiled, and without these attributes we lose track of these symbols by the time we need them.I'm not filing an issue because I'm pretty sure nobody else cares about my silly flag continuing to work when bootstrapping the compiler, but I occasionally find legitimate codegen bugs with it, so I'm sending you the patch to keep it working.
I've confirmed in my local dev setup that this PR makes it again possible to build the compiler with
-Zcross-crate-inline-threshold=always
.