Make -fwhole-program to work with incremental LTO linking
authorJan Hubicka <jh@suse.cz>
Wed, 21 Dec 2022 11:41:25 +0000 (12:41 +0100)
committerJan Hubicka <jh@suse.cz>
Wed, 21 Dec 2022 11:41:25 +0000 (12:41 +0100)
commit39ebd3a9f5cb8555bcb0422086e646ce833028a4
tree18b06befdc9a62afaaddc00c2daefc21c71a58d3
parent88709c4a1e6f8b69a33897a1ab46b8d66c4569c4
Make -fwhole-program to work with incremental LTO linking

Update documentation of -fwhole-program which was wrongly
claiming that it is useless with LTO whole it is useful for LTO without plugin
and extends -fwhole-program to also work with incremental linking.
This is useful when building kernel where the incremental link is de-facto fina
binary and only some explicitly marked symbols needs to remain.

Bootstrapped/regtested x86_64-linux, comitted.

gcc/ChangeLog:

2022-12-21  Jan Hubicka  <hubicka@ucw.cz>

* doc/invoke.texi: Fix documentation of -fwhole-program with LTO
and document behaviour for incremental linking.

gcc/lto/ChangeLog:

2022-12-21  Jan Hubicka  <hubicka@ucw.cz>

* lto-common.cc (lto_resolution_read): With incremental linking
and whole program ignore turn LDPR_PREVAILING_DEF_IRONLY to
LDPR_PREVAILING_DEF_IRONLY_EXP
* lto-lang.cc (lto_post_options): Do not clear flag_whole_program
for incremental link
gcc/doc/invoke.texi
gcc/lto/lto-common.cc
gcc/lto/lto-lang.cc