summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2016-04-15 23:58:51 (GMT)
committerGregory P. Smith <greg@krypto.org>2016-04-15 23:58:51 (GMT)
commit79a12a2aa5087a840988a77a2e1c59c2febe182d (patch)
tree9e92dee3418aaa8cb2d39a7691ad8f782600b9c6 /configure
parenta9dd804c36b2ab4bbb0e90e541224ee21ef92d73 (diff)
parentd82da9f7f22cd0e81e4de3d7331668d3aa9b0811 (diff)
downloadcpython-79a12a2aa5087a840988a77a2e1c59c2febe182d.zip
cpython-79a12a2aa5087a840988a77a2e1c59c2febe182d.tar.gz
cpython-79a12a2aa5087a840988a77a2e1c59c2febe182d.tar.bz2
Issue #25702: A --with-lto configure option has been added that will
enable link time optimizations at build time during a make profile-opt.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure46
1 files changed, 46 insertions, 0 deletions
diff --git a/configure b/configure
index 8ab8dda..3d259485 100755
--- a/configure
+++ b/configure
@@ -673,6 +673,7 @@ LLVM_PROF_FILE
LLVM_PROF_MERGER
PGO_PROF_USE_FLAG
PGO_PROF_GEN_FLAG
+LTOFLAGS
ABIFLAGS
LN
MKDIR_P
@@ -807,6 +808,7 @@ with_suffix
enable_shared
enable_profiling
with_pydebug
+with_lto
with_hash_algorithm
with_address_sanitizer
with_libs
@@ -1487,6 +1489,8 @@ Optional Packages:
compiler
--with-suffix=.exe set executable suffix
--with-pydebug build with Py_DEBUG defined
+ --with-lto Enable Link Time Optimization in PGO builds.
+ Disabled by default.
--with-hash-algorithm=[fnv|siphash24]
select hash algorithm
--with-address-sanitizer
@@ -6560,6 +6564,48 @@ $as_echo "no" >&6; }
fi
+# Enable LTO flags
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-lto" >&5
+$as_echo_n "checking for --with-lto... " >&6; }
+
+# Check whether --with-lto was given.
+if test "${with_lto+set}" = set; then :
+ withval=$with_lto;
+if test "$withval" != no
+then
+ Py_LTO='true'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; };
+else
+ Py_LTO='false'
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; };
+fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+if test "$Py_LTO" = 'true' ; then
+ case $CC in
+ *clang*)
+ # Any changes made here should be reflected in the GCC+Darwin case below
+ LTOFLAGS="-flto"
+ ;;
+ *gcc*)
+ case $ac_sys_system in
+ Darwin*)
+ LTOFLAGS="-flto"
+ ;;
+ *)
+ LTOFLAGS="-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none"
+ ;;
+ esac
+ ;;
+ esac
+fi
+
# Enable PGO flags.