Closed
Description
This attribute is needed to prevent LLVM from optimizing a memcpy
implementation into a recursive call. However this attribute is not preserved in LTO builds: the attribute only works if it is set at the top-level crate.
Since crates containing implementations of built-in functions aren't meant to be called directly, they don't benefit from LTO and should be linked as a separate object.
One workaround (using rlibc as an example) is to first compile a rlibc_inner
crate as a staticlib with #![no_builtins]
, and then compile the rlibc
crate as a rlib which links to rlibc_inner.a
.
Metadata
Metadata
Assignees
Labels
No labels