From cce7e6a118d7a08bcb9185ba29b13207247f0092 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Sun, 11 Jan 2026 10:59:24 +0100 Subject: [PATCH 1/2] Do not use -Ofast -Ofast implies -funsafe-math-optimizations, which affects the global FP state for all programs: when used at link time, it may include libraries or startup files that change the default FPU control word or other similar optimizations. --- xz-bootstrap.spec | 2 +- xz.spec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xz-bootstrap.spec b/xz-bootstrap.spec index 2f24e800132..16773fe46a9 100644 --- a/xz-bootstrap.spec +++ b/xz-bootstrap.spec @@ -5,7 +5,7 @@ Source0: http://tukaani.org/xz/xz-%{realversion}.tar.gz %setup -n xz-%{realversion} %build -./configure CFLAGS='-fPIC -D_FILE_OFFSET_BITS=64 -Ofast' --prefix=%{i} --disable-static +./configure CFLAGS='-fPIC -D_FILE_OFFSET_BITS=64 -O3' --prefix=%{i} --disable-static make %{makeprocesses} %install diff --git a/xz.spec b/xz.spec index 10a2494058f..2b1094aaf51 100644 --- a/xz.spec +++ b/xz.spec @@ -7,7 +7,7 @@ BuildRequires: autotools %setup -n %{n}-%{realversion} %build -./configure CFLAGS='-fPIC -Ofast' --prefix=%{i} --disable-static --disable-nls --disable-rpath --disable-dependency-tracking --disable-doc +./configure CFLAGS='-fPIC -O3' --prefix=%{i} --disable-static --disable-nls --disable-rpath --disable-dependency-tracking --disable-doc make %{makeprocesses} %install From 70c5c865655c8cd8620ccefb3ebb09766a1bd73f Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Sun, 11 Jan 2026 10:59:24 +0100 Subject: [PATCH 2/2] Do not use -Ofast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -Ofast implies -funsafe-math-optimizations, which affects the global FP state for all programs: when used at link time, it may include libraries or startup files that change the default FPU control word or other similar optimizations. -Ofast enables (directly or indirectly): - ❌ -fallow-store-data-races - ✔ -fno-semantic-interposition - ✔ -fno-math-errno - ❌ -funsafe-math-optimizations - ❌ -ffinite-math-only - ✔ -fno-rounding-math (_default_) - ✔ -fno-signaling-nans (_default_) - ❔ -fcx-limited-range - ✔ -fexcess-precision=fast - ✔ -fno-signed-zeros - ✔ -fno-trapping-math - ✔ -fassociative-math - ❌ -freciprocal-math (disabled in cms-sw/cmsdist#8280) We should not use -fallow-store-data-races, -ffinite-math-only. We should not use -funsafe-math-optimizations at link time, as it affects the global FP state. It's probably easier to replace it with the individual options -fno-signed-zeros, -fno-trapping-math and -fassociative-math. We may revisit -fcx-limited-range if we do use Complex arithmetics. -freciprocal-math was already disabled explicitly, see cms-sw/cmsdist#8280. --- scram-tools.file/tools/gcc/ofast-flag.xml | 36 +++++++++++++++-------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/scram-tools.file/tools/gcc/ofast-flag.xml b/scram-tools.file/tools/gcc/ofast-flag.xml index f32a962f353..9ada2fe263c 100644 --- a/scram-tools.file/tools/gcc/ofast-flag.xml +++ b/scram-tools.file/tools/gcc/ofast-flag.xml @@ -1,12 +1,24 @@ - - - - - - - - - - - - + + + + + + + +