Будет ли разница в производительности / стабильности?
Стоят ли эти различия времени, необходимого для перекомпиляции всего мира?
Я хотел бы услышать предложения, объяснения, лучшие практики от опытных пользователей / сопровождающих / программистов / администраторов Gentoo ...
Заранее большое спасибо!
По вашей ссылке они действительно не побуждают вас менять их. Они просто говорят, что это не обязательно. Также вы их не меняли. Выходные данные `emerge --info` - это то, что уже установлено, поэтому установка этого же значения явно ничего не меняет. Этот вопрос может быть больше по теме на unix.stackexchange.com, поэтому не смущайтесь, когда он перемещается туда (учетные записи с обоих сайтов объединяются, если вы регистрируетесь с одинаковой аутентификацией),
Tim 10 лет назад
0
@Tim Вы когда-нибудь понимали, что `--as-required` автоматически заменяется на` -Wl, -flto -Wl, -O2`?
user2868193 10 лет назад
0
Извините, что пропустил эту разницу. Вы меняете что-то их. Кстати: разве вы не должны также включить LTO в LDFLAGS?
Tim 10 лет назад
0
Кстати, `-march` является надмножеством` -mtune`. Иметь и то, и другое бессмысленно.
Daniel B 9 лет назад
0
2 ответа на вопрос
1
robbat2
You don't need to change your CFLAGS there to add -Wl,-lfto; unless there are some packages that are mistakenly using CFLAGS for linking, it won't help (and those packages should be reported to bugzilla).
You do however need to add -flto to LDFLAGS to get full benefit of LTO. LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-flto"
You will not actually get LTO performance until you have the addition in your LDFLAGS, so yes, you will need to recompile anything that did not explicitly enable/disable LTO itself.
1
anonymous
When doing LTO builds, it is important to pass the same optimization flags to both the compiler and the LTO linker. This does not mean just -On, but actually all other optimization flags.
When you build the final binary and link using the compiler itself in a single pass, it all works. If you do it in two passes (libtool, I am looking at you!) then all hell breaks loose.
So, yes, it is exactly right to enforce that everything optimization-related in CFLAGS and CXXFLAGS is also present in LDFLAGS. And they mustmatch for the results to be correct, the fact that the gcc documentation seems to imply otherwise is a reported bug against gcc.
Whether you need to enforce it by doing nothing special to LDFLAGS, or duplicating them in LDFLAGS depends on the build system used by the package, and whether late-linking by libtool and its ilk will happen.