diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-05-02 14:13:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-03-25 17:58:45 +0300 |
commit | 81c91662d92bbfb35dfa031362240244c1534938 (patch) | |
tree | b5cb4e9de540fe2ac349db4b301ca60ab5a94f94 /configure.ac | |
parent | 04f57d1c837e6b4e03f1d003862bddb8e064459a (diff) | |
download | hercules-81c91662d92bbfb35dfa031362240244c1534938.tar.gz hercules-81c91662d92bbfb35dfa031362240244c1534938.tar.bz2 hercules-81c91662d92bbfb35dfa031362240244c1534938.tar.xz hercules-81c91662d92bbfb35dfa031362240244c1534938.zip |
Fix gcc lto.
Also rebuild configure.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index efe1f802e..6fef4ee4e 100644 --- a/configure.ac +++ b/configure.ac @@ -726,28 +726,57 @@ AC_LINK_IFELSE( if test "$enable_lto" != "no" ; then OLD_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -flto" + CFLAGS="$CFLAGS -flto -ffat-lto-objects -Werror" OLD_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -flto" + LDFLAGS="$LDFLAGS -flto -ffat-lto-objects" - AC_MSG_CHECKING([whether $CC supports -flto]) + AC_MSG_CHECKING([whether $CC supports -flto -ffat-lto-objects]) AC_RUN_IFELSE( [AC_LANG_SOURCE([ int main(int argc, char **argv){ + (void)argc; + (void)argv; return 0; } ])], [ AC_MSG_RESULT([yes]) + CFLAGS="$OLD_CFLAGS -flto -ffat-lto-objects" + LDFLAGS="$OLD_LDFLAGS -flto -ffat-lto-objects" ], [ AC_MSG_RESULT([no]) - CFLAGS="$OLD_CFLAGS" - LDFLAGS="$OLD_LDFLAGS" + CFLAGS="$OLD_CFLAGS -flto" + LDFLAGS="$OLD_LDFLAGS -flto" + AC_MSG_CHECKING([whether $CC supports -flto]) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([ + int main(int argc, char **argv){ + (void)argc; + (void)argv; + return 0; + } + ])], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + ], + [ + AC_MSG_RESULT([guessing no]) + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" + ] + ) ], [ AC_MSG_RESULT([guessing no]) + CFLAGS="$OLD_CFLAGS" + LDFLAGS="$OLD_LDFLAGS" ] ) fi |