summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-09-20 01:40:32 (GMT)
committerGitHub <noreply@github.com>2023-09-20 01:40:32 (GMT)
commit3e3a7da590e1c3e5f03802e538f26c5204889c82 (patch)
tree2dd32d92e5094e6bbb817403ae1cdd7217aa9b67
parent5a740cd06ec1191767edcc6d3a7d5eca7873cb7b (diff)
downloadcpython-3e3a7da590e1c3e5f03802e538f26c5204889c82.zip
cpython-3e3a7da590e1c3e5f03802e538f26c5204889c82.tar.gz
cpython-3e3a7da590e1c3e5f03802e538f26c5204889c82.tar.bz2
gh-90108: Disable LTO on _freeze_module and _testembed (#109581)
LTO optimization is nice to make Python faster, but _freeze_module and _testembed performance is not important. Using LTO to build these two programs make a whole Python build way slower, especially combined with a sanitizer (like ASAN).
-rw-r--r--Makefile.pre.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index c94ffcb..363be68 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1062,7 +1062,7 @@ regen-re: $(BUILDPYTHON)
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/build/generate_re_casefix.py $(srcdir)/Lib/re/_casefix.py
Programs/_testembed: Programs/_testembed.o $(LINK_PYTHON_DEPS)
- $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)
+ $(LINKCC) $(PY_LDFLAGS_NOLTO) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)
############################################################################
# "Bootstrap Python" used to run deepfreeze.py
@@ -1163,7 +1163,7 @@ Programs/_freeze_module.o: Programs/_freeze_module.c Makefile
Modules/getpath_noop.o: $(srcdir)/Modules/getpath_noop.c Makefile
Programs/_freeze_module: Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN)
- $(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS)
+ $(LINKCC) $(PY_LDFLAGS_NOLTO) -o $@ Programs/_freeze_module.o Modules/getpath_noop.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS)
# We manually freeze getpath.py rather than through freeze_modules
Python/frozen_modules/getpath.h: Modules/getpath.py $(FREEZE_MODULE_BOOTSTRAP_DEPS)