Skip to content
Merged
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
18 changes: 18 additions & 0 deletions Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,24 @@ also be used to improve performance.
BOLT versions before LLVM 16 are known to crash BOLT under some scenarios.
Use of LLVM 16 or newer for BOLT optimization is strongly encouraged.

BOLT does not preserve protection against Cortex-A53 erratum 843419. Binaries
processed by BOLT must not run on processors affected by this erratum,
including during the build. On AArch64, :program:`configure` reports an error
if build flags explicitly request the workaround. Recent BOLT versions reject
workaround veneers by default during the build, including when the workaround
is enabled by compiler defaults.

If none of the generated executables or shared libraries will run on affected
processors, disable the workaround explicitly. For GCC toolchains that enable
it by default, pass ``-mno-fix-cortex-a53-843419`` through
:envvar:`LDFLAGS_NODIST`::

LDFLAGS_NODIST="-mno-fix-cortex-a53-843419" ./configure --enable-bolt

Remove any explicit ``-mfix-cortex-a53-843419`` or
``-Wl,--fix-cortex-a53-843419`` flags from the build configuration. The GCC
option does not override explicit linker flags.

The :envvar:`!BOLT_INSTRUMENT_FLAGS` and :envvar:`!BOLT_APPLY_FLAGS`
:program:`configure` variables can be defined to override the default set of
arguments for :program:`llvm-bolt` to instrument and apply BOLT data to
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Report a configuration error when ``--enable-bolt`` is used with build flags
that explicitly request the Cortex-A53 erratum 843419 workaround. Document how to
disable the workaround for builds that will not run on affected processors.
27 changes: 27 additions & 0 deletions configure

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

18 changes: 18 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2212,6 +2212,24 @@ if test "$Py_BOLT" = 'true' ; then
CFLAGS_NODIST="$CFLAGS_NODIST -fno-reorder-blocks-and-partition"
])

# BOLT rejects binaries with Cortex-A53 erratum 843419 workaround veneers,
# see https://github.com/llvm/llvm-project/pull/187955
# Check explicit flags here to provide a friendlier error. Recent BOLT
# versions reject workaround veneers by default, including those
# from compiler defaults, so we do not perform exhaustive detection.
AS_CASE([$host_cpu], [aarch64*], [
AS_CASE(["$CC $CFLAGS $CPPFLAGS $CFLAGS_NODIST $LDFLAGS $LDFLAGS_NODIST $LIBS"],
[*-mfix-cortex-a53-843419*|*--fix-cortex-a53-843419*], [
AC_MSG_ERROR([--enable-bolt is incompatible with the Cortex-A53 erratum 843419 workaround.
BOLT does not preserve protection against this erratum. Its output must not run
on affected Cortex-A53 processors, including during the build.
If the generated binaries will never run on affected processors, disable the
workaround explicitly. With GCC, configure with
LDFLAGS_NODIST="-mno-fix-cortex-a53-843419". Also remove any explicit
-mfix-cortex-a53-843419 or -Wl,--fix-cortex-a53-843419 flags.])
])
])

# These flags are required for bolt to work:
LDFLAGS_NODIST="$LDFLAGS_NODIST -Wl,--emit-relocs"

Expand Down
Loading