aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2023-08-28 17:17:28 +0300
committerMatias Elo <matias.elo@nokia.com>2023-09-01 13:45:43 +0300
commiteb5960b4c26c8487524bd6933e7c71fedc386b42 (patch)
treefb5c728fbba2bdf605ebc3e4647f74c5efdb6f06 /configure.ac
parent65e4d3f3c4b5be8d6339a43f63b3dfe2c17c0f35 (diff)
configure: enable parallel lto
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>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 8 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 0b91c6981..69290e34b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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"