From 06f85cc351558611650cc06e6aed52f6c72918c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8D=C3=B1igo=20Huguet?= Date: Mon, 10 Feb 2025 16:28:11 +0100 Subject: [PATCH] Fix ppc64le compilation crashes They (probably) crash due to high memory usage. The build argument -flto-partition=none is known to increase memory usage, so remove it. Related: RHEL-70420 --- 1001-disable-lto-partition-none.patch | 28 +++++++++++++++++++++++++++ NetworkManager.spec | 13 ++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 1001-disable-lto-partition-none.patch diff --git a/1001-disable-lto-partition-none.patch b/1001-disable-lto-partition-none.patch new file mode 100644 index 0000000..c397960 --- /dev/null +++ b/1001-disable-lto-partition-none.patch @@ -0,0 +1,28 @@ +diff --git a/meson.build b/meson.build +index 4f6d14da9a..335a7348ee 100644 +--- a/meson.build ++++ b/meson.build +@@ -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 + + diff --git a/NetworkManager.spec b/NetworkManager.spec index 4214d47..d7d8201 100644 --- a/NetworkManager.spec +++ b/NetworkManager.spec @@ -7,7 +7,7 @@ %global real_version 1.51.7 %global git_tag_version_suffix -dev %global rpm_version %{real_version} -%global release_version 1 +%global release_version 2 %global snapshot %{nil} %global git_sha %{nil} %global bcond_default_debug 0 @@ -156,11 +156,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 @@ -189,7 +184,7 @@ Source9: readme-ifcfg-rh-migrated.txt Patch0001: 0001-revert-change-default-value-for-ipv4.dad-timeout-from-0-to-200ms.patch # Bugfixes that are only relevant until next rebase of the package. -# Patch1001: 1001-some.patch +Patch1001: 1001-disable-lto-partition-none.patch Requires(post): systemd Requires(post): systemd-udev @@ -1074,6 +1069,10 @@ fi %changelog +* Mon Feb 10 2025 Íñigo Huguet - 1:1:51.7-2 +- Remove the build argument -flto-partition to avoid compilation crashes due + to high memory usage. + * Fri Feb 07 2025 Vladimír Beneš - 1:1.51.7-1 - Update to 1.51.7 (dev) - Add support in initramfs generator for parsing NM eDNS configuration (RHEL-70420)