Add linkage attributes to extern "C" blocks #429
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
.