Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,6 @@ Linker options
Currently, this sets relative runtime library paths on Linux and for
non-framework macOS builds. Framework relocation is not implemented yet.
Combining this option with :option:`--enable-framework` is an error.
Combining it with :option:`--enable-bolt` is an error.

Move the installation as a unit. It must use the default ``bin`` and ``lib``
directories under a common prefix. :option:`--with-platlibdir` may select
Expand Down
16 changes: 14 additions & 2 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,10 @@ profile-opt: profile-run-stamp

# List of binaries that BOLT runs on.
BOLT_BINARIES := @BOLT_BINARIES@
ifeq ($(RELOCATABLE),yes)
# Optimize libraries before the interpreter, which depends on their timestamps.
RELOCATABLE_BOLT_BINARIES = $(addprefix $(RELOCATABLE_DIR)/,$(filter-out $(BUILDPYTHON),$(BOLT_BINARIES)) $(BUILDPYTHON))
endif

BOLT_INSTRUMENT_FLAGS := @BOLT_INSTRUMENT_FLAGS@
BOLT_APPLY_FLAGS := @BOLT_APPLY_FLAGS@
Expand All @@ -896,13 +900,13 @@ clean-bolt:
# Profile data.
rm -f *.fdata
# Pristine binaries before BOLT optimization.
rm -f *.prebolt
rm -f *.prebolt $(RELOCATABLE_DIR)/*.prebolt
# BOLT instrumented binaries.
rm -f *.bolt_inst

profile-bolt-stamp: $(BUILDPYTHON)
# Ensure a pristine, pre-BOLT copy of the binary and no profile data from last run.
for bin in $(BOLT_BINARIES); do \
for bin in $(BOLT_BINARIES) $(RELOCATABLE_BOLT_BINARIES); do \
prebolt="$${bin}.prebolt"; \
if [ -e "$${prebolt}" ]; then \
echo "Restoring pre-BOLT binary $${prebolt}"; \
Expand All @@ -928,6 +932,14 @@ profile-bolt-stamp: $(BUILDPYTHON)
@LLVM_BOLT@ "$${bin}.prebolt" -o "$${bin}.bolt" -data="$${bin}.fdata" $(BOLT_APPLY_FLAGS); \
mv "$${bin}.bolt" "$${bin}"; \
done
# Install variants are linked from the same objects, so reuse the function profiles.
for bin in $(RELOCATABLE_BOLT_BINARIES); do \
@LLVM_BOLT@ "$${bin}.prebolt" -o "$${bin}.bolt" -data="$${bin##*/}.fdata" $(BOLT_APPLY_FLAGS); \
mv "$${bin}.bolt" "$${bin}"; \
done
if test "$(RELOCATABLE)" = yes && test -n "$(filter $(INSTSONAME),$(BOLT_BINARIES))"; then \
$(LN) -f $(RELOCATABLE_DIR)/$(INSTSONAME) $(INSTALL_LDLIBRARY); \
fi
touch $@

.PHONY: bolt-opt
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Support :option:`--enable-bolt` with :option:`--enable-relocatable`
by applying the build-tree profiles to the separately linked installation
interpreter and, when applicable, shared library.
7 changes: 0 additions & 7 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2215,10 +2215,6 @@ else
fi],
[AC_MSG_RESULT([no])])

AS_IF([test "$enable_relocatable" = yes && test "$Py_BOLT" = true], [
AC_MSG_ERROR([--enable-relocatable does not support --enable-bolt yet])
])

AC_SUBST([PREBOLT_RULE])
if test "$Py_BOLT" = 'true' ; then
PREBOLT_RULE="${DEF_MAKE_ALL_RULE}"
Expand Down
Loading