mirror of https://github.com/python/cpython
bpo-31354: Let configure --with-lto work on all builds
Allow configure --with-lto to apply to all builds, not just profile-opt builds. Whether this is actually useful or not must be determined by the person building CPython using their own toolchain. My own quick test on x86_64 Debian 9 (gcc 6.3, binutils 2.28) seemed to suggest that it wasn't, but I expect better toolchains can or will exist at some point. The point is to allow it at all.
This commit is contained in:
parent
b3ad0e5127
commit
4c81401b3a
|
@ -463,7 +463,7 @@ profile-opt:
|
|||
$(MAKE) profile-removal
|
||||
|
||||
build_all_generate_profile:
|
||||
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG) @LTOFLAGS@" LIBS="$(LIBS)"
|
||||
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"
|
||||
|
||||
run_profile_task:
|
||||
@ # FIXME: can't run for a cross build
|
||||
|
@ -473,7 +473,7 @@ build_all_merge_profile:
|
|||
$(LLVM_PROF_MERGER)
|
||||
|
||||
build_all_use_profile:
|
||||
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_USE_FLAG) @LTOFLAGS@" LDFLAGS="$(LDFLAGS) @LTOFLAGS@"
|
||||
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_USE_FLAG)" LDFLAGS="$(LDFLAGS)"
|
||||
|
||||
# Compile and run with gcov
|
||||
.PHONY=coverage coverage-lcov coverage-report
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Allow --with-lto to be used on all builds, not just `make profile-opt`.
|
|
@ -679,7 +679,6 @@ LLVM_PROF_FILE
|
|||
LLVM_PROF_MERGER
|
||||
PGO_PROF_USE_FLAG
|
||||
PGO_PROF_GEN_FLAG
|
||||
LTOFLAGS
|
||||
DEF_MAKE_RULE
|
||||
DEF_MAKE_ALL_RULE
|
||||
ABIFLAGS
|
||||
|
@ -1511,8 +1510,8 @@ Optional Packages:
|
|||
--with-suffix=.exe set executable suffix
|
||||
--with-pydebug build with Py_DEBUG defined
|
||||
--with-assertions build with C assertions enabled
|
||||
--with-lto Enable Link Time Optimization in PGO builds.
|
||||
Disabled by default.
|
||||
--with-lto Enable Link Time Optimization in any build. Disabled
|
||||
by default.
|
||||
--with-hash-algorithm=[fnv|siphash24]
|
||||
select hash algorithm
|
||||
--with-address-sanitizer
|
||||
|
@ -6511,7 +6510,6 @@ else
|
|||
fi
|
||||
|
||||
# Enable LTO flags
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-lto" >&5
|
||||
$as_echo_n "checking for --with-lto... " >&6; }
|
||||
|
||||
|
@ -6557,6 +6555,8 @@ if test "$Py_LTO" = 'true' ; then
|
|||
esac
|
||||
;;
|
||||
esac
|
||||
CFLAGS="$CFLAGS $LTOFLAGS"
|
||||
LDFLAGS="$LDFLAGS $LTOFLAGS"
|
||||
fi
|
||||
|
||||
# Enable PGO flags.
|
||||
|
|
|
@ -1282,9 +1282,8 @@ else
|
|||
fi
|
||||
|
||||
# Enable LTO flags
|
||||
AC_SUBST(LTOFLAGS)
|
||||
AC_MSG_CHECKING(for --with-lto)
|
||||
AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in PGO builds. Disabled by default.]),
|
||||
AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in any build. Disabled by default.]),
|
||||
[
|
||||
if test "$withval" != no
|
||||
then
|
||||
|
@ -1319,6 +1318,8 @@ if test "$Py_LTO" = 'true' ; then
|
|||
esac
|
||||
;;
|
||||
esac
|
||||
CFLAGS="$CFLAGS $LTOFLAGS"
|
||||
LDFLAGS="$LDFLAGS $LTOFLAGS"
|
||||
fi
|
||||
|
||||
# Enable PGO flags.
|
||||
|
|
Loading…
Reference in New Issue