@cryptotaxi247 / netdata-1 / commits / aa20eece2

allow -flto to be set when cross compiling

Costa Tsaousis (ktsaou) committed Mar 12, 2017 at 01:28 UTC aa20eece28fce4517d781b6c47ada472cb188faf
2 files changed +5 -3
configure.ac
+3 -1
@@ -405,9 +405,11 @@ fi
405 if test "${have_lto}" = "yes"; then
406 oCFLAGS="${CFLAGS}"
407 CFLAGS="${CFLAGS} -flto ${OPTIONAL_MATH_CLFAGS} ${OPTIONAL_NFACCT_CLFAGS} ${OPTIONAL_ZLIB_CLFAGS} ${OPTIONAL_UUID_CLFAGS} ${OPTIONAL_LIBCAP_CFLAGS} ${OPTIONAL_IPMIMONITORING_CFLAGS}"
408 + ac_cv_c_lto_cross_compile="${enable_lto}"
409 + test "${ac_cv_c_lto_cross_compile}" != "yes" && ac_cv_c_lto_cross_compile="no"
410 AC_C_LTO
411 CFLAGS="${oCFLAGS}"
410 - test "${ac_cv_c_lto}" = "no" && have_lto="no"
412 + test "${ac_cv_c_lto}" != "yes" && have_lto="no"
413 fi
414 test "${enable_lto}" = "yes" -a "${have_lto}" != "yes" && \
415 AC_MSG_ERROR([LTO is required but is not available.])
m4/ax_c_lto.m4
+2 -2
@@ -13,8 +13,8 @@ AC_DEFUN([AC_C_LTO],
13 ]])],
14 [ac_cv_c_lto=yes],
15 [ac_cv_c_lto=no],
16 - [ac_cv_c_lto=no])])
17 -if test $ac_cv_c_lto = yes; then
16 + [ac_cv_c_lto=${ac_cv_c_lto_cross_compile}])])
17 +if test "${ac_cv_c_lto}" = "yes"; then
18 AC_DEFINE([HAVE_LTO], 1,
19 [Define to 1 if -flto works.])
20 fi