Subject: bug#17806: 24.4.50; Branch emacs-24 fails to beuild on Debian

From: Paul Eggert <[email-masked]>
Date: Fri, 20 Jun 2014 12:48:02 -0700

Glenn Morris wrote:
> Why does Emacs even have --enable-link-time-optimization as a configure
> option? Does it provide any measurable benefit?

It's supposed to have better runtime performance.  In my standard little 
benchmark, though, --enable-link-time-optimization slowed down runtime 
CPU performance by 14% (x86-64, GCC 4.9.0).  It did shrink the 
executable's text size by 2.4%, but I'd rather have the CPU performance.

I installed the attached as emacs-24 bzr 117269 to try to discourage 
casual use.  Another possibility would be to remove 
--enable-link-time-optimization, but I suppose that should be done in 
the trunk if it's done at all.  I'll CC: this to Dmitry as he added the 
option in the first place.
=== modified file 'ChangeLog'
--- ChangeLog	2014-06-20 06:07:47 +0000
+++ ChangeLog	2014-06-20 19:46:18 +0000
@@ -1,5 +1,8 @@
 2014-06-20  Paul Eggert  <[email-masked]>
 
+	* configure.ac: Warn about --enable-link-time-optimization's issues
+	in --help message (Bug#17806).
+
 	Port to GCC 4.9.0 with link time optimization (Bug#17806).
 	* configure.ac (CFLAGS): With link time optimization,
 	use -ffat-lto-objects if supported; otherwise Emacs won't

=== modified file 'configure.ac'
--- configure.ac	2014-06-20 06:07:47 +0000
+++ configure.ac	2014-06-20 19:46:18 +0000
@@ -757,7 +757,10 @@
 AC_ARG_ENABLE(link-time-optimization,
 [AS_HELP_STRING([--enable-link-time-optimization],
                 [build emacs with link-time optimization.
-                 This is supported only for GCC since 4.5.0.])],
+		 This requires GCC 4.5.0 or later.
+		 It also makes Emacs harder to debug, and when we tried it
+		 with GCC 4.9.0 x86-64 it made Emacs slower, so it's not
+		 recommended for typical use.])],
 if test "${enableval}" != "no"; then
    AC_MSG_CHECKING([whether link-time optimization is supported])
    ac_lto_supported=no