From e3b8749b11ce6763e1b413958b15955095ffd099 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 4 Nov 2009 09:40:15 +0000 Subject: c-opts.c (c_common_post_options): Move LTO option processing code ... 2009-11-04 Richard Guenther * c-opts.c (c_common_post_options): Move LTO option processing code ... * opts.c (decode_options): ... here. fortran/ * options.c (gfc_post_options): Rely on common code processing LTO options. Only enable -fwhole-file here. From-SVN: r153889 --- gcc/opts.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gcc/opts.c') diff --git a/gcc/opts.c b/gcc/opts.c index 72411b662cc..b2b6c4454ee 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1117,6 +1117,28 @@ decode_options (unsigned int argc, const char **argv) PARAM_VALUE (PARAM_STACK_FRAME_GROWTH) = 40; } + if (flag_lto || flag_whopr) + { +#ifdef ENABLE_LTO + flag_generate_lto = 1; + + /* When generating IL, do not operate in whole-program mode. + Otherwise, symbols will be privatized too early, causing link + errors later. */ + flag_whole_program = 0; + + /* FIXME lto. Disable var-tracking until debug information + is properly handled in free_lang_data. */ + flag_var_tracking = 0; +#else + error ("LTO support has not been enabled in this configuration"); +#endif + } + + /* Reconcile -flto and -fwhopr. Set additional flags as appropriate and + check option consistency. */ + if (flag_lto && flag_whopr) + error ("-flto and -fwhopr are mutually exclusive"); } #define LEFT_COLUMN 27 -- cgit v1.2.1