-
Notifications
You must be signed in to change notification settings - Fork 96
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
RUSTFLAGS
support
#162
Comments
Now that I think about it, we can handle Fortran right now. I'm pretty sure we can set |
Add note about {F,FF,OBJ}FLAGS variables. Address #162 Signed-off-by: Shane Peelar <lookatyouhacker@gmail.com>
Additional reading: rust-lang/rust#48518 Interestingly, ThinLTO leaves out certain optimizations that monolithic LTO enables. I'm experimenting with monolithic LTO currently. |
To anyone wanting to try out rust LTO. For ThinLTO:
For monolithic LTO:
|
Ahh yes, I moved a little too fast on this one. It turns out that |
Not a LTO issue but on a quick side-note, can't say I know much about rust but I had been building firefox with |
The -Z flag doesn't work (anymore?), is this because I'm not on a nightly rust build? I did some research on my own and these are the flags I came up with:
(MARCH is set to the processor architecture, (n)threads equals the thread count) I'm having issues compiling with these flags. Rust complains that |
that doesn't work because cargo has its own idea of whether lto is active. bashrc:
make.conf:
notes:
|
So do I understand this correctly and is EDIT: Compilation failed so I guess it is not |
no. as I said, you must enable lto in both rustc and cargo, if cargo is in use. |
Okay thanks, Rust stuff is all quite new to me. |
Is there documentation on |
I haven't heard of it either. Looks like they're called hook functions: https://dev.gentoo.org/~zmedico/portage/doc/portage.html#config-bashrc-ebuild-phase-hooks It's only mentioned in passing in the bashrc wiki page: https://wiki.gentoo.org/wiki//etc/portage/bashrc |
it could probably use BashrcdPhase too, like |
@Hello71, does "-C linker-plugin-lto" still works in your system configuration as in my system "-C linker-plugin-lto" does't work anymore ? |
RUSTFLAGS is fragile as a system-wide config, since stacking is handled inconsistently by each package (usually overridden). Additionally, linker-plugin-lto requires clang LTO to be used; LLVM LTO is not compatible with gcc LTO. |
The LLVM framework has its own way of handling LTO, using ThinLTO or otherwise. We should investigate how to add that into GentooLTO using the
RUSTFLAGS
environment variable. I'm thinking we should use ThinLTO by default, and fallback to plain LTO if that fails. I think another flag,RUSTLINKFLAGS
, may be of use for these packages.This should help with the rust related packages we've been seeing more often here. Unfortunately, it's not possible to perform interprocedural optimizations using LTO across GCC and LLVM boundaries. If a GCC frontend for rust ever emerges, then we'd be able to optimize across rust, C, and C++ boundaries. Otherwise, you'd have to use clang system-wide to achieve that result, as in issue #146.
This could be particularly good for
www-client/firefox
, for example.The text was updated successfully, but these errors were encountered: