Skip to content

Commit

Permalink
configure: enable parallel lto
Browse files Browse the repository at this point in the history
Add 'auto' argument to '-flto' to enable parallel LTO jobs, which may
reduce linking duration. Also, fixes "using serial compilation of N LTRANS
jobs" warnings when using GCC-12.

The '-flto=auto' and '-ffat-lto-objects' options are currently not
supported by clang.

Signed-off-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com>
  • Loading branch information
MatiasElo committed Sep 1, 2023
1 parent 65e4d3f commit eb5960b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,14 @@ AC_ARG_ENABLE([lto],
# Fat LTO object file contains GIMPLE bytecodes and the usual
# final code. There are less build problems (e.g. due to older
# binutils), but object files are larger.
ODP_LTO_FLAGS="-flto -ffat-lto-objects"
#
# -flto=auto and -ffat-lto-objects are currently not supported by clang.
$CC --version | grep -q clang
if test $? -ne 0; then
ODP_LTO_FLAGS="-flto=auto -ffat-lto-objects"
else
ODP_LTO_FLAGS="-flto"
fi
fi])

ODP_CFLAGS="$ODP_CFLAGS $ODP_LTO_FLAGS"
Expand Down

0 comments on commit eb5960b

Please sign in to comment.