build: remove -flto-partition=none

As reported in
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1714,
it was added to workaround a bug in GCC. That bug was fixed long ago
thus this option is no longer needed. Moreover, it increases the memory
usage during the build and we are geting some failures when building in
ppc64 systems that we suspect are due to memory exhaustion.

Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1714
This commit is contained in:
Íñigo Huguet 2025-02-11 16:27:27 +01:00
parent c627bbea4c
commit 35b76b7ca7
2 changed files with 4 additions and 17 deletions

View file

@ -164,11 +164,6 @@
%global ebpf_enabled "no"
%endif
# Fedora 33 enables LTO by default by setting CFLAGS="-flto -ffat-lto-objects".
# However, we also require "-flto -flto-partition=none", so disable Fedora's
# default and use our configure option --with-lto instead.
%define _lto_cflags %{nil}
###############################################################################
Name: NetworkManager

View file

@ -172,18 +172,10 @@ if enable_ld_gc
endif
enable_lto = get_option('b_lto')
if enable_lto
if cc.get_id() == 'clang'
clang_version = cc.version()
if clang_version <= '18.0.0'
error('Clang version should be greater then 18.0.0 got : ' + clang_version)
endif
else
# Meson already adds '-flto'
lto_flag = '-flto-partition=none'
assert(cc.has_argument(lto_flag), '-flto-partition=none not supported. Disable link-time optimization with -Db_lto=false.')
common_flags += lto_flag
common_ldflags += lto_flag
if enable_lto and cc.get_id() == 'clang'
clang_version = cc.version()
if clang_version <= '18.0.0'
error('Clang version should be greater then 18.0.0 got : ' + clang_version)
endif
endif