From 4cbe32c50d941a049d089648a21abc8d42316f6cdbd8db7ec4872d9916e12d6d Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 19 Aug 2024 02:30:19 +0200 Subject: [PATCH] Disable LTO, reinforce CFLAGS --- bcachefs-tools.changes | 1 + bcachefs-tools.spec | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bcachefs-tools.changes b/bcachefs-tools.changes index 943dbaf..49c5fc1 100644 --- a/bcachefs-tools.changes +++ b/bcachefs-tools.changes @@ -4,6 +4,7 @@ Sun Aug 18 23:46:46 UTC 2024 - Jan Engelhardt - Update to release 1.11.0 * mount: Fix UAF in option string handling * mount: Support asking for password via systemd-ask-password +- Fix a crash in mkfs.bcachefs by disabling LTO. ------------------------------------------------------------------- Mon Jul 22 09:06:43 UTC 2024 - David Disseldorp diff --git a/bcachefs-tools.spec b/bcachefs-tools.spec index 85af85b..4c90a89 100644 --- a/bcachefs-tools.spec +++ b/bcachefs-tools.spec @@ -62,11 +62,18 @@ This package contains utilities for creating and mounting bcachefs. %autosetup -p1 %build +# The combination of -Og/-O1/-O2 + LTO produces a broken mkfs.bcachefs which +# crashes (disabling one of the two fixes it). Given this -O+LTO scenario, if +# -g2 is also used, the lto1-wpa process runs into memory exhaustion (>80GB) +# and the build fails altogether. +%define _lto_cflags %nil # gh/koverstreet/bcachefs-tools#237 # bcachefs-tools uses malloc_usable_size, which is incompatible # with fortification level 3 export CFLAGS="${RPM_OPT_FLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}" -export CXXFLAGS="${RPM_OPT_FLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}" +export CXXFLAGS="$CFLAGS" +# Workaround antisocial Makefile that forces its own -O level +export EXTRA_CFLAGS="$CFLAGS" %make_build PREFIX="%_prefix" ROOT_SBINDIR="%_sbindir" %install