Hi, this patch prevents lto-option to store some flags that does not make snese to store, in partiuclar dumpdir and -fresolution. These definitly should not be preserved from compile time to link time and in case of incremental linking they caused trouble with wrong resolution file being used in some cases.
I guess this is just tip of iceberg - I think we should switch to whitelisting options that needs saving rather than saving everything with few exceptions. This is however a separate issue. Bootstrapped/regtested x86_64-linux, OK? * lto-opts.c (lto_write_options): Skip OPT_dumpdir, OPT_fresolution_. Index: lto-opts.c =================================================================== --- lto-opts.c (revision 260042) +++ lto-opts.c (working copy) @@ -109,6 +109,8 @@ case OPT_SPECIAL_ignore: case OPT_SPECIAL_program_name: case OPT_SPECIAL_input_file: + case OPT_dumpdir: + case OPT_fresolution_: continue; default: