LTO: Add -flto to LDFLAGS for clang

GCC automatically detects when it is linking LTO objects, but clang does
not.  Add -flto to LDFLAGS to make this work for clang too.

Signed-off-by: Allan McRae <allan@archlinux.org>
(cherry picked from commit 26ee6ff6ad)
This commit is contained in:
Allan McRae 2021-12-24 17:59:32 +10:00
parent 53289acdc9
commit 0352053e30

View file

@ -33,5 +33,6 @@ buildenv_lto() {
if check_option "lto" "y"; then
CFLAGS+=" -flto"
CXXFLAGS+=" -flto"
LDFLAGS+=" -flto"
fi
}