summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-02 14:13:33 +0300
committerAndrei Karas <akaras@inbox.ru>2017-03-25 17:58:45 +0300
commit81c91662d92bbfb35dfa031362240244c1534938 (patch)
treeb5cb4e9de540fe2ac349db4b301ca60ab5a94f94
parent04f57d1c837e6b4e03f1d003862bddb8e064459a (diff)
downloadhercules-81c91662d92bbfb35dfa031362240244c1534938.tar.gz
hercules-81c91662d92bbfb35dfa031362240244c1534938.tar.bz2
hercules-81c91662d92bbfb35dfa031362240244c1534938.tar.xz
hercules-81c91662d92bbfb35dfa031362240244c1534938.zip
Fix gcc lto.
Also rebuild configure.
-rwxr-xr-xconfigure60
-rw-r--r--configure.ac39
2 files changed, 86 insertions, 13 deletions
diff --git a/configure b/configure
index 46853a217..9e5c01851 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#! /bin/sh
-# From configure.ac b947fde.
+# From configure.ac b7b45b7c3.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
@@ -5153,17 +5153,19 @@ rm -f core conftest.err conftest.$ac_objext \
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"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -flto" >&5
-$as_echo_n "checking whether $CC supports -flto... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -flto -ffat-lto-objects" >&5
+$as_echo_n "checking whether $CC supports -flto -ffat-lto-objects... " >&6; }
if test "$cross_compiling" = yes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: guessing no" >&5
$as_echo "guessing no" >&6; }
+ CFLAGS="$OLD_CFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
else
@@ -5171,6 +5173,8 @@ else
/* end confdefs.h. */
int main(int argc, char **argv){
+ (void)argc;
+ (void)argv;
return 0;
}
@@ -5179,13 +5183,53 @@ if ac_fn_c_try_run "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+ CFLAGS="$OLD_CFLAGS -flto -ffat-lto-objects"
+ LDFLAGS="$OLD_LDFLAGS -flto -ffat-lto-objects"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- CFLAGS="$OLD_CFLAGS"
- LDFLAGS="$OLD_LDFLAGS"
+ CFLAGS="$OLD_CFLAGS -flto"
+ LDFLAGS="$OLD_LDFLAGS -flto"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -flto" >&5
+$as_echo_n "checking whether $CC supports -flto... " >&6; }
+ if test "$cross_compiling" = yes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: guessing no" >&5
+$as_echo "guessing no" >&6; }
+ CFLAGS="$OLD_CFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ int main(int argc, char **argv){
+ (void)argc;
+ (void)argv;
+ return 0;
+ }
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ CFLAGS="$OLD_CFLAGS"
+ LDFLAGS="$OLD_LDFLAGS"
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
@@ -8346,7 +8390,7 @@ Linux* )
LIBS="$LIBS -ldl"
;;
FreeBSD*)
- CPPFLAGS="$CPPFLAGS -D__FREEBSD__"
+ CPPFLAGS="$CPPFLAGS -D__FREEBSD__ -fvisibility=hidden"
;;
NetBSD*)
CPPFLAGS="$CPPFLAGS -D__NETBSD__"
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