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

Use linker-plugin-lto? #1486

Open
In-line opened this issue May 9, 2019 · 3 comments
Open

Use linker-plugin-lto? #1486

In-line opened this issue May 9, 2019 · 3 comments

Comments

@In-line
Copy link

In-line commented May 9, 2019

Rust has now support for linker plugin LTO. So if we build C and Rust codes with the same version of LLVM cross-language optimizations are possible.

https://doc.rust-lang.org/rustc/linker-plugin-lto.html

I like this project very much, I think this can potentially improve performance greatly (especially in FFI boundary).

I think this project should post benchmarks to. Maybe performance can be one of the selling points here?

@shaleh
Copy link
Collaborator

shaleh commented May 9, 2019

At the moment we perform less well and we know it. In part because we compile all of the Rust code as a library to be used by C which prevents the compiler for creating inlines. When I looked at LTO and the like it only worked when it was a Rust binary with C libraries and we are the reverse. Has this changed?

@froydnj
Copy link

froydnj commented May 9, 2019

We're working on doing LTO between C++ and Rust in Firefox and it works just fine to have a giant Rust library (staticlib) linked into C++. It doesn't work so well on win32 due to symbol mangling issues, which are getting addressed. It didn't work on osx due to rust-lang/rust#60235; while that issue is fixed in rust nightly, osx has some of the same symbol mangling issues that win32 does, so it's possible there's still work to be done there. We haven't tested on osx with a fixed rustc yet. (Note there's also rust-lang/rust#60059, which is somewhat of an compilation environment problem.)

@shaleh
Copy link
Collaborator

shaleh commented May 9, 2019

Would you like to post a PR and see how CI likes it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants