-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Enable cross-language LTO for linux, windows and macos #806
Comments
Fixed #806 - Add new feature flag `cross-lang-fat-lto` and enable it on release for linux - Enable `-C linker-plugin-lto` for linux - Only use `-Z gcc-ld=lld` on non-windows targets when `cargo-zigbuild` is not enabled Signed-off-by: Jiahao XU <[email protected]>
This comment was marked as outdated.
This comment was marked as outdated.
Seems like default linker |
I can't get this to work:
tried passing Tried |
while we cannot enable cross-lang-fat-lto on MacOS due to linker error described [here], it turns out that enabling the feature `cross-lang-fat-lto` does not break the build. [here]: #806 (comment) Signed-off-by: Jiahao XU <[email protected]>
#1113 temporarily disable |
Since on linux we always uses |
zig v0.11.0 upgrades LLVM to 16, so now we are just waiting for cargo-zigbuild to update to zig v0.11.0 rust-cross/cargo-zigbuild#156 |
Since LLVM 17 is going to be released soon and cross-lang LTO is fragile due to these upgrades (old LLVM lld linker cannot parse new LLVM ir, possibly due to new IRs), I am going to close this as not planned. |
zstd already supports feature
fat-lto
andthin-lto
to build libzstd with LTO.All we need to do is to use
clang
andlld
for all targets and any target usescargo-zigbuild
they already useclang
.#805 will switch to using
rust-lld
which will resolve the second todo.I have also opened PR to add lto support to xz2 alexcrichton/xz2-rs#107 and bzip2 trifectatechfoundation/bzip2-rs#88
The text was updated successfully, but these errors were encountered: