summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-02-02 15:57:01 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2019-02-04 10:55:25 +0100
commite6cf4213a774020cfcc27983354c81b3e92caa9e (patch)
tree4b97a890410d4f34af1d3ac69295f5a98451a98f /m4
parentb114b00f0a52d8c3800ccb3f4e461d4ea9c7c20b (diff)
downloadNetworkManager-e6cf4213a774020cfcc27983354c81b3e92caa9e.tar.gz
build: fix building with LTO
Building with link-time optimization requires some tricks explained in [1]. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200#c28
Diffstat (limited to 'm4')
-rw-r--r--m4/compiler_options.m44
1 files changed, 2 insertions, 2 deletions
diff --git a/m4/compiler_options.m4 b/m4/compiler_options.m4
index 1f283db692..9d0c58814b 100644
--- a/m4/compiler_options.m4
+++ b/m4/compiler_options.m4
@@ -150,9 +150,9 @@ fi
AC_DEFUN([NM_LTO],
[AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], [Enable Link Time Optimization for smaller size (default: no)]))
if (test "${enable_lto}" = "yes"); then
- CC_CHECK_FLAG_APPEND([lto_flags], [CFLAGS], [-flto])
+ CC_CHECK_FLAG_APPEND([lto_flags], [CFLAGS], [-flto -flto-partition=none])
if (test -n "${lto_flags}"); then
- CFLAGS="-flto $CFLAGS"
+ CFLAGS="-flto -flto-partition=none $CFLAGS"
else
AC_MSG_ERROR([Link Time Optimization -flto is not supported.])
fi