This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Enale -fno-fat-lto-objects by default
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 18 Nov 2013 19:04:59 +0100
- Subject: Enale -fno-fat-lto-objects by default
- Authentication-results: sourceware.org; auth=none
Hi,
this patch switches the default for fat-lto-objects as was documented for a while.
-ffat-lto-objects doubles compilation time and often makes users to not notice that
LTO was not used at all (because they forgot to use gcc-ar/gcc-nm plugins).
Sadly I had to add -ffat-lto-objects to bootstrap. This is because I do not know
how to convince our build machinery to use gcc-ar/gcc-nm during the stage2+
ltobootstrapped/regtested ppc64-linux, OK?
Honza
* config/bootstrap-lto.mk: Use -ffat-lto-objects.
* common.opt (ffat-lto-objects): Disable by default.
* doc/invoke.texi (fat-lto-objects): Update documentation.
* opts.c: Enable fat-lto-objects on lto plugin disable setups.
Index: config/bootstrap-lto.mk
===================================================================
*** config/bootstrap-lto.mk (revision 204971)
--- config/bootstrap-lto.mk (working copy)
***************
*** 1,5 ****
# This option enables LTO for stage2 and stage3.
! STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1
! STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1
STAGEprofile_CFLAGS += -fno-lto
--- 1,7 ----
# This option enables LTO for stage2 and stage3.
+ # FIXME: Our build system is not yet able to use gcc-ar wrapper, so we need
+ # to go with -ffat-lto-objects.
! STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
! STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
STAGEprofile_CFLAGS += -fno-lto
Index: gcc/common.opt
===================================================================
*** gcc/common.opt (revision 204971)
--- gcc/common.opt (working copy)
*************** ffast-math
*** 1156,1162 ****
Common
ffat-lto-objects
! Common Var(flag_fat_lto_objects) Init(1)
Output lto objects containing both the intermediate language and binary output.
ffinite-math-only
--- 1156,1162 ----
Common
ffat-lto-objects
! Common Var(flag_fat_lto_objects)
Output lto objects containing both the intermediate language and binary output.
ffinite-math-only
Index: gcc/doc/invoke.texi
===================================================================
*** gcc/doc/invoke.texi (revision 204971)
--- gcc/doc/invoke.texi (working copy)
*************** need to support linker plugins to allow
*** 8588,8596 ****
@command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
to these tools. With non fat LTO makefiles need to be modified to use them.
! The default is @option{-ffat-lto-objects} but this default is intended to
! change in future releases when linker plugin enabled environments become more
! common.
@item -fcompare-elim
@opindex fcompare-elim
--- 8588,8595 ----
@command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
to these tools. With non fat LTO makefiles need to be modified to use them.
! The default is @option{-fno-fat-lto-objects} on targets with linker plugin
! support.
@item -fcompare-elim
@opindex fcompare-elim
Index: gcc/opts.c
===================================================================
*** gcc/opts.c (revision 204971)
--- gcc/opts.c (working copy)
*************** finish_options (struct gcc_options *opts
*** 806,813 ****
error_at (loc, "LTO support has not been enabled in this configuration");
#endif
if (!opts->x_flag_fat_lto_objects && !HAVE_LTO_PLUGIN)
! error_at (loc, "-fno-fat-lto-objects are supported only with linker plugin.");
! }
if ((opts->x_flag_lto_partition_balanced != 0) + (opts->x_flag_lto_partition_1to1 != 0)
+ (opts->x_flag_lto_partition_none != 0) >= 1)
{
--- 806,817 ----
error_at (loc, "LTO support has not been enabled in this configuration");
#endif
if (!opts->x_flag_fat_lto_objects && !HAVE_LTO_PLUGIN)
! {
! if (opts_set->x_flag_fat_lto_objects)
! error_at (loc, "-fno-fat-lto-objects are supported only with linker plugin.");
! opts->x_flag_fat_lto_objects = 1;
! }
! }
if ((opts->x_flag_lto_partition_balanced != 0) + (opts->x_flag_lto_partition_1to1 != 0)
+ (opts->x_flag_lto_partition_none != 0) >= 1)
{