Re: [systemd-devel] [PATCH] Changing configure.ac to make LTO optional.

2015-07-21 Thread David Herrmann
Hi

On Mon, Jul 20, 2015 at 4:56 PM, Kinsella, Ray ray.kinse...@intel.com wrote:
 There is a bug in GCC LTO such that it ignores assembler directives.
 This patch makes LTO enabled by default but also allows it to be disabled
 if required.

 See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47785

This is a gcc bug. They better fix it and backport it to stable. We do
not work around bugs in other software, unless they explicitly state
why it is not fixed in stable releases. I cannot see a statement why
this bug is unhandled since _2011_.

If gcc developers reject to respond to bug-reports, why do
distributions compile gcc with LTO enabled?

Anyway, why don't you use this workaround instead:
./configure CFLAGS=$CFLAGS -flto=n

*confused*
David

 ---
  configure.ac | 17 -
  1 file changed, 12 insertions(+), 5 deletions(-)

 diff --git a/configure.ac b/configure.ac
 index 999f9f8..294c440 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -194,11 +194,18 @@ AS_CASE([$CC], [*clang*],
 -Wno-gnu-variable-sized-type-not-at-end \
  ])])

 -AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
 -[CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
 -   -flto -ffat-lto-objects])],
 -[AC_MSG_RESULT([skipping -flto, optimization not enabled])])
 -AC_SUBST([OUR_CFLAGS], $with_cflags $sanitizer_cflags)
 +AC_ARG_ENABLE(lto,
 +[AS_HELP_STRING([--enable-lto], [Enable link time optimization])],
 +   enable_lto=$enableval,
 +   enable_lto=yes; default_enable_lto=yes)
 +
 +if test x$enable_lto != xno; then
 +AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
 +[CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
 +-flto -ffat-lto-objects])],
 +[AC_MSG_RESULT([skipping -flto, optimization not enabled])])
 +AC_SUBST([OUR_CFLAGS], $with_cflags $sanitizer_cflags)
 +fi

  AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
  [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
 --
 2.1.0

 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] Changing configure.ac to make LTO optional.

2015-07-20 Thread Kinsella, Ray
There is a bug in GCC LTO such that it ignores assembler directives.
This patch makes LTO enabled by default but also allows it to be disabled
if required.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47785

Ray Kinsella
---
 configure.ac | 17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 999f9f8..294c440 100644
--- a/configure.ac
+++ b/configure.ac
@@ -194,11 +194,18 @@ AS_CASE([$CC], [*clang*],
-Wno-gnu-variable-sized-type-not-at-end \
 ])])
 
-AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
-[CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
-   -flto -ffat-lto-objects])],
-[AC_MSG_RESULT([skipping -flto, optimization not enabled])])
-AC_SUBST([OUR_CFLAGS], $with_cflags $sanitizer_cflags)
+AC_ARG_ENABLE(lto,
+[AS_HELP_STRING([--enable-lto], [Enable link time optimization])],
+   enable_lto=$enableval,
+   enable_lto=yes; default_enable_lto=yes)
+
+if test x$enable_lto != xno; then
+AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
+[CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
+-flto -ffat-lto-objects])],
+[AC_MSG_RESULT([skipping -flto, optimization not enabled])])
+AC_SUBST([OUR_CFLAGS], $with_cflags $sanitizer_cflags)
+fi
 
 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
 [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
-- 
2.1.0

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] Changing configure.ac to make LTO optional.

2015-07-20 Thread systemd github import bot
Patchset imported to github.
To create a pull request, one of the main developers has to initiate one via:
https://github.com/systemd/systemd/compare/master...systemd-mailing-devs:1437404176.3279.2.camel%40intel.com

--
Generated by https://github.com/haraldh/mail2git
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel