From c0db8866489ad7a267c169fff7185e6cde107446 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Tue, 11 Feb 2025 17:43:41 +0100 Subject: [PATCH 1/5] Apply fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118817 --- gcc.spec | 2 ++ scram-tools.file/tools/gcc/env.sh | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc.spec b/gcc.spec index b5a71fc8414..178dfad9430 100644 --- a/gcc.spec +++ b/gcc.spec @@ -24,6 +24,7 @@ Source3: https://ftp.gnu.org/gnu/mpc/mpc-%{mpcVersion}.tar.gz Source4: https://libisl.sourceforge.io/isl-%{islVersion}.tar.bz2 Source12: http://zlib.net/zlib-%{zlibVersion}.tar.gz Source13: https://github.com/facebook/zstd/releases/download/v%{zstdVersion}/zstd-%{zstdVersion}.tar.gz +Source14: https://github.com/gcc-mirror/gcc/commit/0a1d2ea57722c248777e1130de076e28c443ff8b.diff %ifos linux %define bisonVersion 3.8.2 @@ -44,6 +45,7 @@ Patch1: gcc-flex-disable-doc %prep %setup -T -b 0 -n %{moduleName} +patch -p1 <%{_sourcedir}/0a1d2ea57722c248777e1130de076e28c443ff8b.diff # Filter out private stuff from RPM requires headers. cat << \EOF > %{name}-req diff --git a/scram-tools.file/tools/gcc/env.sh b/scram-tools.file/tools/gcc/env.sh index 2da84be0ef8..aa78f591e37 100644 --- a/scram-tools.file/tools/gcc/env.sh +++ b/scram-tools.file/tools/gcc/env.sh @@ -43,8 +43,6 @@ GCC_CXXFLAGS="$GCC_CXXFLAGS -Xassembler --compress-debug-sections" #FIXME: GCC 12.2 workaround if [[ "$GCC_VERSION" =~ ^12\.[23]\. ]] ; then GCC_CXXFLAGS="$GCC_CXXFLAGS -Wno-error=array-bounds -Warray-bounds" -elif [[ "$GCC_VERSION" =~ ^14\.[2]\. ]] ; then - GCC_CXXFLAGS="$GCC_CXXFLAGS -Wno-error=array-bounds -Warray-bounds" fi # Explicitly use the GNU binutils ld.bfd linker From c1c225ad17e15e8310d1040d135cb91d86adc160 Mon Sep 17 00:00:00 2001 From: Malik Shahzad Muzaffar Date: Tue, 11 Feb 2025 21:59:07 +0100 Subject: [PATCH 2/5] Added perl dep needed by gcc update --- fakesystem.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fakesystem.spec b/fakesystem.spec index 5d6a2782799..176f89ad2b2 100644 --- a/fakesystem.spec +++ b/fakesystem.spec @@ -1,5 +1,5 @@ ### RPM cms fakesystem 1.0 -## REVISION 1016 +## REVISION 1017 ## NOCOMPILER ## NO_VERSION_SUFFIX @@ -50,6 +50,7 @@ Provides: perl(Tk::DialogBox) Provides: perl(Tk::ROText) Provides: perl(constant) Provides: perl(full) +Provides: perl(bigint) ################################# # Needed by git on SLC7 From 9b7bd13e4ac0dea91eeaf05b1d8121b44a18eb94 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Wed, 12 Feb 2025 15:20:18 +0100 Subject: [PATCH 3/5] added extra patch for gcc14 --- gcc.spec | 3 +++ gcc14-fix118817.patch | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 gcc14-fix118817.patch diff --git a/gcc.spec b/gcc.spec index 178dfad9430..421283f0b09 100644 --- a/gcc.spec +++ b/gcc.spec @@ -41,11 +41,14 @@ Source11: https://github.com/westes/flex/releases/download/v%{flexVersion}/flex- Patch0: gcc-flex-nonfull-path-m4 Patch1: gcc-flex-disable-doc +Patch2: gcc14-fix118817 %prep %setup -T -b 0 -n %{moduleName} patch -p1 <%{_sourcedir}/0a1d2ea57722c248777e1130de076e28c443ff8b.diff +%patch2 -p1 + # Filter out private stuff from RPM requires headers. cat << \EOF > %{name}-req diff --git a/gcc14-fix118817.patch b/gcc14-fix118817.patch new file mode 100644 index 00000000000..9b82a312231 --- /dev/null +++ b/gcc14-fix118817.patch @@ -0,0 +1,25 @@ +diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc +index 1e11690..4550960 100644 +--- a/gcc/tree-ssa-sccvn.cc ++++ b/gcc/tree-ssa-sccvn.cc +@@ -2621,13 +2621,18 @@ vn_nary_build_or_lookup (gimple_match_op *res_op) + tree + vn_nary_simplify (vn_nary_op_t nary) + { +- if (nary->length > gimple_match_op::MAX_NUM_OPS) ++ if (nary->length > gimple_match_op::MAX_NUM_OPS ++ /* For CONSTRUCTOR the vn_nary_op_t and gimple_match_op representation ++ does not match. */ ++ || nary->code == CONSTRUCTOR) + return NULL_TREE; + gimple_match_op op (gimple_match_cond::UNCOND, nary->opcode, + nary->type, nary->length); + memcpy (op.ops, nary->op, sizeof (tree) * nary->length); + tree res = vn_nary_build_or_lookup_1 (&op, false, true); +- if (op.code.is_tree_code () && op.num_ops <= nary->length) ++ if (op.code.is_tree_code () ++ && op.num_ops <= nary->length ++ && (tree_code) op.code != CONSTRUCTOR) + { + nary->opcode = (tree_code) op.code; + nary->length = op.num_ops; From c03a37d307ff2b82615f677d1a7c7ea2e837e438 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Wed, 12 Feb 2025 15:38:30 +0100 Subject: [PATCH 4/5] fix gcc14 patch --- gcc14-fix118817.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc14-fix118817.patch b/gcc14-fix118817.patch index 9b82a312231..9833c42c9f3 100644 --- a/gcc14-fix118817.patch +++ b/gcc14-fix118817.patch @@ -10,7 +10,7 @@ index 1e11690..4550960 100644 + if (nary->length > gimple_match_op::MAX_NUM_OPS + /* For CONSTRUCTOR the vn_nary_op_t and gimple_match_op representation + does not match. */ -+ || nary->code == CONSTRUCTOR) ++ || nary->opcode == CONSTRUCTOR) return NULL_TREE; gimple_match_op op (gimple_match_cond::UNCOND, nary->opcode, nary->type, nary->length); From 5520ae1c8ce40aa1b7b6b9a90bd35005e04748dc Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Thu, 13 Feb 2025 14:10:19 +0100 Subject: [PATCH 5/5] cleanup array-bound patches --- gcc.spec | 5 ++--- pip/pybind11.file | 1 - pybind11-array-bound.patch | 22 ---------------------- tbb.spec | 2 +- ucx.spec | 1 - 5 files changed, 3 insertions(+), 28 deletions(-) delete mode 100644 pybind11-array-bound.patch diff --git a/gcc.spec b/gcc.spec index 421283f0b09..33f34f751af 100644 --- a/gcc.spec +++ b/gcc.spec @@ -25,6 +25,7 @@ Source4: https://libisl.sourceforge.io/isl-%{islVersion}.tar.bz2 Source12: http://zlib.net/zlib-%{zlibVersion}.tar.gz Source13: https://github.com/facebook/zstd/releases/download/v%{zstdVersion}/zstd-%{zstdVersion}.tar.gz Source14: https://github.com/gcc-mirror/gcc/commit/0a1d2ea57722c248777e1130de076e28c443ff8b.diff +Source15: https://github.com/gcc-mirror/gcc/commit/77d01927bd7c989d431035251a5c196fe39bcec9.diff %ifos linux %define bisonVersion 3.8.2 @@ -41,14 +42,12 @@ Source11: https://github.com/westes/flex/releases/download/v%{flexVersion}/flex- Patch0: gcc-flex-nonfull-path-m4 Patch1: gcc-flex-disable-doc -Patch2: gcc14-fix118817 %prep %setup -T -b 0 -n %{moduleName} patch -p1 <%{_sourcedir}/0a1d2ea57722c248777e1130de076e28c443ff8b.diff -%patch2 -p1 - +patch -p1 <%{_sourcedir}/77d01927bd7c989d431035251a5c196fe39bcec9.diff # Filter out private stuff from RPM requires headers. cat << \EOF > %{name}-req diff --git a/pip/pybind11.file b/pip/pybind11.file index 270b1ae49ba..3ac4da3912c 100644 --- a/pip/pybind11.file +++ b/pip/pybind11.file @@ -1,4 +1,3 @@ -Patch0: pybind11-array-bound %define PipPostInstall \ ln -s ${PYTHON3_LIB_SITE_PACKAGES}/pybind11/share %{i}/share; \ ln -s ${PYTHON3_LIB_SITE_PACKAGES}/pybind11/include %{i}/include diff --git a/pybind11-array-bound.patch b/pybind11-array-bound.patch deleted file mode 100644 index 4c2a9763d26..00000000000 --- a/pybind11-array-bound.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/pybind11/include/pybind11/pybind11.h b/pybind11/include/pybind11/pybind11.h -index 1806583e6b..e56e2a0589 100644 ---- a/pybind11/include/pybind11/pybind11.h -+++ b/pybind11/include/pybind11/pybind11.h -@@ -1380,7 +1380,17 @@ class generic_type : public object { - } else { - internals.registered_types_cpp[tindex] = tinfo; - } -+ -+ PYBIND11_WARNING_PUSH -+#if defined(__GNUC__) && __GNUC__ >= 12 -+ // When using GCC 12 these warnings are disabled as they trigger -+ // false positive warnings. Discussed here: -+ // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115824. -+ PYBIND11_WARNING_DISABLE_GCC("-Warray-bounds") -+ PYBIND11_WARNING_DISABLE_GCC("-Wstringop-overread") -+#endif - internals.registered_types_py[(PyTypeObject *) m_ptr] = {tinfo}; -+ PYBIND11_WARNING_POP - }); - - if (rec.bases.size() > 1 || rec.multiple_inheritance) { diff --git a/tbb.spec b/tbb.spec index 9f4b12685d4..89c898ec36f 100644 --- a/tbb.spec +++ b/tbb.spec @@ -19,7 +19,7 @@ mkdir %{_builddir}/build cd %{_builddir}/build cmake ../%{n}-%{realversion} \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_CXX_FLAGS="-Wno-error=array-bounds -Wno-error=use-after-free -Wno-error=address -Wno-error=uninitialized -Wno-error=stringop-overflow" \ + -DCMAKE_CXX_FLAGS="-Wno-error=use-after-free -Wno-error=address -Wno-error=uninitialized" \ -DCMAKE_CXX_STANDARD=%{cms_cxx_standard} \ -DCMAKE_INSTALL_PREFIX=%{i} \ -DCMAKE_INSTALL_LIBDIR=lib \ diff --git a/ucx.spec b/ucx.spec index 7aa91bfe09d..d45f1b7bbde 100644 --- a/ucx.spec +++ b/ucx.spec @@ -56,7 +56,6 @@ Requires: xpmem --without-knem \ --with-xpmem=$XPMEM_ROOT \ --without-ugni \ - CFLAGS="-Wno-error=array-bounds" \ CPPFLAGS="-I$NUMACTL_ROOT/include" \ LDFLAGS="-L$NUMACTL_ROOT/lib"