summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-01-21 15:08:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-01-21 15:08:21 (GMT)
commitfcee3d36fd756683f04be4a52137afe680009517 (patch)
treedf7d6b01081f1f0b730ffbe78c9591d8ee64bccb /unix/tcl.m4
parentb0c8960e047e98418834bdddd879a3d1358c7607 (diff)
downloadtk-fcee3d36fd756683f04be4a52137afe680009517.zip
tk-fcee3d36fd756683f04be4a52137afe680009517.tar.gz
tk-fcee3d36fd756683f04be4a52137afe680009517.tar.bz2
Compile stub library with -fno-lto. See [https://core.tcl-lang.org/thread/info/98ae20f0f5|98ae20f0f5] for the reason why.
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m414
1 files changed, 14 insertions, 0 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 17c2956..4665f44 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -2054,6 +2054,19 @@ dnl # preprocessing tests use only CPPFLAGS.
AC_DEFINE(HAVE_CAST_TO_UNION, 1,
[Defined when compiler supports casting to union type.])
fi
+ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -fno-lto"
+ AC_CACHE_CHECK(for working -fno-lto,
+ ac_cv_nolto,
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ [ac_cv_nolto=yes],
+ [ac_cv_nolto=no])
+ )
+ CFLAGS=$hold_cflags
+ if test "$ac_cv_nolto" = "yes" ; then
+ CFLAGS_NOLTO="-fno-lto"
+ else
+ CFLAGS_NOLTO=""
+ fi
# FIXME: This subst was left in only because the TCL_DL_LIBS
# entry in tclConfig.sh uses it. It is not clear why someone
@@ -2068,6 +2081,7 @@ dnl # preprocessing tests use only CPPFLAGS.
AC_SUBST(CFLAGS_DEBUG)
AC_SUBST(CFLAGS_OPTIMIZE)
AC_SUBST(CFLAGS_WARNING)
+ AC_SUBST(CFLAGS_NOLTO)
AC_SUBST(LDFLAGS)
AC_SUBST(LDFLAGS_DEBUG)