emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/1] Stop using legacy -ffat-lto-objects flag


From: Evan Klitzke
Subject: [PATCH 1/1] Stop using legacy -ffat-lto-objects flag
Date: Sun, 08 Nov 2020 12:05:28 -0800
User-agent: mu4e 1.4.13; emacs 28.0.50


Currently when Emacs is configured using the --enable-link-time-optimization configure flag, the build will use the -ffat-lto-objects flag if the host compiler is GCC (but not Clang). According to the comments in configure.ac this is to work around an issue with LTO builds in GCC 4.9.0. This flag makes builds take much longer (and produces much larger object files), so I suggest removing it as GCC 4.x is quite old at this point and doesn't have great LTO support anyway.

Patch to remove this logic from configure.ac is attached inline below (generated using git format-patch). I agree to copyright assignment of this change to the FSF.

>From b04dec1d217a82985e5d8e47fc2c305900ae68d7 Mon Sep 17 00:00:00 2001
From: Evan Klitzke <evan@eklitzke.org>
Date: Sun, 8 Nov 2020 11:46:30 -0800
Subject: [PATCH] Stop using legacy -ffat-lto-objects option in LTO builds

This change stops using the -ffat-lto-objects flag with GCC for builds
that use --enable-link-time-optimization. This option was originally
added to support GCC 4.9 which is very old, and makes compiling LTO
builds on modern versions of GCC significantly slower.
---
 configure.ac | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index f0c8e5210f..71a931da9e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1171,13 +1171,6 @@ AC_DEFUN
         # command, so plugin name is appended to ARFLAGS.
         ARFLAGS="cru --plugin $GOLD_PLUGIN"
         RANLIB="$RANLIB --plugin $GOLD_PLUGIN"
-      else
-        dnl The following is needed for GCC 4.9.0.  The GCC 4.9.0 release notes
-        dnl suggest that instead of -ffat-lto-objects we should use gcc-ar and
-        dnl gcc-ranlib in place of ar and ranlib, but gcc-ar makes /usr/bin/ar
-        dnl dump core on Fedora 20, so play it safe for now.
-        gl_COMPILER_OPTION_IF([-ffat-lto-objects],
-          [CFLAGS="$CFLAGS -ffat-lto-objects"])
       fi
    fi
 fi)
-- 
2.28.0


--
Evan Klitzke                      pgp: 0x157EFCACBC648422
e: evan@eklitzke.org              w: https://eklitzke.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]