From 1b33064ba357250db73ec862f24df637ed180c30 Mon Sep 17 00:00:00 2001
From: Eleni Mathioulaki <emathioulaki@athenarc.gr>
Date: Tue, 18 Feb 2025 07:35:13 +0000
Subject: [PATCH] feat: align packages with Spack v0.23.0 upstream

---
 packages/ambertools/package.py                |   78 --
 packages/bazel/bazelconfiguration-0.3.patch   |   16 -
 .../bazel/bazelruleclassprovider-0.14.patch   |   16 -
 packages/bazel/build-0.29.1.patch             |   61 -
 packages/bazel/cc_configure-0.3.0.patch       |   24 -
 packages/bazel/cc_configure-0.5.0.patch       |   24 -
 packages/bazel/compile-0.13.patch             |   11 -
 packages/bazel/compile-0.16.patch             |   11 -
 packages/bazel/compile-0.21.patch             |   11 -
 packages/bazel/compile-0.3.patch              |   11 -
 packages/bazel/compile-0.9.patch              |   11 -
 packages/bazel/cppcompileaction-0.3.0.patch   |   11 -
 packages/bazel/cppcompileaction-7.0.0.patch   |   12 +
 packages/bazel/package.py                     |  514 ++------
 packages/bazel/unix_cc_configure-0.10.patch   |   22 -
 packages/bazel/unix_cc_configure-0.5.3.patch  |   24 -
 packages/gcc/darwin/apfs.patch                |   12 -
 packages/gcc/darwin/clang13.patch             |   32 -
 packages/gcc/darwin/gcc-4.9.patch1            |   42 -
 packages/gcc/darwin/gcc-4.9.patch2            |   28 -
 packages/gcc/darwin/gcc-6.1.0-jit.patch       |   21 -
 packages/gcc/darwin/gcc-7.1.0-headerpad.patch |   19 -
 packages/gcc/darwin/headers-10.13-fix.patch   |  127 --
 packages/gcc/detection_test.yaml              |   38 -
 packages/gcc/gcc-backport.patch               |  138 --
 .../gcc/glibc-2.31-libsanitizer-1-gcc-6.patch |   39 -
 packages/gcc/glibc-2.31-libsanitizer-1.patch  |   37 -
 .../gcc/glibc-2.31-libsanitizer-2-gcc-6.patch |   69 -
 .../gcc/glibc-2.31-libsanitizer-2-gcc-7.patch |   69 -
 packages/gcc/glibc-2.31-libsanitizer-2.patch  |   73 --
 .../gcc/glibc-2.31-libsanitizer-3-gcc-5.patch |   81 --
 .../glibc-2.36-libsanitizer-gcc-10-12.patch   |   27 -
 .../gcc/glibc-2.36-libsanitizer-gcc-5-9.patch |   27 -
 packages/gcc/package.py                       | 1114 -----------------
 ...941d23b1570cdd90083b58fa0f66aa58c86e.patch |  121 --
 ...ae5923aba02982563481d75a21595df22ff8.patch |  123 --
 ...b74046e0feb0596b93bbb822fae02940a90e.patch |  133 --
 ...0b3010bd0de899a3da3209eab20664ddb703.patch |  133 --
 packages/gcc/piclibs.patch                    |   62 -
 packages/gcc/signal.patch                     |   28 -
 packages/gcc/stack_t-4.9.patch                |   80 --
 packages/gcc/stack_t.patch                    |   88 --
 packages/gcc/sys_ustat-4.9.patch              |   34 -
 packages/gcc/sys_ustat.h.patch                |   63 -
 packages/gcc/ucontext_t-java.patch            |   60 -
 packages/gcc/ucontext_t.patch                 |  189 ---
 packages/gcc/zstd.patch                       |   43 -
 packages/libvips/package.py                   |   23 +-
 packages/libxcb/package.py                    |   54 +-
 packages/llvm/constexpr_longdouble.patch      |   28 -
 packages/llvm/constexpr_longdouble_9.0.patch  |   38 -
 packages/llvm/detection_test.yaml             |  104 ++
 packages/llvm/libomp-libflags-as-list.patch   |   14 -
 packages/llvm/lldb_external_ncurses-10.patch  |   31 -
 packages/llvm/llvm-gcc11.patch                |    9 -
 packages/llvm/llvm13-thread.patch             |   19 -
 packages/llvm/llvm14-hwloc-ompd.patch         |   13 -
 packages/llvm/llvm17-18-thread.patch          |   22 +
 packages/llvm/llvm17-fujitsu.patch            |   28 +
 packages/llvm/llvm4-lld-ELF-Symbols.patch     |  112 --
 packages/llvm/llvm5-lld-ELF-Symbols.patch     |   33 -
 packages/llvm/llvm5-sanitizer-ustat.patch     |   25 -
 packages/llvm/llvm_py37.patch                 |   37 -
 packages/llvm/llvm_python_path.patch          |   14 -
 packages/llvm/missing-includes.patch          |   23 -
 packages/llvm/no_cyclades.patch               |   81 --
 packages/llvm/package.py                      |  369 ++++--
 ...izer-platform-limits-posix-xdr-macos.patch |   11 +
 packages/llvm/thread-p9.patch                 |   16 -
 packages/log4cxx/package.py                   |   35 +-
 packages/nanoflann/package.py                 |   26 -
 packages/netlib-xblas/package.py              |   74 --
 packages/nglview/package.py                   |   36 -
 packages/open3d/package.py                    |   35 +-
 packages/openbabel/gcc12-cmake.patch          |   37 -
 packages/openbabel/package.py                 |   97 --
 .../openbabel/python-3.6-rtld-global.patch    |   42 -
 .../testpdbformat-tabs-to-spaces.patch        |   47 -
 packages/py-astropy/package.py                |   25 +-
 packages/py-autopep8/package.py               |    2 +
 packages/py-bokeh/package.py                  |   23 +-
 packages/py-chex/package.py                   |   34 -
 packages/py-dash/package.py                   |   29 -
 packages/py-flit-core/package.py              |   40 -
 packages/py-ipycanvas/package.py              |    2 +
 packages/py-ipympl/package.py                 |   53 +-
 packages/py-jax/package.py                    |   70 --
 packages/py-jaxlib/package.py                 |  125 --
 packages/py-numba/package.py                  |   30 +-
 packages/py-optax/package.py                  |   24 -
 packages/py-pycuda/package.py                 |    4 +
 packages/py-pyvista/package.py                |   44 -
 packages/py-pyviz-comms/package.py            |    2 +
 packages/py-ray/package.py                    |    6 +
 packages/py-sympy/package.py                  |    9 +-
 packages/py-tree-math/package.py              |   26 -
 packages/sbml/package.py                      |    5 +
 packages/simpletraj/package.py                |   32 -
 packages/sleef/package.py                     |   63 -
 packages/wf-biobb/package.py                  |    4 +-
 100 files changed, 772 insertions(+), 5420 deletions(-)
 delete mode 100644 packages/ambertools/package.py
 delete mode 100644 packages/bazel/bazelconfiguration-0.3.patch
 delete mode 100644 packages/bazel/bazelruleclassprovider-0.14.patch
 delete mode 100644 packages/bazel/build-0.29.1.patch
 delete mode 100644 packages/bazel/cc_configure-0.3.0.patch
 delete mode 100644 packages/bazel/cc_configure-0.5.0.patch
 delete mode 100644 packages/bazel/compile-0.13.patch
 delete mode 100644 packages/bazel/compile-0.16.patch
 delete mode 100644 packages/bazel/compile-0.21.patch
 delete mode 100644 packages/bazel/compile-0.3.patch
 delete mode 100644 packages/bazel/compile-0.9.patch
 delete mode 100644 packages/bazel/cppcompileaction-0.3.0.patch
 create mode 100644 packages/bazel/cppcompileaction-7.0.0.patch
 delete mode 100644 packages/bazel/unix_cc_configure-0.10.patch
 delete mode 100644 packages/bazel/unix_cc_configure-0.5.3.patch
 delete mode 100644 packages/gcc/darwin/apfs.patch
 delete mode 100644 packages/gcc/darwin/clang13.patch
 delete mode 100644 packages/gcc/darwin/gcc-4.9.patch1
 delete mode 100644 packages/gcc/darwin/gcc-4.9.patch2
 delete mode 100644 packages/gcc/darwin/gcc-6.1.0-jit.patch
 delete mode 100644 packages/gcc/darwin/gcc-7.1.0-headerpad.patch
 delete mode 100644 packages/gcc/darwin/headers-10.13-fix.patch
 delete mode 100644 packages/gcc/detection_test.yaml
 delete mode 100644 packages/gcc/gcc-backport.patch
 delete mode 100644 packages/gcc/glibc-2.31-libsanitizer-1-gcc-6.patch
 delete mode 100644 packages/gcc/glibc-2.31-libsanitizer-1.patch
 delete mode 100644 packages/gcc/glibc-2.31-libsanitizer-2-gcc-6.patch
 delete mode 100644 packages/gcc/glibc-2.31-libsanitizer-2-gcc-7.patch
 delete mode 100644 packages/gcc/glibc-2.31-libsanitizer-2.patch
 delete mode 100644 packages/gcc/glibc-2.31-libsanitizer-3-gcc-5.patch
 delete mode 100644 packages/gcc/glibc-2.36-libsanitizer-gcc-10-12.patch
 delete mode 100644 packages/gcc/glibc-2.36-libsanitizer-gcc-5-9.patch
 delete mode 100644 packages/gcc/package.py
 delete mode 100644 packages/gcc/patch-2b40941d23b1570cdd90083b58fa0f66aa58c86e.patch
 delete mode 100644 packages/gcc/patch-745dae5923aba02982563481d75a21595df22ff8.patch
 delete mode 100644 packages/gcc/patch-f1feb74046e0feb0596b93bbb822fae02940a90e.patch
 delete mode 100644 packages/gcc/patch-fc930b3010bd0de899a3da3209eab20664ddb703.patch
 delete mode 100644 packages/gcc/piclibs.patch
 delete mode 100644 packages/gcc/signal.patch
 delete mode 100644 packages/gcc/stack_t-4.9.patch
 delete mode 100644 packages/gcc/stack_t.patch
 delete mode 100644 packages/gcc/sys_ustat-4.9.patch
 delete mode 100644 packages/gcc/sys_ustat.h.patch
 delete mode 100644 packages/gcc/ucontext_t-java.patch
 delete mode 100644 packages/gcc/ucontext_t.patch
 delete mode 100644 packages/gcc/zstd.patch
 delete mode 100644 packages/llvm/constexpr_longdouble.patch
 delete mode 100644 packages/llvm/constexpr_longdouble_9.0.patch
 create mode 100644 packages/llvm/detection_test.yaml
 delete mode 100644 packages/llvm/libomp-libflags-as-list.patch
 delete mode 100644 packages/llvm/lldb_external_ncurses-10.patch
 delete mode 100644 packages/llvm/llvm-gcc11.patch
 delete mode 100644 packages/llvm/llvm13-thread.patch
 delete mode 100644 packages/llvm/llvm14-hwloc-ompd.patch
 create mode 100644 packages/llvm/llvm17-18-thread.patch
 create mode 100644 packages/llvm/llvm17-fujitsu.patch
 delete mode 100644 packages/llvm/llvm4-lld-ELF-Symbols.patch
 delete mode 100644 packages/llvm/llvm5-lld-ELF-Symbols.patch
 delete mode 100644 packages/llvm/llvm5-sanitizer-ustat.patch
 delete mode 100644 packages/llvm/llvm_py37.patch
 delete mode 100644 packages/llvm/llvm_python_path.patch
 delete mode 100644 packages/llvm/missing-includes.patch
 delete mode 100644 packages/llvm/no_cyclades.patch
 create mode 100644 packages/llvm/sanitizer-platform-limits-posix-xdr-macos.patch
 delete mode 100644 packages/llvm/thread-p9.patch
 delete mode 100644 packages/nanoflann/package.py
 delete mode 100644 packages/netlib-xblas/package.py
 delete mode 100644 packages/nglview/package.py
 delete mode 100644 packages/openbabel/gcc12-cmake.patch
 delete mode 100644 packages/openbabel/package.py
 delete mode 100644 packages/openbabel/python-3.6-rtld-global.patch
 delete mode 100644 packages/openbabel/testpdbformat-tabs-to-spaces.patch
 delete mode 100644 packages/py-chex/package.py
 delete mode 100644 packages/py-dash/package.py
 delete mode 100644 packages/py-flit-core/package.py
 delete mode 100644 packages/py-jax/package.py
 delete mode 100644 packages/py-jaxlib/package.py
 delete mode 100644 packages/py-optax/package.py
 delete mode 100644 packages/py-pyvista/package.py
 delete mode 100644 packages/py-tree-math/package.py
 delete mode 100644 packages/simpletraj/package.py
 delete mode 100644 packages/sleef/package.py

diff --git a/packages/ambertools/package.py b/packages/ambertools/package.py
deleted file mode 100644
index 4e4552cd..00000000
--- a/packages/ambertools/package.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
-class Ambertools (CMakePackage):
-    """AmberTools is a free, useful standalone package and a prerequisite for installing Amber itself.
-    The AmberTools suite is free of charge, and its components are mostly released under the GNU General Public License (GPL).
-    A few components are included that are in the public domain or which have other, open-source, licenses.
-    The libsander and libpbsa libraries use the LGPL license."""
-
-    # Set the homepage and download url
-    homepage = "http://ambermd.org/AmberTools.php"
-    url      = "http://ambermd.org/downloads/AmberTools22jlmrcc.tar.bz2"
-
-    # Set the gitlab accounts of this package maintainers
-    maintainers = ['dbeltran', 'elmath']
-
-    version('22jlmrcc', sha256='1571d4e0f7d45b2a71dce5999fa875aea8c90ee219eb218d7916bf30ea229121')
-
-    # Dependencies
-    depends_on("flex",                      type="build") # This is necessary for sure (experimentally tested)
-    depends_on("bison",                     type="build") # This is necessary for sure (experimentally tested)
-    depends_on("tcsh",                      type="build")
-    depends_on("zlib",                      type=("build", "link", "run"))
-    depends_on("bzip2",                     type=("build", "run"))
-    depends_on("blas",                      type=("build", "run"))
-    depends_on("lapack",                    type=("build", "run"))
-    depends_on("arpack-ng",                 type=("build", "run"))
-    depends_on("netcdf-c",                  type=("build", "run"))
-    depends_on("netcdf-fortran",            type=("build", "run"))
-    depends_on("fftw",                      type=("build", "run"))
-    depends_on("readline",                  type=("build", "run"))
-    depends_on("netlib-xblas~plain_blas",   type=("build", "run"))
-    # specific variants needed for boost - from the build log "Could NOT find Boost (missing: thread system program_options iostreams regex timer chrono filesystem graph)"
-    depends_on("boost+thread+system+program_options+iostreams+regex+timer+chrono+filesystem+graph", type=("build", "run"))
-
-    # Python dependencies
-    # WARNING: If a python 3.8 version is already installed in spack then the '+tkinter' variant makes spack ignore the version
-    # WARNING: Spack may try to install the preferred python version (i.e. python 3.10.8)
-    # WARNING: The soultion is uninstall python and reinstall with this variant
-    depends_on('python@3.8: +tkinter',      type=('build', 'run'))
-    depends_on("py-numpy",                  type=("build", "run"))
-    depends_on("py-matplotlib",             type=("build", "run"))
-    depends_on("py-scipy",                  type=("build", "run"))
-
-    def cmake_args(self):
-        # Translated from ambertools build/run_cmake script
-        # We also add the TRUST_SYSTEM_LIBS argument that is mentioned in the ambertools CMake guide
-        #   https://ambermd.org/pmwiki/pmwiki.php/Main/CMake-Guide-to-Options
-        args = [
-            self.define("COMPILER", "GNU"),
-            self.define("MPI", False),
-            self.define("CUDA", False),
-            self.define("INSTALL_TESTS", True),
-            self.define("DOWNLOAD_MINICONDA", False),
-            self.define("TRUST_SYSTEM_LIBS", True),
-            # This is to avoid the x11 (X11_Xext_LIB) error
-            # It is equivalent to the '-noX11' flag accoridng to the docs:
-            # https://ambermd.org/pmwiki/pmwiki.php/Main/CMake-Common-Options
-            self.define("BUILD_GUI", False)
-        ]
-        return args
-
-    def setup_run_environment(self, env):
-        env.set("AMBER_PREFIX", self.prefix)
-        env.set("AMBERHOME", self.prefix)
-
-    def setup_build_environment(self, env):
-        env.set("AMBER_PREFIX", self.prefix)
-        env.set("AMBERHOME", self.prefix)
-
-    @run_after('install')
-    @on_package_attributes(run_tests=True)
-    def check_install(self):
-        make("test.serial")
diff --git a/packages/bazel/bazelconfiguration-0.3.patch b/packages/bazel/bazelconfiguration-0.3.patch
deleted file mode 100644
index e6a974a9..00000000
--- a/packages/bazel/bazelconfiguration-0.3.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfiguration.java
-+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfiguration.java
-@@ -150,6 +150,13 @@
-       builder.put("PATH", null);
-       builder.put("LD_LIBRARY_PATH", null);
-     }
-+
-+    Map<String, String> spackEnv = System.getenv();
-+    for (String envName : spackEnv.keySet()) {
-+      if (envName.startsWith("SPACK_")) {
-+        builder.put(envName, spackEnv.get(envName));
-+      }
-+    }
-   }
- 
-   private static PathFragment determineShellExecutable(OS os, PathFragment fromOption) {
diff --git a/packages/bazel/bazelruleclassprovider-0.14.patch b/packages/bazel/bazelruleclassprovider-0.14.patch
deleted file mode 100644
index b0aebdf3..00000000
--- a/packages/bazel/bazelruleclassprovider-0.14.patch
+++ /dev/null
@@ -1,16 +0,0 @@
---- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
-+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
-@@ -168,6 +168,13 @@ public class BazelRuleClassProvider {
-       env.put("PATH", null);
-     }
- 
-+    Map<String, String> spackEnv = System.getenv();
-+    for (String envName : spackEnv.keySet()) {
-+      if (envName.startsWith("SPACK_")) {
-+        env.put(envName, spackEnv.get(envName));
-+      }
-+    }
-+
-     // Shell environment variables specified via options take precedence over the
-     // ones inherited from the fragments. In the long run, these fragments will
-     // be replaced by appropriate default rc files anyway.
diff --git a/packages/bazel/build-0.29.1.patch b/packages/bazel/build-0.29.1.patch
deleted file mode 100644
index c3ed9ab2..00000000
--- a/packages/bazel/build-0.29.1.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 9c9d27561780bc56d9f0867e325c7421a94ee1cb Mon Sep 17 00:00:00 2001
-From: Harsh Bhatia <bhatia4@llnl.gov>
-Date: Tue, 15 Dec 2020 15:56:10 -0800
-Subject: [PATCH] https://github.com/bazelbuild/bazel/commit/ab62a6e097590dac5ec946ad7a796ea0e8593ae0 
-
----
- src/conditions/BUILD | 6 ++++++
- third_party/BUILD    | 8 ++++++--
- 2 files changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/src/conditions/BUILD b/src/conditions/BUILD
-index 2b28e28057..faa41a439d 100644
---- a/src/conditions/BUILD
-+++ b/src/conditions/BUILD
-@@ -10,6 +10,12 @@ filegroup(
-     visibility = ["//src:__pkg__"],
- )
- 
-+config_setting(
-+    name = "linux_ppc",
-+    values = {"cpu": "ppc"},
-+    visibility = ["//visibility:public"],
-+)
-+
- config_setting(
-     name = "linux_x86_64",
-     values = {"cpu": "k8"},
-diff --git a/third_party/BUILD b/third_party/BUILD
-index 159006d741..4fcae54c00 100644
---- a/third_party/BUILD
-+++ b/third_party/BUILD
-@@ -523,12 +523,13 @@ UNNECESSARY_DYNAMIC_LIBRARIES = select({
-     "//src/conditions:darwin": "*.so *.dll",
-     "//src/conditions:darwin_x86_64": "*.so *.dll",
-     "//src/conditions:linux_x86_64": "*.jnilib *.dll",
-+    "//src/conditions:linux_ppc": "*.so *.jnilib *.dll",
-     # The .so file is an x86 one, so we can just remove it if the CPU is not x86
-     "//src/conditions:arm": "*.so *.jnilib *.dll",
-     "//src/conditions:linux_aarch64": "*.so *.jnilib *.dll",
-     # Play it safe -- better have a big binary than a slow binary
-     # zip -d does require an argument. Supply something bogus.
--    "//conditions:default": "*.bogusextension",
-+    "//conditions:default": "",
- })
- 
- # Remove native libraries that are for a platform different from the one we are
-@@ -537,7 +538,10 @@ genrule(
-     name = "filter_netty_dynamic_libs",
-     srcs = ["netty_tcnative/netty-tcnative-boringssl-static-2.0.24.Final.jar"],
-     outs = ["netty_tcnative/netty-tcnative-filtered.jar"],
--    cmd = "cp $< $@ && zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES,
-+    cmd = "cp $< $@ && " +
-+      # End successfully if there is nothing to be deleted from the archive
-+      "if [ -n '" + UNNECESSARY_DYNAMIC_LIBRARIES + "' ]; then " +
-+      "zip -qd $@ " + UNNECESSARY_DYNAMIC_LIBRARIES + "; fi",
- )
- 
- java_import(
--- 
-2.21.0 (Apple Git-122.2)
-
diff --git a/packages/bazel/cc_configure-0.3.0.patch b/packages/bazel/cc_configure-0.3.0.patch
deleted file mode 100644
index 79e12269..00000000
--- a/packages/bazel/cc_configure-0.3.0.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/tools/cpp/cc_configure.bzl
-+++ b/tools/cpp/cc_configure.bzl
-@@ -173,8 +173,19 @@
-   else:
-     inc_dirs = result.stderr[index1 + 1:index2].strip()
- 
--  return [repository_ctx.path(_cxx_inc_convert(p))
--          for p in inc_dirs.split("\n")]
-+  default_inc_directories = [
-+    repository_ctx.path(_cxx_inc_convert(p))
-+    for p in inc_dirs.split("\n")
-+  ]
-+
-+  env = repository_ctx.os.environ
-+  if "SPACK_INCLUDE_DIRS" in env:
-+    for path in env["SPACK_INCLUDE_DIRS"].split(":"):
-+      default_inc_directories.append(
-+        repository_ctx.path(_cxx_inc_convert(path))
-+      )
-+
-+  return default_inc_directories
- 
- def _add_option_if_supported(repository_ctx, cc, option):
-   """Checks that `option` is supported by the C compiler."""
diff --git a/packages/bazel/cc_configure-0.5.0.patch b/packages/bazel/cc_configure-0.5.0.patch
deleted file mode 100644
index 470986be..00000000
--- a/packages/bazel/cc_configure-0.5.0.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/tools/cpp/cc_configure.bzl
-+++ b/tools/cpp/cc_configure.bzl
-@@ -200,8 +200,19 @@
-   else:
-     inc_dirs = result.stderr[index1 + 1:index2].strip()
- 
--  return [_escape_string(repository_ctx.path(_cxx_inc_convert(p)))
--          for p in inc_dirs.split("\n")]
-+  default_inc_directories = [
-+    _escape_string(repository_ctx.path(_cxx_inc_convert(p)))
-+    for p in inc_dirs.split("\n")
-+  ]
-+
-+  env = repository_ctx.os.environ
-+  if "SPACK_INCLUDE_DIRS" in env:
-+    for path in env["SPACK_INCLUDE_DIRS"].split(":"):
-+      default_inc_directories.append(
-+        repository_ctx.path(_cxx_inc_convert(path))
-+      )
-+
-+  return default_inc_directories
- 
- 
- def _add_option_if_supported(repository_ctx, cc, option):
diff --git a/packages/bazel/compile-0.13.patch b/packages/bazel/compile-0.13.patch
deleted file mode 100644
index 13c82e76..00000000
--- a/packages/bazel/compile-0.13.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -92,7 +92,7 @@
- log "Building output/bazel"
- # We set host and target platform directly since the defaults in @bazel_tools
- # have not yet been generated.
--bazel_build "src:bazel${EXE_EXT}" \
-+CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}" \
-   --host_platform=@bazel_tools//platforms:host_platform \
-   --platforms=@bazel_tools//platforms:target_platform \
-   || fail "Could not build Bazel"
diff --git a/packages/bazel/compile-0.16.patch b/packages/bazel/compile-0.16.patch
deleted file mode 100644
index f61f521a..00000000
--- a/packages/bazel/compile-0.16.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -92,7 +92,7 @@ display "."
- log "Building output/bazel"
- # We set host and target platform directly since the defaults in @bazel_tools
- # have not yet been generated.
--bazel_build "src:bazel_nojdk${EXE_EXT}" \
-+CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel_nojdk${EXE_EXT}" \
-   --host_platform=@bazel_tools//platforms:host_platform \
-   --platforms=@bazel_tools//platforms:target_platform \
-   || fail "Could not build Bazel"
diff --git a/packages/bazel/compile-0.21.patch b/packages/bazel/compile-0.21.patch
deleted file mode 100644
index d666a0f0..00000000
--- a/packages/bazel/compile-0.21.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -92,7 +92,7 @@ display "."
- log "Building output/bazel"
- # We set host and target platform directly since the defaults in @bazel_tools
- # have not yet been generated.
--bazel_build "src:bazel_nojdk${EXE_EXT}" \
-+CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel_nojdk${EXE_EXT}" \
-   --action_env=PATH \
-   --host_platform=@bazel_tools//platforms:host_platform \
-   --platforms=@bazel_tools//platforms:target_platform \
diff --git a/packages/bazel/compile-0.3.patch b/packages/bazel/compile-0.3.patch
deleted file mode 100644
index 82db6efb..00000000
--- a/packages/bazel/compile-0.3.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -99,7 +99,7 @@
-   new_step 'Building Bazel with Bazel'
-   display "."
-   log "Building output/bazel"
--  bazel_build "src:bazel${EXE_EXT}"
-+  CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}"
-   cp -f "bazel-bin/src/bazel${EXE_EXT}" "output/bazel${EXE_EXT}"
-   chmod 0755 "output/bazel${EXE_EXT}"
-   BAZEL="$(pwd)/output/bazel${EXE_EXT}"
diff --git a/packages/bazel/compile-0.9.patch b/packages/bazel/compile-0.9.patch
deleted file mode 100644
index 135de3a0..00000000
--- a/packages/bazel/compile-0.9.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/compile.sh
-+++ b/compile.sh
-@@ -92,7 +92,7 @@
- log "Building output/bazel"
- # We set host and target platform directly since the defaults in @bazel_tools
- # have not yet been generated.
--bazel_build "src:bazel${EXE_EXT}" \
-+CC=$SPACK_CC CXX=$SPACK_CXX bazel_build "src:bazel${EXE_EXT}" \
-   --host_platform=//tools/platforms:host_platform \
-   --platforms=//tools/platforms:target_platform \
-   || fail "Could not build Bazel"
diff --git a/packages/bazel/cppcompileaction-0.3.0.patch b/packages/bazel/cppcompileaction-0.3.0.patch
deleted file mode 100644
index dd23972d..00000000
--- a/packages/bazel/cppcompileaction-0.3.0.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java.orig    2020-06-08 13:42:14.035342560 -0400
-+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java 2020-06-08 13:42:25.149375458 -0400
-@@ -963,7 +963,7 @@
-           // are, it's probably due to a non-hermetic #include, & we should stop
-           // the build with an error.
-           if (execPath.startsWith(execRoot)) {
--            execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path
-+             //  execPathFragment = execPath.relativeTo(execRoot); // funky but tolerable path
-           } else {
-             problems.add(execPathFragment.getPathString());
-             continue;
diff --git a/packages/bazel/cppcompileaction-7.0.0.patch b/packages/bazel/cppcompileaction-7.0.0.patch
new file mode 100644
index 00000000..b182f98f
--- /dev/null
+++ b/packages/bazel/cppcompileaction-7.0.0.patch
@@ -0,0 +1,12 @@
+diff --color=auto --color=auto -Naur a/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java
+--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java	1980-01-01 00:00:00
++++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/HeaderDiscovery.java	2024-02-15 13:36:37
+@@ -143,7 +143,7 @@
+               LabelConstants.EXPERIMENTAL_EXTERNAL_PATH_PREFIX.getRelative(
+                   execPath.relativeTo(execRoot.getParentDirectory()));
+         } else {
+-          absolutePathProblems.add(execPathFragment.getPathString());
++          // absolutePathProblems.add(execPathFragment.getPathString());
+           continue;
+         }
+       }
diff --git a/packages/bazel/package.py b/packages/bazel/package.py
index 102bb5c5..9d548b61 100644
--- a/packages/bazel/package.py
+++ b/packages/bazel/package.py
@@ -18,8 +18,23 @@ class Bazel(Package):
     homepage = "https://bazel.build/"
     url = "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-dist.zip"
 
+    maintainers("LydDeb")
+
     tags = ["build-tools"]
 
+    license("Apache-2.0")
+
+    version("7.0.2", sha256="dea2b90575d43ef3e41c402f64c2481844ecbf0b40f8548b75a204a4d504e035")
+    version("7.0.1", sha256="596b13e071d27c43343ec8f5d263cb5312fafe7ef8702401f7ed492f182f4e6c")
+    version("7.0.0", sha256="477e54f6374001f439a9471ba1de9d7824daf129db95510849ecc5e19ce88170")
+    version("6.5.0", sha256="fc89da919415289f29e4ff18a5e01270ece9a6fe83cb60967218bac4a3bb3ed2")
+    version("6.4.0", sha256="bd88ff602c8bbb29ee82ba2a6b12ad092d51ec668c6577f9628f18e48ff4e51e")
+    version("6.3.2", sha256="8cd7feac58193be2bcba451ba6688a46824d37ca6359ff58e0d44eb98f042948")
+    version("6.3.1", sha256="2676319e86c5aeab142dccd42434364a33aa330a091c13562b7de87a10e68775")
+    version("6.3.0", sha256="902198981b1d26112fc05913e79f1b3e9772c3f95594caf85619d041ba06ede0")
+    version("6.2.1", sha256="4cf4d264bff388ee0012735728630d23832d3c9d021383b2fadceadb0775dd6b")
+    version("6.2.0", sha256="f1e8f788637ac574d471d619d2096baaca04a19b57a034399e079633db441945")
+    version("6.1.2", sha256="6fb3ee22fe9fa86d82e173572d504c089f10825d749725592626e090b38c9679")
     version("6.1.1", sha256="6b900f26d676c7eca1d2e7dff9b71890dabd3ff59cab2a2d2178bc8a0395342a")
     version("6.1.0", sha256="c4b85675541cf66ee7cb71514097fdd6c5fc0e02527243617a4f20ca6b4f2932")
     version("6.0.0", sha256="7bc0c5145c19a56d82a08fce6908c5e1a0e75e4fbfb3b6f12b4deae7f4b38cbc")
@@ -31,6 +46,7 @@ class Bazel(Package):
     version("5.1.1", sha256="7f5d3bc1d344692b2400f3765fd4b5c0b636eb4e7a8a7b17923095c7b56a4f78")
     version("5.1.0", sha256="4de301f509fc6d0cbc697b2017384ecdc94df8f36245bbcbedc7ea6780acc9f5")
     version("5.0.0", sha256="072dd62d237dbc11e0bac02e118d8c2db4d0ba3ba09f1a0eb1e2a460fb8419db")
+    version("4.2.4", sha256="d5ba2ef28da5275f22e832aaa7f9319c61ea5db9b6a3e23b28a6a64ad03078f3")
     version("4.2.3", sha256="b0e84d0538f3ec2b95a49bae31a5066f0967281a3ca99965016fbe178acd2d3d")
     version("4.2.2", sha256="9981d0d53a356c4e87962847750a97c9e8054e460854748006c80f0d7e2b2d33")
     version("4.2.1", sha256="12ea7aa11e2bdb12de1dceb9939a22e96f5a480437cb17c123379d8e0fdf5e82")
@@ -55,356 +71,6 @@ class Bazel(Package):
     version("2.1.0", sha256="3371cd9050989173a3b27364668328653a65653a50a85c320adc53953b4d5f46")
     version("2.0.1", sha256="a863ed9e6fc420fbd92e63a12fe1a5b9be1a7a36f11f61f1fdc582c813bbe543")
     version("2.0.0", sha256="724da3c656f68e787a86ebb9844773aa1c2e3a873cc39462a8f1b336153d6cbb")
-    version(
-        "1.2.1",
-        sha256="255da49d0f012bc4f2c1d6d3ccdbe578e22fe97b8d124e1629a486fe2a09d3e1",
-        deprecated=True,
-    )
-    version(
-        "1.2.0",
-        sha256="9cb46b0a18b9166730307a0e82bf4c02281a1cc6da0fb11239e6fe4147bdee6e",
-        deprecated=True,
-    )
-    version(
-        "1.1.0",
-        sha256="4b66a8c93af7832ed32e7236cf454a05f3aa06d25a8576fc3f83114f142f95ab",
-        deprecated=True,
-    )
-    version(
-        "1.0.1",
-        sha256="f4d2dfad011ff03a5fae41b9b02cd96cd7297c1205d496603d66516934fbcfee",
-        deprecated=True,
-    )
-    version(
-        "1.0.0",
-        sha256="c61daf0b69dd95205c695b2f9022d296d052c727062cfd396d54ffb2154f8cac",
-        deprecated=True,
-    )
-    version(
-        "0.29.1",
-        sha256="872a52cff208676e1169b3e1cae71b1fe572c4109cbd66eab107d8607c378de5",
-        deprecated=True,
-    )
-    version(
-        "0.29.0",
-        sha256="01cb6f2e808bd016cf0e217e12373c9efb808123e58b37885be8364458d3a40a",
-        deprecated=True,
-    )
-    version(
-        "0.28.1",
-        sha256="2cea463d611f5255d2f3d41c8de5dcc0961adccb39cf0ac036f07070ba720314",
-        deprecated=True,
-    )
-    version(
-        "0.28.0",
-        sha256="26ad8cdadd413b8432cf46d9fc3801e8db85d9922f85dd8a7f5a92fec876557f",
-        deprecated=True,
-    )
-    version(
-        "0.27.2",
-        sha256="5e1bf2b48e54eb7e518430667d29aef53695d6dd7c718665a52131ab27aadab2",
-        deprecated=True,
-    )
-    version(
-        "0.27.1",
-        sha256="8051d77da4ec338acd91770f853e4c25f4407115ed86fd35a6de25921673e779",
-        deprecated=True,
-    )
-    version(
-        "0.27.0",
-        sha256="c3080d3b959ac08502ad5c84a51608c291accb1481baad88a628bbf79b30c67a",
-        deprecated=True,
-    )
-    version(
-        "0.26.1",
-        sha256="c0e94f8f818759f3f67af798c38683520c540f469cb41aea8f5e5a0e43f11600",
-        deprecated=True,
-    )
-    version(
-        "0.26.0",
-        sha256="d26dadf62959255d58e523da3448a6222af768fe1224e321b120c1d5bbe4b4f2",
-        deprecated=True,
-    )
-    version(
-        "0.25.3",
-        sha256="23eafd3e439bc71baba9c592b52cb742dabc8640a13b9da1751fec090a2dda99",
-        deprecated=True,
-    )
-    version(
-        "0.25.2",
-        sha256="7456032199852c043e6c5b3e4c71dd8089c1158f72ec554e6ec1c77007f0ab51",
-        deprecated=True,
-    )
-    version(
-        "0.25.1",
-        sha256="a52bb31aeb1f821e649d25ef48023cfb54a12887aff875c6349ebcac36c2f056",
-        deprecated=True,
-    )
-    version(
-        "0.25.0",
-        sha256="f624fe9ca8d51de192655369ac538c420afb7cde16e1ad052554b582fff09287",
-        deprecated=True,
-    )
-    version(
-        "0.24.1",
-        sha256="56ea1b199003ad832813621744178e42b39e6206d34fbae342562c287da0cd54",
-        deprecated=True,
-    )
-    version(
-        "0.24.0",
-        sha256="621d2a97899a88850a913eabf9285778331a309fd4658b225b1377f80060fa85",
-        deprecated=True,
-    )
-    version(
-        "0.23.2",
-        sha256="293a5a7d851e0618eeb5e6958d94a11d45b6a00f2ba9376de61ac2bd5f917439",
-        deprecated=True,
-    )
-    version(
-        "0.23.1",
-        sha256="dd47199f92452bf67b2c5d60ad4b7143554eaf2c6196ab6e8713449d81a0491d",
-        deprecated=True,
-    )
-    version(
-        "0.23.0",
-        sha256="2daf9c2c6498836ed4ebae7706abb809748b1350cacd35b9f89452f31ac0acc1",
-        deprecated=True,
-    )
-    version(
-        "0.22.0",
-        sha256="6860a226c8123770b122189636fb0c156c6e5c9027b5b245ac3b2315b7b55641",
-        deprecated=True,
-    )
-    version(
-        "0.21.0",
-        sha256="6ccb831e683179e0cfb351cb11ea297b4db48f9eab987601c038aa0f83037db4",
-        deprecated=True,
-    )
-    version(
-        "0.20.0",
-        sha256="1945afa84fd8858b0a3c68c09915a4bc81065c61df2591387b2985e2297d30bd",
-        deprecated=True,
-    )
-    version(
-        "0.19.2",
-        sha256="11234cce4f6bdc62c3ac688f41c7b5c178eecb6f7e2c4ba0bcf00ba8565b1d19",
-        deprecated=True,
-    )
-    version(
-        "0.19.1",
-        sha256="c9405f7b8c79ebc81f9f0e49bb656df4a0da246771d010c2cdd6bb30e2500ac0",
-        deprecated=True,
-    )
-    version(
-        "0.19.0",
-        sha256="ee6135c5c47306c8421d43ad83aabc4f219cb065376ee37797f2c8ba9a615315",
-        deprecated=True,
-    )
-    version(
-        "0.18.1",
-        sha256="baed9f28c317000a4ec1ad2571b3939356d22746ca945ac2109148d7abb860d4",
-        deprecated=True,
-    )
-    version(
-        "0.18.0",
-        sha256="d0e86d2f7881ec8742a9823a986017452d2da0dfe4e989111da787cb89257155",
-        deprecated=True,
-    )
-    version(
-        "0.17.2",
-        sha256="b6e87acfa0a405bb8b3417c58477b66d5bc27dc0d31ba6fa12bc255b9278d33b",
-        deprecated=True,
-    )
-    version(
-        "0.17.1",
-        sha256="23e4281c3628cbd746da3f51330109bbf69780bd64461b63b386efae37203f20",
-        deprecated=True,
-    )
-    version(
-        "0.16.1",
-        sha256="09c66b94356c82c52f212af52a81ac28eb06de1313755a2f23eeef84d167b36c",
-        deprecated=True,
-    )
-    version(
-        "0.16.0",
-        sha256="c730593916ef0ba62f3d113cc3a268e45f7e8039daf7b767c8641b6999bd49b1",
-        deprecated=True,
-    )
-    version(
-        "0.15.2",
-        sha256="bf53ec73be3a6d412d85ef612cec6e9c85db45da42001fab0cf1dad44cfc03f1",
-        deprecated=True,
-    )
-    version(
-        "0.15.1",
-        sha256="c62b351fa4c1ba5aeb34d0a137176f8e8f1d89a32f548a10e96c11df176ffc6c",
-        deprecated=True,
-    )
-    version(
-        "0.15.0",
-        sha256="c3b716e6625e6b8c323350c95cd3ae0f56aeb00458dddd10544d5bead8a7b602",
-        deprecated=True,
-    )
-    version(
-        "0.14.1",
-        sha256="d49cdcd82618ae7a7a190e6f0a80d9bf85c1a66b732f994f37732dc14ffb0025",
-        deprecated=True,
-    )
-    version(
-        "0.14.0",
-        sha256="259627de8b9d415cc80904523facf3d50e6e8e68448ab968eb1c9cb8ca1ef843",
-        deprecated=True,
-    )
-    version(
-        "0.13.1",
-        sha256="b0269e75b40d87ff87886e5f3432cbf88f70c96f907ab588e6c21b2922d72db0",
-        deprecated=True,
-    )
-    version(
-        "0.13.0",
-        sha256="82e9035084660b9c683187618a29aa896f8b05b5f16ae4be42a80b5e5b6a7690",
-        deprecated=True,
-    )
-    version(
-        "0.12.0",
-        sha256="3b3e7dc76d145046fdc78db7cac9a82bc8939d3b291e53a7ce85315feb827754",
-        deprecated=True,
-    )
-    version(
-        "0.11.1",
-        sha256="e8d762bcc01566fa50952c8028e95cfbe7545a39b8ceb3a0d0d6df33b25b333f",
-        deprecated=True,
-    )
-    version(
-        "0.11.0",
-        sha256="abfeccc94728cb46be8dbb3507a23ccffbacef9fbda96a977ef4ea8d6ab0d384",
-        deprecated=True,
-    )
-    version(
-        "0.10.1",
-        sha256="708248f6d92f2f4d6342006c520f22dffa2f8adb0a9dc06a058e3effe7fee667",
-        deprecated=True,
-    )
-    version(
-        "0.10.0",
-        sha256="47e0798caaac4df499bce5fe554a914abd884a855a27085a4473de1d737d9548",
-        deprecated=True,
-    )
-    version(
-        "0.9.0",
-        sha256="efb28fed4ffcfaee653e0657f6500fc4cbac61e32104f4208da385676e76312a",
-        deprecated=True,
-    )
-    version(
-        "0.8.1",
-        sha256="dfd0761e0b7e36c1d74c928ad986500c905be5ebcfbc29914d574af1db7218cf",
-        deprecated=True,
-    )
-    version(
-        "0.8.0",
-        sha256="aa840321d056abd3c6be10c4a1e98a64f9f73fff9aa89c468dae8c003974a078",
-        deprecated=True,
-    )
-    version(
-        "0.7.0",
-        sha256="a084a9c5d843e2343bf3f319154a48abe3d35d52feb0ad45dec427a1c4ffc416",
-        deprecated=True,
-    )
-    version(
-        "0.6.1",
-        sha256="dada1f60a512789747011184b2767d2b44136ef3b036d86947f1896d200d2ba7",
-        deprecated=True,
-    )
-    version(
-        "0.6.0",
-        sha256="a0e53728a9541ef87934831f3d05f2ccfdc3b8aeffe3e037be2b92b12400598e",
-        deprecated=True,
-    )
-    version(
-        "0.5.4",
-        sha256="2157b05309614d6af0e4bbc6065987aede590822634a0522161f3af5d647abc9",
-        deprecated=True,
-    )
-    version(
-        "0.5.3",
-        sha256="76b5c5880a0b15f5b91f7d626c5bc3b76ce7e5d21456963c117ab711bf1c5333",
-        deprecated=True,
-    )
-    version(
-        "0.5.2",
-        sha256="2418c619bdd44257a170b85b9d2ecb75def29e751b725e27186468ada2e009ea",
-        deprecated=True,
-    )
-    version(
-        "0.5.1",
-        sha256="85e6a18b111afeea2e475fe991db2a441ec3824211d659bee7b0012c36be9a40",
-        deprecated=True,
-    )
-    version(
-        "0.5.0",
-        sha256="ebba7330a8715e96a6d6dc0aa085125d529d0740d788f0544c6169d892e4f861",
-        deprecated=True,
-    )
-    version(
-        "0.4.5",
-        sha256="2b737be42678900470ae9e48c975ac5b2296d9ae23c007bf118350dbe7c0552b",
-        deprecated=True,
-    )
-    version(
-        "0.4.4",
-        sha256="d52a21dda271ae645711ce99c70cf44c5d3a809138e656bbff00998827548ebb",
-        deprecated=True,
-    )
-    version(
-        "0.4.3",
-        sha256="cbd2ab580181c17317cf18b2bf825bcded2d97cab01cd5b5fe4f4d520b64f90f",
-        deprecated=True,
-    )
-    version(
-        "0.4.2",
-        sha256="8e6f41252abadcdb2cc7a07f910ec4b45fb12c46f0a578672c6a186c7efcdb36",
-        deprecated=True,
-    )
-    version(
-        "0.4.1",
-        sha256="008c648d3c46ece063ae8b5008480d8ae6d359d35967356685d1c09da07e1064",
-        deprecated=True,
-    )
-    version(
-        "0.4.0",
-        sha256="6474714eee72ba2d4e271ed00ce8c05d67a9d15327bc03962b821b2af2c5ca36",
-        deprecated=True,
-    )
-    version(
-        "0.3.2",
-        sha256="ca5caf7b2b48c7639f45d815b32e76d69650f3199eb8caa541d402722e3f6c10",
-        deprecated=True,
-    )
-    version(
-        "0.3.1",
-        sha256="218d0e28b4d1ee34585f2ac6b18d169c81404d93958815e73e60cc0368efcbb7",
-        deprecated=True,
-    )
-    version(
-        "0.3.0",
-        sha256="357fd8bdf86034b93902616f0844bd52e9304cccca22971ab7007588bf9d5fb3",
-        deprecated=True,
-    )
-    version(
-        "0.2.0",
-        sha256="e9ba2740d9727ae6d0f9b1ac0c5df331814fd03518fe4b511396ed10780d5272",
-        deprecated=True,
-    )
-    version(
-        "0.1.4",
-        sha256="f3c395f5cd78cfef96f4008fe842f327bc8b03b77f46999387bc0ad223b5d970",
-        deprecated=True,
-    )
-    version(
-        "0.1.1",
-        sha256="c6ae19610b936a0aa940b44a3626d6e660fc457a8187d295cdf0b21169453d20",
-        deprecated=True,
-    )
 
     variant(
         "nodepfail",
@@ -418,45 +84,30 @@ class Bazel(Package):
     # end EBRAINS
 
     # https://bazel.build/install/compile-source#bootstrap-unix-prereq
-    depends_on("java", type=("build", "run"))
     depends_on("java@11", when="@5.3:", type=("build", "run"))
     depends_on("java@8,11", when="@3.3:5.2", type=("build", "run"))
     depends_on("java@8", when="@0.6:3.2", type=("build", "run"))
-    depends_on("java@7:8", when="@:0.5", type=("build", "run"))
     depends_on("python+pythoncmd", type=("build", "run"))
     depends_on("zip", when="platform=linux", type=("build", "run"))
 
     # Pass Spack environment variables to the build
-    patch("bazelruleclassprovider-0.25.patch", when="@0.25:")
-    patch("bazelruleclassprovider-0.14.patch", when="@0.14:0.24")
-    patch("bazelconfiguration-0.3.patch", when="@:0.13")
+    patch("bazelruleclassprovider-0.25.patch")
 
     # Inject include paths
     patch("unix_cc_configure-3.0.patch", when="@3:")
-    patch("unix_cc_configure-0.15.patch", when="@0.15:2")
-    patch("unix_cc_configure-0.10.patch", when="@0.10:0.14")
-    patch("unix_cc_configure-0.5.3.patch", when="@0.5.3:0.9")
-    patch("cc_configure-0.5.0.patch", when="@0.5.0:0.5.2")
-    patch("cc_configure-0.3.0.patch", when="@0.3:0.4")
+    patch("unix_cc_configure-0.15.patch", when="@:2")
 
     # Set CC and CXX
     # begin EBRAINS (modified): bring upstream after checking since when this is breaking the build
-    patch("compile-0.29.patch", when="@0.29:5.3")
+    patch("compile-0.29.patch", when="@:5.3")
     # end EBRAINS
-    patch("compile-0.21.patch", when="@0.21:0.28")
-    patch("compile-0.16.patch", when="@0.16:0.20")
-    patch("compile-0.13.patch", when="@0.13:0.15")
-    patch("compile-0.9.patch", when="@0.9:0.12")
-    patch("compile-0.6.patch", when="@0.6:0.8")
-    patch("compile-0.4.patch", when="@0.4:0.5")
-    patch("compile-0.3.patch", when="@0.2:0.3")
 
     # Disable dependency search
-    patch("cppcompileaction-0.3.2.patch", when="@0.3.2:+nodepfail")
-    patch("cppcompileaction-0.3.0.patch", when="@0.3.0:0.3.1+nodepfail")
+    patch("cppcompileaction-7.0.0.patch", when="@7: +nodepfail")
+    patch("cppcompileaction-0.3.2.patch", when="@:6 +nodepfail")
 
     # https://github.com/bazelbuild/bazel/issues/17956
-    patch("apple-clang-14.0.3.patch", when="@0.3:5.4.0,6.0:6.1")
+    patch("apple-clang-14.0.3.patch", when="@:4.2.3,5:6.1.1")
 
     # https://github.com/bazelbuild/bazel/issues/17958
     patch(
@@ -465,56 +116,85 @@ class Bazel(Package):
         when="@5.0:5.4.0,6.0",
     )
 
-    # Fix build on power9 (2x commits)
-    # https://github.com/bazelbuild/bazel/commit/5cff4f1edf8b95bf0612791632255852332f72b5
-    # https://github.com/bazelbuild/bazel/commit/ab62a6e097590dac5ec946ad7a796ea0e8593ae0
-    patch("build-0.29.1.patch", when="@0.29.1")
-
     # Fix build with Fujitsu compiler
-    patch("blaze_util_posix-0.29.1.patch", when="@0.29.1:%fj")
+    patch("blaze_util_posix-0.29.1.patch", when="%fj")
     patch("unix_cc_configure_fj-5.2.patch", when="@5.2:%fj")
     patch("unix_cc_configure_fj-5.0.patch", when="@5.0:5.1%fj")
-    patch("unix_cc_configure_fj-0.29.1.patch", when="@0.29.1:4%fj")
-    patch("bazelruleclassprovider_fj-0.25.patch", when="@0.25:%fj")
-    conflicts(
-        "%fj",
-        when="@:0.24.1",
-        msg="Fujitsu Compiler cannot build 0.24.1 or less, " "please use a newer release.",
-    )
+    patch("unix_cc_configure_fj-0.29.1.patch", when="@:4%fj")
+    patch("bazelruleclassprovider_fj-0.25.patch", when="%fj")
 
     # https://blog.bazel.build/2021/05/21/bazel-4-1.html
     conflicts("platform=darwin target=aarch64:", when="@:4.0")
 
-    # patches for compiling various older bazels which had ICWYU
-    # violations revealed by (but not unique to) GCC 11 header changes.
-    # these are derived from
+    # https://github.com/bazelbuild/bazel/issues/18642
+    patch(
+        "https://github.com/bazelbuild/bazel/pull/20785.patch?full_index=1",
+        sha256="85dde31d129bbd31e004c5c87f23cdda9295fbb22946dc6d362f23d83bae1fd8",
+        when="@6.0:6.4",
+    )
+    conflicts("%gcc@13:", when="@:5")
+
+    # Patches for compiling various older bazels which had ICWYU violations revealed by
+    # (but not unique to) GCC 11 header changes. These are derived from
     # https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/29084/
-    patch("gcc11_1.patch", when="@0.3.2:4")
-    patch("gcc11_2.patch", when="@0.3.2:4")
-    patch("gcc11_3.patch", when="@0.3:4")
+    patch("gcc11_1.patch", when="@:4")
+    patch("gcc11_2.patch", when="@:4")
+    patch("gcc11_3.patch", when="@:4")
     patch("gcc11_4.patch", when="@4.1:4")
 
-    # bazel-4.0.0 does not compile with gcc-11
-    # newer versions of grpc and abseil dependencies are needed but are not in
-    # bazel-4.0.0
-    conflicts("@:0.2,4.0.0", when="%gcc@11:")
+    # Bazel-4.0.0 does not compile with gcc-11
+    # Newer versions of grpc and abseil dependencies are needed but are not in bazel-4.0.0
+    conflicts("@4.0.0", when="%gcc@11:")
+
+    # https://github.com/bazelbuild/bazel/pull/23667
+    conflicts("%apple-clang@16:", when="@:7.3")
 
     executables = ["^bazel$"]
 
+    # Download resources to perform offline build with bazel.
+    # The following URLs and sha256 are in the file distdir_deps.bzl at the root of bazel sources.
+    resource_dictionary = {}
+    resource_dictionary["bazel_skylib"] = {
+        "url": "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.1/bazel-skylib-1.0.1.tar.gz",
+        "sha256": "f1c8360c01fcf276778d3519394805dc2a71a64274a3a0908bc9edff7b5aebc8",
+        "when": "@4:6",
+    }
+    resource_dictionary["com_google_absl"] = {
+        "url": "https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.0.tar.gz",
+        "sha256": "59d2976af9d6ecf001a81a35749a6e551a335b949d34918cfade07737b9d93c5",
+        "when": "@6.0:6.4",
+    }
+    resource_dictionary["zulu_11_56_19"] = {
+        "url": "https://mirror.bazel.build/cdn.azul.com/zulu/bin/zulu11.56.19-ca-jdk11.0.15-linux_x64.tar.gz",
+        "sha256": "e064b61d93304012351242bf0823c6a2e41d9e28add7ea7f05378b7243d34247",
+        "when": "@6",
+    }
+    resource_dictionary["zulu_11_50_19"] = {
+        "url": "https://mirror.bazel.build/openjdk/azul-zulu11.50.19-ca-jdk11.0.12/zulu11.50.19-ca-jdk11.0.12-linux_x64.tar.gz",
+        "sha256": "b8e8a63b79bc312aa90f3558edbea59e71495ef1a9c340e38900dd28a1c579f3",
+        "when": "@5",
+    }
+    resource_dictionary["zulu_11_37_17"] = {
+        "url": "https://mirror.bazel.build/openjdk/azul-zulu11.37.17-ca-jdk11.0.6/zulu11.37.17-ca-jdk11.0.6-linux_x64.tar.gz",
+        "sha256": "360626cc19063bc411bfed2914301b908a8f77a7919aaea007a977fa8fb3cde1",
+        "when": "@4",
+    }
+    for resource_name in resource_dictionary.keys():
+        resource(
+            when=resource_dictionary[resource_name]["when"],
+            name=resource_name,
+            url=resource_dictionary[resource_name]["url"],
+            sha256=resource_dictionary[resource_name]["sha256"],
+            destination="archive",
+            expand=False,
+        )
+
     @classmethod
     def determine_version(cls, exe):
         output = Executable(exe)("version", output=str, error=str)
         match = re.search(r"Build label: ([\d.]+)", output)
         return match.group(1) if match else None
 
-    def url_for_version(self, version):
-        if version >= Version("0.4.1"):
-            url = "https://github.com/bazelbuild/bazel/releases/download/{0}/bazel-{0}-dist.zip"
-        else:
-            url = "https://github.com/bazelbuild/bazel/archive/{0}.tar.gz"
-
-        return url.format(version)
-
     # begin EBRAINS (added)
     def setup_dependent_build_environment(self, env, dependent_spec):
         env.prepend_path("GCC_HOST_COMPILER_PREFIX", self.spec['binutils'].prefix.bin)
@@ -526,19 +206,25 @@ class Bazel(Package):
         env.set("BAZEL_LINKOPTS", "")
         env.set("BAZEL_LINKLIBS", "-lstdc++")
 
-        env.set(
-            "EXTRA_BAZEL_ARGS",
-            # Spack's logs don't handle colored output well
-            "--color=no --host_javabase=@local_jdk//:jdk"
-            # Enable verbose output for failures
-            " --verbose_failures"
-            # begin EBRAINS (modified): bring upstream after checking since when the compile-x.patch is breaking the build
-            # expose CC and CXX (the spack compiler wrappers)
-            " --action_env=CC"
-            " --action_env=CXX"
-            # end EBRAINS
-            " --jobs={0}".format(make_jobs),
+        # .WARNING: Option 'host_javabase' is deprecated
+        # Use local java installation
+        # begin EBRAINS (modified): expose CC and CXX (the spack compiler wrappers)
+        args = "--color=no --define=ABSOLUTE_JAVABASE={0} --verbose_failures --action_env=CC --action_env=CXX --jobs={1}".format(
+            self.spec["java"].prefix, make_jobs
         )
+        # end EBRAINS
+
+        resource_stages = self.stage[1:]
+        for _resource in resource_stages:
+            try:
+                resource_name = _resource.resource.name
+                if self.spec.satisfies(self.resource_dictionary[resource_name]["when"]):
+                    archive_path = _resource.source_path
+                    args += " --distdir={0}".format(archive_path)
+            except AttributeError:
+                continue
+
+        env.set("EXTRA_BAZEL_ARGS", args)
 
     @run_before("install")
     def bootstrap(self):
diff --git a/packages/bazel/unix_cc_configure-0.10.patch b/packages/bazel/unix_cc_configure-0.10.patch
deleted file mode 100644
index bdd24e11..00000000
--- a/packages/bazel/unix_cc_configure-0.10.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- a/tools/cpp/unix_cc_configure.bzl
-+++ b/tools/cpp/unix_cc_configure.bzl
-@@ -147,9 +147,18 @@ def get_escaped_cxx_inc_directories(repository_ctx, cc, additional_flags = []):
-   else:
-     inc_dirs = result.stderr[index1 + 1:index2].strip()
- 
--  return [_prepare_include_path(repository_ctx, _cxx_inc_convert(p))
--          for p in inc_dirs.split("\n")]
-+  default_inc_directories = [
-+    _prepare_include_path(repository_ctx, _cxx_inc_convert(p))
-+      for p in inc_dirs.split("\n")
-+  ]
-+ 
-+  env = repository_ctx.os.environ
-+  if "SPACK_INCLUDE_DIRS" in env:
-+    for path in env["SPACK_INCLUDE_DIRS"].split(":"):
-+      default_inc_directories.append(path)
-+
-+  return default_inc_directories
- 
-
- def _is_option_supported(repository_ctx, cc, option):
diff --git a/packages/bazel/unix_cc_configure-0.5.3.patch b/packages/bazel/unix_cc_configure-0.5.3.patch
deleted file mode 100644
index 79b583ba..00000000
--- a/packages/bazel/unix_cc_configure-0.5.3.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/tools/cpp/unix_cc_configure.bzl
-+++ b/tools/cpp/unix_cc_configure.bzl
-@@ -117,9 +117,19 @@ def get_escaped_cxx_inc_directories(repository_ctx, cc):
-   else:
-     inc_dirs = result.stderr[index1 + 1:index2].strip()
- 
--  return [escape_string(repository_ctx.path(_cxx_inc_convert(p)))
--          for p in inc_dirs.split("\n")]
-+  default_inc_directories = [
-+    escape_string(repository_ctx.path(_cxx_inc_convert(p)))
-+          for p in inc_dirs.split("\n")
-+  ]
- 
-+  env = repository_ctx.os.environ
-+  if "SPACK_INCLUDE_DIRS" in env:
-+    for path in env["SPACK_INCLUDE_DIRS"].split(":"):
-+      default_inc_directories.append(
-+        repository_ctx.path(_cxx_inc_convert(path))
-+      )
-+
-+  return default_inc_directories
- 
- def _add_option_if_supported(repository_ctx, cc, option):
-   """Checks that `option` is supported by the C compiler. Doesn't %-escape the option."""
diff --git a/packages/gcc/darwin/apfs.patch b/packages/gcc/darwin/apfs.patch
deleted file mode 100644
index d1f9d566..00000000
--- a/packages/gcc/darwin/apfs.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -uNr gcc-7.2.0.orig/libstdc++-v3/include/Makefile.in gcc-7.2.0/libstdc++-v3/include/Makefile.in
---- gcc-7.2.0.orig/libstdc++-v3/include/Makefile.in     2017-07-25 14:05:07.000000000 -0400
-+++ gcc-7.2.0/libstdc++-v3/include/Makefile.in  2017-09-02 12:22:08.000000000 -0400
-@@ -1764,6 +1764,8 @@
- @GLIBCXX_HOSTED_TRUE@install-data-local: install-headers
- @GLIBCXX_HOSTED_FALSE@install-data-local: install-freestanding-headers
- 
-+.NOTPARALLEL: install-headers
-+
- # This is a subset of the full install-headers rule.  We only need <ciso646>,
- # <cstddef>, <cfloat>, <limits>, <climits>, <cstdint>, <cstdlib>, <new>,
- # <typeinfo>, <exception>, <initializer_list>, <cstdalign>, <cstdarg>,
diff --git a/packages/gcc/darwin/clang13.patch b/packages/gcc/darwin/clang13.patch
deleted file mode 100644
index ac3bfcbe..00000000
--- a/packages/gcc/darwin/clang13.patch
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/gcc/genconditions.c	2019-01-01 12:37:19.064943662 +0100
-+++ b/gcc/genconditions.c	2019-10-11 10:57:11.464595789 +0200
-@@ -57,8 +57,9 @@ write_header (void)
- \n\
- /* It is necessary, but not entirely safe, to include the headers below\n\
-    in a generator program.  As a defensive measure, don't do so when the\n\
--   table isn't going to have anything in it.  */\n\
--#if GCC_VERSION >= 3001\n\
-+   table isn't going to have anything in it.\n\
-+   Clang 9 is buggy and doesn't handle __builtin_constant_p correctly.  */\n\
-+#if GCC_VERSION >= 3001 && __clang_major__ < 9\n\
- \n\
- /* Do not allow checking to confuse the issue.  */\n\
- #undef CHECKING_P\n\
-@@ -170,7 +171,7 @@ struct c_test\n\
-    vary at run time.  It works in 3.0.1 and later; 3.0 only when not\n\
-    optimizing.  */\n\
- \n\
--#if GCC_VERSION >= 3001\n\
-+#if GCC_VERSION >= 3001 && __clang_major__ < 9\n\
- static const struct c_test insn_conditions[] = {\n");
- 
-   traverse_c_tests (write_one_condition, 0);
-@@ -191,7 +192,7 @@ write_writer (void)
- 	"  unsigned int i;\n"
-         "  const char *p;\n"
-         "  puts (\"(define_conditions [\");\n"
--	"#if GCC_VERSION >= 3001\n"
-+	"#if GCC_VERSION >= 3001 && __clang_major__ < 9\n"
- 	"  for (i = 0; i < ARRAY_SIZE (insn_conditions); i++)\n"
- 	"    {\n"
- 	"      printf (\"  (%d \\\"\", insn_conditions[i].value);\n"
diff --git a/packages/gcc/darwin/gcc-4.9.patch1 b/packages/gcc/darwin/gcc-4.9.patch1
deleted file mode 100644
index 444e2927..00000000
--- a/packages/gcc/darwin/gcc-4.9.patch1
+++ /dev/null
@@ -1,42 +0,0 @@
-diff --git a/gcc/configure b/gcc/configure
-index 9523773..52b0bf7 100755
---- a/gcc/configure
-+++ b/gcc/configure
-@@ -24884,7 +24884,7 @@ if test "${gcc_cv_as_ix86_filds+set}" = set; then :
- else
-   gcc_cv_as_ix86_filds=no
-   if test x$gcc_cv_as != x; then
--    $as_echo 'filds mem; fists mem' > conftest.s
-+    $as_echo 'filds (%ebp); fists (%ebp)' > conftest.s
-     if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
-   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-   (eval $ac_try) 2>&5
-@@ -24915,7 +24915,7 @@ if test "${gcc_cv_as_ix86_fildq+set}" = set; then :
- else
-   gcc_cv_as_ix86_fildq=no
-   if test x$gcc_cv_as != x; then
--    $as_echo 'fildq mem; fistpq mem' > conftest.s
-+    $as_echo 'fildq (%ebp); fistpq (%ebp)' > conftest.s
-     if { ac_try='$gcc_cv_as $gcc_cv_as_flags  -o conftest.o conftest.s >&5'
-   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-   (eval $ac_try) 2>&5
-diff --git a/gcc/configure.ac b/gcc/configure.ac
-index 68b0ee8..bd53978 100644
---- a/gcc/configure.ac
-+++ b/gcc/configure.ac
-@@ -3869,13 +3869,13 @@ foo:	nop
- 
-     gcc_GAS_CHECK_FEATURE([filds and fists mnemonics],
-        gcc_cv_as_ix86_filds,,,
--       [filds mem; fists mem],,
-+       [filds (%ebp); fists (%ebp)],,
-        [AC_DEFINE(HAVE_AS_IX86_FILDS, 1,
-          [Define if your assembler uses filds and fists mnemonics.])])
- 
-     gcc_GAS_CHECK_FEATURE([fildq and fistpq mnemonics],
-        gcc_cv_as_ix86_fildq,,,
--       [fildq mem; fistpq mem],,
-+       [fildq (%ebp); fistpq (%ebp)],,
-        [AC_DEFINE(HAVE_AS_IX86_FILDQ, 1,
-          [Define if your assembler uses fildq and fistq mnemonics.])])
- 
diff --git a/packages/gcc/darwin/gcc-4.9.patch2 b/packages/gcc/darwin/gcc-4.9.patch2
deleted file mode 100644
index b065997f..00000000
--- a/packages/gcc/darwin/gcc-4.9.patch2
+++ /dev/null
@@ -1,28 +0,0 @@
-From 82f81877458ea372176eabb5de36329431dce99b Mon Sep 17 00:00:00 2001
-From: Iain Sandoe <iain@codesourcery.com>
-Date: Sat, 21 Dec 2013 00:30:18 +0000
-Subject: [PATCH] don't try to mark local symbols as no-dead-strip
-
----
- gcc/config/darwin.c | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
-index 40804b8..0080299 100644
---- a/gcc/config/darwin.c
-+++ b/gcc/config/darwin.c
-@@ -1259,6 +1259,11 @@ darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
- void
- darwin_mark_decl_preserved (const char *name)
- {
-+  /* Actually we shouldn't mark any local symbol this way, but for now
-+     this only happens with ObjC meta-data.  */
-+  if (darwin_label_is_anonymous_local_objc_name (name))
-+    return;
-+
-   fprintf (asm_out_file, "\t.no_dead_strip ");
-   assemble_name (asm_out_file, name);
-   fputc ('\n', asm_out_file);
--- 
-2.2.1
-
diff --git a/packages/gcc/darwin/gcc-6.1.0-jit.patch b/packages/gcc/darwin/gcc-6.1.0-jit.patch
deleted file mode 100644
index 8cc4405d..00000000
--- a/packages/gcc/darwin/gcc-6.1.0-jit.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-# Fix for libgccjit.so linkage on Darwin
-# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64089
-# https://github.com/Homebrew/homebrew-core/issues/1872#issuecomment-225625332
-# https://github.com/Homebrew/homebrew-core/issues/1872#issuecomment-225626490
-
-# Stolen from Homebrew:
-# https://raw.githubusercontent.com/Homebrew/formula-patches/e9e0ee09389a54cc4c8fe1c24ebca3cd765ed0ba/gcc/6.1.0-jit.patch
-diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
-index 44d0750..4df2a9c 100644
---- a/gcc/jit/Make-lang.in
-+++ b/gcc/jit/Make-lang.in
-@@ -85,8 +85,7 @@ $(LIBGCCJIT_FILENAME): $(jit_OBJS) \
-	     $(jit_OBJS) libbackend.a libcommon-target.a libcommon.a \
-	     $(CPPLIB) $(LIBDECNUMBER) $(LIBS) $(BACKENDLIBS) \
-	     $(EXTRA_GCC_OBJS) \
--	     -Wl,--version-script=$(srcdir)/jit/libgccjit.map \
--	     -Wl,-soname,$(LIBGCCJIT_SONAME)
-+	     -Wl,-install_name,$(LIBGCCJIT_SONAME)
-
- $(LIBGCCJIT_SONAME_SYMLINK): $(LIBGCCJIT_FILENAME)
-	ln -sf $(LIBGCCJIT_FILENAME) $(LIBGCCJIT_SONAME_SYMLINK)
diff --git a/packages/gcc/darwin/gcc-7.1.0-headerpad.patch b/packages/gcc/darwin/gcc-7.1.0-headerpad.patch
deleted file mode 100644
index 11ca2d0e..00000000
--- a/packages/gcc/darwin/gcc-7.1.0-headerpad.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-# Use -headerpad_max_install_names in the build,
-# otherwise lto1 load commands cannot be edited on El Capitan
-
-# Stolen from Homebrew:
-# https://raw.githubusercontent.com/Homebrew/formula-patches/32cf103/gcc/7.1.0-headerpad.patch
-
-diff --git a/config/mh-darwin b/config/mh-darwin
-index 148b730..c2318b5 100644
---- a/config/mh-darwin
-+++ b/config/mh-darwin
-@@ -16,7 +16,7 @@ DARWIN_GCC_MDYNAMIC_NO_PIC := \
- DARWIN_NO_PIE := `case ${host} in *-*-darwin[1][1-9]*) echo -Wl,-no_pie ;; esac;`
- 
- BOOT_CFLAGS += $(DARWIN_MDYNAMIC_NO_PIC)
--BOOT_LDFLAGS += $(DARWIN_NO_PIE)
-+BOOT_LDFLAGS += $(DARWIN_NO_PIE) -Wl,-headerpad_max_install_names
- 
- # Similarly, for cross-compilation.
- STAGE1_CFLAGS += $(DARWIN_MDYNAMIC_NO_PIC)
diff --git a/packages/gcc/darwin/headers-10.13-fix.patch b/packages/gcc/darwin/headers-10.13-fix.patch
deleted file mode 100644
index 3dbfde02..00000000
--- a/packages/gcc/darwin/headers-10.13-fix.patch
+++ /dev/null
@@ -1,127 +0,0 @@
-diff -pur fixincludes/fixincl.x gcc-5.5.0/fixincludes/fixincl.x
---- a/fixincludes/fixincl.x	2017-01-30 17:08:42.000000000 +0100
-+++ b/fixincludes/fixincl.x	2017-12-21 14:34:35.000000000 +0100
-@@ -1,12 +1,12 @@
- /*  -*- buffer-read-only: t -*- vi: set ro:
-- * 
-+ *
-  * DO NOT EDIT THIS FILE   (fixincl.x)
-- * 
-- * It has been AutoGen-ed  January  5, 2017 at 06:05:06 PM by AutoGen 5.16.2
-+ *
-+ * It has been AutoGen-ed  December 21, 2017 at 02:34:35 PM by AutoGen 5.18.7
-  * From the definitions    inclhack.def
-  * and the template file   fixincl
-  */
--/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Jan  5 18:05:06 CET 2017
-+/* DO NOT SVN-MERGE THIS FILE, EITHER Thu Dec 21 14:34:35 CET 2017
-  *
-  * You must regenerate it.  Use the ./genfixes script.
-  *
-@@ -15,7 +15,7 @@
-  * certain ANSI-incompatible system header files which are fixed to work
-  * correctly with ANSI C and placed in a directory that GNU C will search.
-  *
-- * This file contains 240 fixup descriptions.
-+ * This file contains 241 fixup descriptions.
-  *
-  * See README for more information.
-  *
-@@ -2579,6 +2579,43 @@ extern \"C\" {\n\
- 
- /* * * * * * * * * * * * * * * * * * * * * * * * * *
-  *
-+ *  Description of Darwin_Osavailability fix
-+ */
-+tSCC zDarwin_OsavailabilityName[] =
-+     "darwin_osavailability";
-+
-+/*
-+ *  File name selection pattern
-+ */
-+tSCC zDarwin_OsavailabilityList[] =
-+  "os/availability.h\0";
-+/*
-+ *  Machine/OS name selection pattern
-+ */
-+tSCC* apzDarwin_OsavailabilityMachs[] = {
-+        "*-*-darwin*",
-+        (const char*)NULL };
-+
-+/*
-+ *  content selection pattern - do fix if pattern found
-+ */
-+tSCC zDarwin_OsavailabilitySelect0[] =
-+       "#define[ \t]+__(API_[A-Z_]*)\\(\\.\\.\\.\\)";
-+
-+#define    DARWIN_OSAVAILABILITY_TEST_CT  1
-+static tTestDesc aDarwin_OsavailabilityTests[] = {
-+  { TT_EGREP,    zDarwin_OsavailabilitySelect0, (regex_t*)NULL }, };
-+
-+/*
-+ *  Fix Command Arguments for Darwin_Osavailability
-+ */
-+static const char* apzDarwin_OsavailabilityPatch[] = {
-+    "format",
-+    "#define %1(...)",
-+    (char*)NULL };
-+
-+/* * * * * * * * * * * * * * * * * * * * * * * * * *
-+ *
-  *  Description of Darwin_9_Long_Double_Funcs_2 fix
-  */
- tSCC zDarwin_9_Long_Double_Funcs_2Name[] =
-@@ -9818,9 +9855,9 @@ static const char* apzX11_SprintfPatch[]
-  *
-  *  List of all fixes
-  */
--#define REGEX_COUNT          276
-+#define REGEX_COUNT          277
- #define MACH_LIST_SIZE_LIMIT 187
--#define FIX_COUNT            240
-+#define FIX_COUNT            241
- 
- /*
-  *  Enumerate the fixes
-@@ -9885,6 +9922,7 @@ typedef enum {
-     CTRL_QUOTES_DEF_FIXIDX,
-     CTRL_QUOTES_USE_FIXIDX,
-     CXX_UNREADY_FIXIDX,
-+    DARWIN_OSAVAILABILITY_FIXIDX,
-     DARWIN_9_LONG_DOUBLE_FUNCS_2_FIXIDX,
-     DARWIN_EXTERNC_FIXIDX,
-     DARWIN_GCC4_BREAKAGE_FIXIDX,
-@@ -10364,6 +10402,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
-      CXX_UNREADY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
-      aCxx_UnreadyTests,   apzCxx_UnreadyPatch, 0 },
- 
-+  {  zDarwin_OsavailabilityName,    zDarwin_OsavailabilityList,
-+     apzDarwin_OsavailabilityMachs,
-+     DARWIN_OSAVAILABILITY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
-+     aDarwin_OsavailabilityTests,   apzDarwin_OsavailabilityPatch, 0 },
-+
-   {  zDarwin_9_Long_Double_Funcs_2Name,    zDarwin_9_Long_Double_Funcs_2List,
-      apzDarwin_9_Long_Double_Funcs_2Machs,
-      DARWIN_9_LONG_DOUBLE_FUNCS_2_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
-diff -pur fixincludes/inclhack.def gcc-5.5.0/fixincludes/inclhack.def
---- a/fixincludes/inclhack.def	2017-01-30 17:08:42.000000000 +0100
-+++ b/fixincludes/inclhack.def	2017-12-21 14:34:28.000000000 +0100
-@@ -1337,6 +1337,18 @@ fix = {
-     test_text = "extern void* malloc( size_t );";
- };
- 
-+fix = {
-+    hackname  = darwin_osavailability;
-+    mach      = "*-*-darwin*";
-+    files     = os/availability.h;
-+    select    = "#define[ \t]+__(API_[A-Z_]*)\\(\\.\\.\\.\\)";
-+    c_fix     = format;
-+    c_fix_arg = "#define %1(...)";
-+
-+    test_text = "#define __API_AVAILABLE(...)\n"
-+		"#define API_AVAILABLE(...)\n";
-+};
-+
- /*
-  *  For the AAB_darwin7_9_long_double_funcs fix to be useful,
-  *  you have to not use "" includes.
diff --git a/packages/gcc/detection_test.yaml b/packages/gcc/detection_test.yaml
deleted file mode 100644
index 5e53101a..00000000
--- a/packages/gcc/detection_test.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-paths:
-  # Ubuntu 18.04, system compilers without Fortran
-  - layout:
-      - executables:
-        - "bin/gcc"
-        - "bin/g++"
-        script: "echo 7.5.0"
-    results:
-      - spec: "gcc@7.5.0 languages=c,c++"
-  # Mock a version < 7 of GCC that requires -dumpversion and
-  # errors with -dumpfullversion
-  - layout:
-      - executables:
-        - "bin/gcc-5"
-        - "bin/g++-5"
-        - "bin/gfortran-5"
-        script: |
-          if [[ "$1" == "-dumpversion" ]] ; then
-            echo "5.5.0"
-          else
-            echo "gcc-5: fatal error: no input files"
-            echo "compilation terminated."
-            exit 1
-          fi
-    results:
-      - spec: "gcc@5.5.0 languages=c,c++,fortran"
-  # Multiple compilers present at the same time
-  - layout:
-      - executables:
-        - "bin/x86_64-linux-gnu-gcc-6"
-        script: 'echo 6.5.0'
-      - executables:
-        - "bin/x86_64-linux-gnu-gcc-10"
-        - "bin/x86_64-linux-gnu-g++-10"
-        script: "echo 10.1.0"
-    results:
-      - spec: "gcc@6.5.0 languages=c"
-      - spec: "gcc@10.1.0 languages=c,c++"
\ No newline at end of file
diff --git a/packages/gcc/gcc-backport.patch b/packages/gcc/gcc-backport.patch
deleted file mode 100644
index f9fab68f..00000000
--- a/packages/gcc/gcc-backport.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-2016-02-20  Bernd Edlinger  <bernd.edlinger@hotmail.de>
-
-	Backported from mainline
-	2016-02-19  Jakub Jelinek  <jakub@redhat.com>
-		    Bernd Edlinger  <bernd.edlinger@hotmail.de>
-
-	* Make-lang.in: Invoke gperf with -L C++.
- 	* cfns.gperf: Remove prototypes for hash and libc_name_p
- 	inlines.
- 	* cfns.h: Regenerated.
-	* except.c (nothrow_libfn_p): Adjust.
-
-Index: gcc/cp/Make-lang.in
-===================================================================
---- a/gcc/cp/Make-lang.in	(revision 233574)
-+++ b/gcc/cp/Make-lang.in	(working copy)
-@@ -111,7 +111,7 @@ else
- # deleting the $(srcdir)/cp/cfns.h file.
- $(srcdir)/cp/cfns.h:
- endif
--	gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
-+	gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
- 		$(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
- 
- #
-Index: gcc/cp/cfns.gperf
-===================================================================
---- a/gcc/cp/cfns.gperf	(revision 233574)
-+++ b/gcc/cp/cfns.gperf	(working copy)
-@@ -1,3 +1,5 @@
-+%language=C++
-+%define class-name libc_name
- %{
- /* Copyright (C) 2000-2015 Free Software Foundation, Inc.
- 
-@@ -16,14 +18,6 @@ for more details.
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
--#ifdef __GNUC__
--__inline
--#endif
--static unsigned int hash (const char *, unsigned int);
--#ifdef __GNUC__
--__inline
--#endif
--const char * libc_name_p (const char *, unsigned int);
- %}
- %%
- # The standard C library functions, for feeding to gperf; the result is used
-Index: gcc/cp/cfns.h
-===================================================================
---- a/gcc/cp/cfns.h	(revision 233574)
-+++ b/gcc/cp/cfns.h	(working copy)
-@@ -1,5 +1,5 @@
--/* ANSI-C code produced by gperf version 3.0.3 */
--/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf  */
-+/* C++ code produced by gperf version 3.0.4 */
-+/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf  */
- 
- #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
-       && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
-@@ -28,7 +28,7 @@
- #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
- #endif
- 
--#line 1 "cfns.gperf"
-+#line 3 "cfns.gperf"
- 
- /* Copyright (C) 2000-2015 Free Software Foundation, Inc.
- 
-@@ -47,26 +47,19 @@ for more details.
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3.  If not see
- <http://www.gnu.org/licenses/>.  */
--#ifdef __GNUC__
--__inline
--#endif
--static unsigned int hash (const char *, unsigned int);
--#ifdef __GNUC__
--__inline
--#endif
--const char * libc_name_p (const char *, unsigned int);
- /* maximum key range = 391, duplicates = 0 */
- 
--#ifdef __GNUC__
--__inline
--#else
--#ifdef __cplusplus
--inline
--#endif
--#endif
--static unsigned int
--hash (register const char *str, register unsigned int len)
-+class libc_name
- {
-+private:
-+  static inline unsigned int hash (const char *str, unsigned int len);
-+public:
-+  static const char *libc_name_p (const char *str, unsigned int len);
-+};
-+
-+inline unsigned int
-+libc_name::hash (register const char *str, register unsigned int len)
-+{
-   static const unsigned short asso_values[] =
-     {
-       400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
-@@ -122,14 +115,8 @@ along with GCC; see the file COPYING3.  If not see
-   return hval + asso_values[(unsigned char)str[len - 1]];
- }
- 
--#ifdef __GNUC__
--__inline
--#ifdef __GNUC_STDC_INLINE__
--__attribute__ ((__gnu_inline__))
--#endif
--#endif
- const char *
--libc_name_p (register const char *str, register unsigned int len)
-+libc_name::libc_name_p (register const char *str, register unsigned int len)
- {
-   enum
-     {
-Index: gcc/cp/except.c
-===================================================================
---- a/gcc/cp/except.c	(revision 233574)
-+++ b/gcc/cp/except.c	(working copy)
-@@ -1040,7 +1040,8 @@ nothrow_libfn_p (const_tree fn)
-      unless the system headers are playing rename tricks, and if
-      they are, we don't want to be confused by them.  */
-   id = DECL_NAME (fn);
--  return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
-+  return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id),
-+				   IDENTIFIER_LENGTH (id));
- }
- 
- /* Returns nonzero if an exception of type FROM will be caught by a
diff --git a/packages/gcc/glibc-2.31-libsanitizer-1-gcc-6.patch b/packages/gcc/glibc-2.31-libsanitizer-1-gcc-6.patch
deleted file mode 100644
index 4187b812..00000000
--- a/packages/gcc/glibc-2.31-libsanitizer-1-gcc-6.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From ce9568e9e9cf6094be30e748821421e703754ffc Mon Sep 17 00:00:00 2001
-From: Jakub Jelinek <jakub@redhat.com>
-Date: Fri, 8 Nov 2019 19:53:18 +0100
-Subject: [PATCH] backport: re PR sanitizer/92154 (new glibc breaks arm
- bootstrap due to libsanitizer)
-
-	Backported from mainline
-	2019-10-22  Tamar Christina  <tamar.christina@arm.com>
-	Backported for version 5.3.0 <= gcc <= 6.5.0
-	2020-06-05  John L. Jolly  <john.jolly@gmail.com>
-
-	PR sanitizer/92154
-	* sanitizer_common/sanitizer_platform_limits_posix.cc:
-	Cherry-pick compiler-rt revision r375220.
-
-From-SVN: r277981
----
- libsanitizer/ChangeLog                                   | 9 +++++++++
- .../sanitizer_common/sanitizer_platform_limits_posix.cc  | 6 +++++-
- 2 files changed, 14 insertions(+), 1 deletion(-)
-
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-index 6cd4a5bac8b0..06a605ff4670 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -1130,8 +1130,12 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
- #ifndef __GLIBC_PREREQ
- #define __GLIBC_PREREQ(x, y) 0
- #endif
--#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
-+#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \
-+    !defined(__arm__)
- /* On aarch64 glibc 2.20 and earlier provided incorrect mode field.  */
-+/* On Arm glibc 2.31 and later provide a different mode field, this field is
-+   never used by libsanitizer so we can simply ignore this assert for all glibc
-+   versions.  */
- CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
- #endif
- 
diff --git a/packages/gcc/glibc-2.31-libsanitizer-1.patch b/packages/gcc/glibc-2.31-libsanitizer-1.patch
deleted file mode 100644
index 96037707..00000000
--- a/packages/gcc/glibc-2.31-libsanitizer-1.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From ce9568e9e9cf6094be30e748821421e703754ffc Mon Sep 17 00:00:00 2001
-From: Jakub Jelinek <jakub@redhat.com>
-Date: Fri, 8 Nov 2019 19:53:18 +0100
-Subject: [PATCH] backport: re PR sanitizer/92154 (new glibc breaks arm
- bootstrap due to libsanitizer)
-
-	Backported from mainline
-	2019-10-22  Tamar Christina  <tamar.christina@arm.com>
-
-	PR sanitizer/92154
-	* sanitizer_common/sanitizer_platform_limits_posix.cc:
-	Cherry-pick compiler-rt revision r375220.
-
-From-SVN: r277981
----
- libsanitizer/ChangeLog                                   | 9 +++++++++
- .../sanitizer_common/sanitizer_platform_limits_posix.cc  | 6 +++++-
- 2 files changed, 14 insertions(+), 1 deletion(-)
-
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-index 6cd4a5bac8b0..06a605ff4670 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -1156,8 +1156,12 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
- CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
- CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
- CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
--#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
-+#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \
-+    !defined(__arm__)
- /* On aarch64 glibc 2.20 and earlier provided incorrect mode field.  */
-+/* On Arm glibc 2.31 and later provide a different mode field, this field is
-+   never used by libsanitizer so we can simply ignore this assert for all glibc
-+   versions.  */
- CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
- #endif
- 
diff --git a/packages/gcc/glibc-2.31-libsanitizer-2-gcc-6.patch b/packages/gcc/glibc-2.31-libsanitizer-2-gcc-6.patch
deleted file mode 100644
index 755db173..00000000
--- a/packages/gcc/glibc-2.31-libsanitizer-2-gcc-6.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 75003cdd23c310ec385344e8040d490e8dd6d2be Mon Sep 17 00:00:00 2001
-From: Jakub Jelinek <jakub@redhat.com>
-Date: Fri, 20 Dec 2019 17:58:35 +0100
-Subject: [PATCH] backport: re PR sanitizer/92154 (new glibc breaks arm
- bootstrap due to libsanitizer)
-
-	Backported from mainline
-	2019-11-26  Jakub Jelinek  <jakub@redhat.com>
-	Backported for version 5.3.0 <= gcc <= 6.5.0
-	2020-06-05  John L. Jolly  <john.jolly@gmail.com>
-
-	PR sanitizer/92154
-	* sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick
-	llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce.
-	* sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise.
-
-From-SVN: r279653
----
- libsanitizer/ChangeLog                            | 10 ++++++++++
- .../sanitizer_platform_limits_posix.cc            |  9 +++------
- .../sanitizer_platform_limits_posix.h             | 15 +--------------
- 3 files changed, 14 insertions(+), 20 deletions(-)
-
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-index 06a605ff4670..d823a12190c0 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -1130,12 +1130,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
- #ifndef __GLIBC_PREREQ
- #define __GLIBC_PREREQ(x, y) 0
- #endif
--#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \
--    !defined(__arm__)
--/* On aarch64 glibc 2.20 and earlier provided incorrect mode field.  */
--/* On Arm glibc 2.31 and later provide a different mode field, this field is
--   never used by libsanitizer so we can simply ignore this assert for all glibc
--   versions.  */
-+#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
-+/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
-+   on many architectures.  */
- CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
- #endif
- 
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-index 73af92af1e8f..6a673a7c9959 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-@@ -211,20 +211,13 @@ namespace __sanitizer {
-     unsigned long __unused1;
-     unsigned long __unused2;
- #elif defined(__sparc__)
--# if defined(__arch64__)
-     unsigned mode;
--    unsigned short __pad1;
--# else
--    unsigned short __pad1;
--    unsigned short mode;
-     unsigned short __pad2;
--# endif
-     unsigned short __seq;
-     unsigned long long __unused1;
-     unsigned long long __unused2;
- #else
--    unsigned short mode;
--    unsigned short __pad1;
-+    unsigned int mode;
-     unsigned short __seq;
-     unsigned short __pad2;
- #if defined(__x86_64__) && !defined(_LP64)
diff --git a/packages/gcc/glibc-2.31-libsanitizer-2-gcc-7.patch b/packages/gcc/glibc-2.31-libsanitizer-2-gcc-7.patch
deleted file mode 100644
index 07cbb3fd..00000000
--- a/packages/gcc/glibc-2.31-libsanitizer-2-gcc-7.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 75003cdd23c310ec385344e8040d490e8dd6d2be Mon Sep 17 00:00:00 2001
-From: Jakub Jelinek <jakub@redhat.com>
-Date: Fri, 20 Dec 2019 17:58:35 +0100
-Subject: [PATCH] backport: re PR sanitizer/92154 (new glibc breaks arm
- bootstrap due to libsanitizer)
-
-	Backported from mainline
-	2019-11-26  Jakub Jelinek  <jakub@redhat.com>
-	Backported for version 7.1.0 <= gcc <= 7.4.0
-	2020-06-05  John L. Jolly  <john.jolly@gmail.com>
-
-	PR sanitizer/92154
-	* sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick
-	llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce.
-	* sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise.
-
-From-SVN: r279653
----
- libsanitizer/ChangeLog                            | 10 ++++++++++
- .../sanitizer_platform_limits_posix.cc            |  9 +++------
- .../sanitizer_platform_limits_posix.h             | 15 +--------------
- 3 files changed, 14 insertions(+), 20 deletions(-)
-
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-index 06a605ff4670..d823a12190c0 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -1156,12 +1156,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
- CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
- CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
- CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
--#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \
--    !defined(__arm__)
--/* On aarch64 glibc 2.20 and earlier provided incorrect mode field.  */
--/* On Arm glibc 2.31 and later provide a different mode field, this field is
--   never used by libsanitizer so we can simply ignore this assert for all glibc
--   versions.  */
-+#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
-+/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
-+   on many architectures.  */
- CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
- #endif
- 
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-index 73af92af1e8f..6a673a7c9959 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-@@ -211,20 +211,13 @@ namespace __sanitizer {
-     unsigned long __unused1;
-     unsigned long __unused2;
- #elif defined(__sparc__)
--# if defined(__arch64__)
-     unsigned mode;
--    unsigned short __pad1;
--# else
--    unsigned short __pad1;
--    unsigned short mode;
-     unsigned short __pad2;
--# endif
-     unsigned short __seq;
-     unsigned long long __unused1;
-     unsigned long long __unused2;
- #else
--    unsigned short mode;
--    unsigned short __pad1;
-+    unsigned int mode;
-     unsigned short __seq;
-     unsigned short __pad2;
- #if defined(__x86_64__) && !defined(_LP64)
diff --git a/packages/gcc/glibc-2.31-libsanitizer-2.patch b/packages/gcc/glibc-2.31-libsanitizer-2.patch
deleted file mode 100644
index 75234436..00000000
--- a/packages/gcc/glibc-2.31-libsanitizer-2.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From 75003cdd23c310ec385344e8040d490e8dd6d2be Mon Sep 17 00:00:00 2001
-From: Jakub Jelinek <jakub@redhat.com>
-Date: Fri, 20 Dec 2019 17:58:35 +0100
-Subject: [PATCH] backport: re PR sanitizer/92154 (new glibc breaks arm
- bootstrap due to libsanitizer)
-
-	Backported from mainline
-	2019-11-26  Jakub Jelinek  <jakub@redhat.com>
-
-	PR sanitizer/92154
-	* sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick
-	llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce.
-	* sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise.
-
-From-SVN: r279653
----
- libsanitizer/ChangeLog                            | 10 ++++++++++
- .../sanitizer_platform_limits_posix.cc            |  9 +++------
- .../sanitizer_platform_limits_posix.h             | 15 +--------------
- 3 files changed, 14 insertions(+), 20 deletions(-)
-
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-index 06a605ff4670..d823a12190c0 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -1156,12 +1156,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid);
- CHECK_SIZE_AND_OFFSET(ipc_perm, gid);
- CHECK_SIZE_AND_OFFSET(ipc_perm, cuid);
- CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
--#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \
--    !defined(__arm__)
--/* On aarch64 glibc 2.20 and earlier provided incorrect mode field.  */
--/* On Arm glibc 2.31 and later provide a different mode field, this field is
--   never used by libsanitizer so we can simply ignore this assert for all glibc
--   versions.  */
-+#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31)
-+/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit
-+   on many architectures.  */
- CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
- #endif
- 
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-index 73af92af1e8f..6a673a7c9959 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-@@ -211,26 +211,13 @@ namespace __sanitizer {
-     u64 __unused1;
-     u64 __unused2;
- #elif defined(__sparc__)
--#if defined(__arch64__)
-     unsigned mode;
--    unsigned short __pad1;
--#else
--    unsigned short __pad1;
--    unsigned short mode;
-     unsigned short __pad2;
--#endif
-     unsigned short __seq;
-     unsigned long long __unused1;
-     unsigned long long __unused2;
--#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__)
--    unsigned int mode;
--    unsigned short __seq;
--    unsigned short __pad1;
--    unsigned long __unused1;
--    unsigned long __unused2;
- #else
--    unsigned short mode;
--    unsigned short __pad1;
-+    unsigned int mode;
-     unsigned short __seq;
-     unsigned short __pad2;
- #if defined(__x86_64__) && !defined(_LP64)
diff --git a/packages/gcc/glibc-2.31-libsanitizer-3-gcc-5.patch b/packages/gcc/glibc-2.31-libsanitizer-3-gcc-5.patch
deleted file mode 100644
index e1df265a..00000000
--- a/packages/gcc/glibc-2.31-libsanitizer-3-gcc-5.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-diff -ru a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
---- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc	2014-09-23 17:59:53.000000000 +0000
-+++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc	2021-10-30 19:48:38.690007561 +0000
-@@ -358,15 +358,6 @@
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
-   // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
--  _(CYGETDEFTHRESH, WRITE, sizeof(int));
--  _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
--  _(CYGETMON, WRITE, struct_cyclades_monitor_sz);
--  _(CYGETTHRESH, WRITE, sizeof(int));
--  _(CYGETTIMEOUT, WRITE, sizeof(int));
--  _(CYSETDEFTHRESH, NONE, 0);
--  _(CYSETDEFTIMEOUT, NONE, 0);
--  _(CYSETTHRESH, NONE, 0);
--  _(CYSETTIMEOUT, NONE, 0);
-   _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);
-   _(EQL_ENSLAVE, WRITE, struct_ifreq_sz);
-   _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);
-diff -ru a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc	2021-10-30 19:40:51.805824323 +0000
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc	2021-10-30 19:51:13.640403192 +0000
-@@ -143,7 +143,6 @@
- #include <sys/statvfs.h>
- #include <sys/timex.h>
- #include <sys/user.h>
--#include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
- #include <linux/lp.h>
-@@ -392,7 +391,6 @@
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
-   unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
--  unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
- #if EV_VERSION > (0x010000)
-   unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);
- #else
-@@ -759,15 +757,6 @@
- #endif  // SANITIZER_LINUX || SANITIZER_FREEBSD
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--  unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
--  unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
--  unsigned IOCTL_CYGETMON = CYGETMON;
--  unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
--  unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
--  unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
--  unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
--  unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
--  unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;
-   unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;
-   unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;
-   unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;
-diff -ru a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h	2021-10-30 19:40:51.698824053 +0000
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h	2021-10-30 19:51:39.680469814 +0000
-@@ -875,7 +875,6 @@
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
-   extern unsigned struct_ax25_parms_struct_sz;
--  extern unsigned struct_cyclades_monitor_sz;
-   extern unsigned struct_input_keymap_entry_sz;
-   extern unsigned struct_ipx_config_data_sz;
-   extern unsigned struct_kbdiacrs_sz;
-@@ -1220,15 +1219,6 @@
- #endif  // SANITIZER_LINUX || SANITIZER_FREEBSD
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--  extern unsigned IOCTL_CYGETDEFTHRESH;
--  extern unsigned IOCTL_CYGETDEFTIMEOUT;
--  extern unsigned IOCTL_CYGETMON;
--  extern unsigned IOCTL_CYGETTHRESH;
--  extern unsigned IOCTL_CYGETTIMEOUT;
--  extern unsigned IOCTL_CYSETDEFTHRESH;
--  extern unsigned IOCTL_CYSETDEFTIMEOUT;
--  extern unsigned IOCTL_CYSETTHRESH;
--  extern unsigned IOCTL_CYSETTIMEOUT;
-   extern unsigned IOCTL_EQL_EMANCIPATE;
-   extern unsigned IOCTL_EQL_ENSLAVE;
-   extern unsigned IOCTL_EQL_GETMASTRCFG;
diff --git a/packages/gcc/glibc-2.36-libsanitizer-gcc-10-12.patch b/packages/gcc/glibc-2.36-libsanitizer-gcc-10-12.patch
deleted file mode 100644
index 90df6b04..00000000
--- a/packages/gcc/glibc-2.36-libsanitizer-gcc-10-12.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
-index badf6a401cc..b43733033a6 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
-@@ -72,7 +72,6 @@
- #include <sys/vt.h>
- #include <linux/cdrom.h>
- #include <linux/fd.h>
--#include <linux/fs.h>
- #include <linux/hdreg.h>
- #include <linux/input.h>
- #include <linux/ioctl.h>
-@@ -822,10 +821,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
-   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
-   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
- #endif
--  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
--  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
--  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
--  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
-+  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
-+  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
-+  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
-+  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
-   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
-   unsigned IOCTL_GIO_FONT = GIO_FONT;
-   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/packages/gcc/glibc-2.36-libsanitizer-gcc-5-9.patch b/packages/gcc/glibc-2.36-libsanitizer-gcc-5-9.patch
deleted file mode 100644
index 2cd2bc4e..00000000
--- a/packages/gcc/glibc-2.36-libsanitizer-gcc-5-9.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-index e8fce8a02..5122baa46 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -65,7 +65,6 @@
- #include <sys/vt.h>
- #include <linux/cdrom.h>
- #include <linux/fd.h>
--#include <linux/fs.h>
- #include <linux/hdreg.h>
- #include <linux/input.h>
- #include <linux/ioctl.h>
-@@ -846,10 +845,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
-   unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT;
-   unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT;
- #endif
--  unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
--  unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
--  unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
--  unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
-+  unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long);
-+  unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long);
-+  unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long);
-+  unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long);
-   unsigned IOCTL_GIO_CMAP = GIO_CMAP;
-   unsigned IOCTL_GIO_FONT = GIO_FONT;
-   unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;
diff --git a/packages/gcc/package.py b/packages/gcc/package.py
deleted file mode 100644
index 4eb88a25..00000000
--- a/packages/gcc/package.py
+++ /dev/null
@@ -1,1114 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-import glob
-import itertools
-import os
-import re
-import sys
-
-from archspec.cpu import UnsupportedMicroarchitecture
-
-import llnl.util.tty as tty
-from llnl.util.lang import classproperty
-
-import spack.platforms
-import spack.util.executable
-from spack.build_environment import dso_suffix
-from spack.operating_systems.mac_os import macos_sdk_path, macos_version
-from spack.package import *
-
-
-class Gcc(AutotoolsPackage, GNUMirrorPackage):
-    """The GNU Compiler Collection includes front ends for C, C++, Objective-C,
-    Fortran, Ada, and Go, as well as libraries for these languages."""
-
-    homepage = "https://gcc.gnu.org"
-    gnu_mirror_path = "gcc/gcc-9.2.0/gcc-9.2.0.tar.xz"
-    git = "git://gcc.gnu.org/git/gcc.git"
-    list_url = "https://ftp.gnu.org/gnu/gcc/"
-    list_depth = 1
-    keep_werror = "all"
-
-    maintainers("michaelkuhn", "alalazo")
-
-    version("master", branch="master")
-
-    version("13.2.0", sha256="e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da")
-    version("13.1.0", sha256="61d684f0aa5e76ac6585ad8898a2427aade8979ed5e7f85492286c4dfc13ee86")
-
-    version("12.3.0", sha256="949a5d4f99e786421a93b532b22ffab5578de7321369975b91aec97adfda8c3b")
-    version("12.2.0", sha256="e549cf9cf3594a00e27b6589d4322d70e0720cdd213f39beb4181e06926230ff")
-    version("12.1.0", sha256="62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b")
-
-    version("11.4.0", sha256="3f2db222b007e8a4a23cd5ba56726ef08e8b1f1eb2055ee72c1402cea73a8dd9")
-    version("11.3.0", sha256="b47cf2818691f5b1e21df2bb38c795fac2cfbd640ede2d0a5e1c89e338a3ac39")
-    version("11.2.0", sha256="d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b")
-    version("11.1.0", sha256="4c4a6fb8a8396059241c2e674b85b351c26a5d678274007f076957afa1cc9ddf")
-
-    version("10.5.0", sha256="25109543fdf46f397c347b5d8b7a2c7e5694a5a51cce4b9c6e1ea8a71ca307c1")
-    version("10.4.0", sha256="c9297d5bcd7cb43f3dfc2fed5389e948c9312fd962ef6a4ce455cff963ebe4f1")
-    version("10.3.0", sha256="64f404c1a650f27fc33da242e1f2df54952e3963a49e06e73f6940f3223ac344")
-    version("10.2.0", sha256="b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c")
-    version("10.1.0", sha256="b6898a23844b656f1b68691c5c012036c2e694ac4b53a8918d4712ad876e7ea2")
-
-    version("9.5.0", sha256="27769f64ef1d4cd5e2be8682c0c93f9887983e6cfd1a927ce5a0a2915a95cf8f")
-    version("9.4.0", sha256="c95da32f440378d7751dd95533186f7fc05ceb4fb65eb5b85234e6299eb9838e")
-    version("9.3.0", sha256="71e197867611f6054aa1119b13a0c0abac12834765fe2d81f35ac57f84f742d1")
-    version("9.2.0", sha256="ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206")
-    version("9.1.0", sha256="79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0")
-
-    version("8.5.0", sha256="d308841a511bb830a6100397b0042db24ce11f642dab6ea6ee44842e5325ed50")
-    version("8.4.0", sha256="e30a6e52d10e1f27ed55104ad233c30bd1e99cfb5ff98ab022dc941edd1b2dd4")
-    version("8.3.0", sha256="64baadfe6cc0f4947a84cb12d7f0dfaf45bb58b7e92461639596c21e02d97d2c")
-    version("8.2.0", sha256="196c3c04ba2613f893283977e6011b2345d1cd1af9abeac58e916b1aab3e0080")
-    version("8.1.0", sha256="1d1866f992626e61349a1ccd0b8d5253816222cdc13390dcfaa74b093aa2b153")
-
-    version("7.5.0", sha256="b81946e7f01f90528a1f7352ab08cc602b9ccc05d4e44da4bd501c5a189ee661")
-    version("7.4.0", sha256="eddde28d04f334aec1604456e536416549e9b1aa137fc69204e65eb0c009fe51")
-    version("7.3.0", sha256="832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c")
-    version("7.2.0", sha256="1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a")
-    version("7.1.0", sha256="8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17")
-
-    version("6.5.0", sha256="7ef1796ce497e89479183702635b14bb7a46b53249209a5e0f999bebf4740945")
-    version("6.4.0", sha256="850bf21eafdfe5cd5f6827148184c08c4a0852a37ccf36ce69855334d2c914d4")
-    version("6.3.0", sha256="f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f")
-    version("6.2.0", sha256="9944589fc722d3e66308c0ce5257788ebd7872982a718aa2516123940671b7c5")
-    version("6.1.0", sha256="09c4c85cabebb971b1de732a0219609f93fc0af5f86f6e437fd8d7f832f1a351")
-
-    version("5.5.0", sha256="530cea139d82fe542b358961130c69cfde8b3d14556370b65823d2f91f0ced87")
-    version("5.4.0", sha256="608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a")
-    version("5.3.0", sha256="b84f5592e9218b73dbae612b5253035a7b34a9a1f7688d2e1bfaaf7267d5c4db")
-    version("5.2.0", sha256="5f835b04b5f7dd4f4d2dc96190ec1621b8d89f2dc6f638f9f8bc1b1014ba8cad")
-    version("5.1.0", sha256="b7dafdf89cbb0e20333dbf5b5349319ae06e3d1a30bf3515b5488f7e89dca5ad")
-
-    version("4.9.4", sha256="6c11d292cd01b294f9f84c9a59c230d80e9e4a47e5c6355f046bb36d4f358092")
-    version("4.9.3", sha256="2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e")
-    version("4.9.2", sha256="2020c98295856aa13fda0f2f3a4794490757fc24bcca918d52cc8b4917b972dd")
-    version("4.9.1", sha256="d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e")
-    version("4.8.5", sha256="22fb1e7e0f68a63cee631d85b20461d1ea6bda162f03096350e38c8d427ecf23")
-    version("4.8.4", sha256="4a80aa23798b8e9b5793494b8c976b39b8d9aa2e53cd5ed5534aff662a7f8695")
-    version("4.7.4", sha256="92e61c6dc3a0a449e62d72a38185fda550168a86702dea07125ebd3ec3996282")
-    version("4.6.4", sha256="35af16afa0b67af9b8eb15cafb76d2bc5f568540552522f5dc2c88dd45d977e8")
-    version("4.5.4", sha256="eef3f0456db8c3d992cbb51d5d32558190bc14f3bc19383dd93acc27acc6befc")
-
-    # We specifically do not add 'all' variant here because:
-    # (i) Ada, D, Go, Jit, and Objective-C++ are not default languages.
-    # In that respect, the name 'all' is rather misleading.
-    # (ii) Languages other than c,c++,fortran are prone to configure bug in GCC
-    # For example, 'java' appears to ignore custom location of zlib
-    # (iii) meaning of 'all' changes with GCC version, i.e. 'java' is not part
-    # of gcc7. Correctly specifying conflicts() and depends_on() in such a
-    # case is a PITA.
-    #
-    # Also note that some languages get enabled by the configure scripts even if not listed in the
-    # arguments. For example, c++ is enabled when the bootstrapping is enabled and lto is enabled
-    # when the link time optimization support is enabled.
-    variant(
-        "languages",
-        default="c,c++,fortran",
-        values=(
-            "ada",
-            "brig",
-            "c",
-            "c++",
-            "d",
-            "fortran",
-            "go",
-            "java",
-            "jit",
-            "lto",
-            "objc",
-            "obj-c++",
-        ),
-        multi=True,
-        description="Compilers and runtime libraries to build",
-    )
-    variant("binutils", default=False, description="Build via binutils")
-    variant(
-        "piclibs", default=False, description="Build PIC versions of libgfortran.a and libstdc++.a"
-    )
-    variant("strip", default=False, description="Strip executables to reduce installation size")
-    variant("nvptx", default=False, description="Target nvptx offloading to NVIDIA GPUs")
-    variant("bootstrap", default=True, description="Enable 3-stage bootstrap")
-    variant(
-        "graphite", default=False, description="Enable Graphite loop optimizations (requires ISL)"
-    )
-    variant(
-        "build_type",
-        default="RelWithDebInfo",
-        values=("Debug", "Release", "RelWithDebInfo", "MinSizeRel"),
-        description="CMake-like build type. "
-        "Debug: -O0 -g; Release: -O3; "
-        "RelWithDebInfo: -O2 -g; MinSizeRel: -Os",
-    )
-    variant(
-        "profiled",
-        default=False,
-        description="Use Profile Guided Optimization",
-        when="+bootstrap %gcc",
-    )
-
-    depends_on("flex", type="build", when="@master")
-
-    # https://gcc.gnu.org/install/prerequisites.html
-    depends_on("gmp@4.3.2:")
-    # mawk is not sufficient for go support
-    depends_on("gawk@3.1.5:", type="build")
-    depends_on("texinfo@4.7:", type="build")
-    depends_on("libtool", type="build")
-    # dependencies required for git versions
-    depends_on("m4@1.4.6:", when="@master", type="build")
-    depends_on("automake@1.15.1:", when="@master", type="build")
-    depends_on("autoconf@2.69:", when="@master", type="build")
-
-    depends_on("gmake@3.80:", type="build")
-    depends_on("perl@5", type="build")
-
-    # GCC 7.3 does not compile with newer releases on some platforms, see
-    #   https://github.com/spack/spack/issues/6902#issuecomment-433030376
-    depends_on("mpfr@2.4.2:3.1.6", when="@:9.9")
-    depends_on("mpfr@3.1.0:", when="@10:")
-    depends_on("mpc@1.0.1:", when="@4.5:")
-    # Already released GCC versions do not support any newer version of ISL
-    #   GCC 5.4 https://github.com/spack/spack/issues/6902#issuecomment-433072097
-    #   GCC 7.3 https://github.com/spack/spack/issues/6902#issuecomment-433030376
-    #   GCC 9+  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86724
-    with when("+graphite"):
-        depends_on("isl@0.14", when="@5.0:5.2")
-        depends_on("isl@0.15", when="@5.3:5.9")
-        depends_on("isl@0.15:0.18", when="@6:8.9")
-        depends_on("isl@0.15:0.20", when="@9:9.9")
-        depends_on("isl@0.15:", when="@10:")
-
-    depends_on("zlib-api", when="@6:")
-    depends_on("zstd", when="@10:")
-    depends_on("diffutils", type="build")
-    depends_on("iconv", when="platform=darwin")
-    depends_on("gnat", when="languages=ada")
-    depends_on(
-        "binutils+gas+ld+plugins~libiberty", when="+binutils", type=("build", "link", "run")
-    )
-    depends_on("zip", type="build", when="languages=java")
-
-    # The server is sometimes a bit slow to respond
-    timeout = {"timeout": 60}
-
-    # TODO: integrate these libraries.
-    # depends_on('ppl')
-    # depends_on('cloog')
-
-    # https://gcc.gnu.org/install/test.html
-    depends_on("dejagnu@1.4.4", type="test")
-    depends_on("expect", type="test")
-    depends_on("tcl", type="test")
-    depends_on("autogen@5.5.4:", type="test")
-    depends_on("guile@1.4.1:", type="test")
-
-    # See https://go.dev/doc/install/gccgo#Releases
-    with when("languages=go"):
-        provides("go-or-gccgo-bootstrap@:1.0", when="@4.7.1:")
-        provides("go-or-gccgo-bootstrap@:1.2", when="@4.9:")
-        provides("go-or-gccgo-bootstrap@:1.4", when="@5:")
-        provides("go-or-gccgo-bootstrap@:1.6.1", when="@6:")
-        provides("go-or-gccgo-bootstrap@:1.8.1", when="@7:")
-        provides("go-or-gccgo-bootstrap@:1.10.1", when="@8:")
-        provides("go-or-gccgo-bootstrap@:1.12.2", when="@9:")
-        provides("go-or-gccgo-bootstrap@:1.14.6", when="@10:")
-        provides("go-or-gccgo-bootstrap@1.16.3:1.16.5", when="@11:")
-
-        provides("golang@:1.0", when="@4.7.1:")
-        provides("golang@:1.2", when="@4.9:")
-        provides("golang@:1.4", when="@5:")
-        provides("golang@:1.6.1", when="@6:")
-        provides("golang@:1.8.1", when="@7:")
-        provides("golang@:1.10.1", when="@8:")
-        provides("golang@:1.12.2", when="@9:")
-        provides("golang@:1.14.6", when="@10:")
-        provides("golang@1.16.3:1.16.5", when="@11:")
-
-        # GCC 4.7.1 added full support for the Go 1.x programming language.
-        conflicts("@:4.7.0")
-
-        # Go is not supported on macOS
-        conflicts("platform=darwin", msg="GCC cannot build Go support on MacOS")
-
-    # For a list of valid languages for a specific release,
-    # run the following command in the GCC source directory:
-    #    $ grep ^language= gcc/*/config-lang.in
-    # See https://gcc.gnu.org/install/configure.html
-
-    # Support for processing BRIG 1.0 files was added in GCC 7
-    # BRIG is a binary format for HSAIL:
-    # (Heterogeneous System Architecture Intermediate Language).
-    # See https://gcc.gnu.org/gcc-7/changes.html
-    conflicts("languages=brig", when="@:6")
-
-    # BRIG does not seem to be supported on macOS
-    conflicts("languages=brig", when="platform=darwin")
-
-    # GCC 4.8 added a 'c' language. I'm sure C was always built,
-    # but this is the first version that accepts 'c' as a valid language.
-    conflicts("languages=c", when="@:4.7")
-
-    # The GCC Java frontend and associated libjava runtime library
-    # have been removed from GCC as of GCC 7.
-    # See https://gcc.gnu.org/gcc-7/changes.html
-    conflicts("languages=java", when="@7:")
-
-    # GCC 5 added the ability to build GCC as a Just-In-Time compiler.
-    # See https://gcc.gnu.org/gcc-5/changes.html
-    conflicts("languages=jit", when="@:4")
-
-    with when("languages=d"):
-        # The very first version of GDC that became part of GCC already supported version 2.076 of
-        # the language and runtime.
-        # See https://wiki.dlang.org/GDC#Status
-        provides("D@2")
-
-        # Support for the D programming language has been added to GCC 9.
-        # See https://gcc.gnu.org/gcc-9/changes.html#d
-        conflicts("@:8", msg="support for D has been added in GCC 9.1")
-
-        # Versions of GDC prior to 12 can be built with an ISO C++11 compiler. Starting version 12,
-        # the D frontend requires a working GDC. Moreover, it is strongly recommended to use an
-        # older version of GDC to build GDC.
-        # See https://gcc.gnu.org/install/prerequisites.html#GDC-prerequisite
-        with when("@12:"):
-            # All versions starting 12 have to be built GCC:
-            requires("%gcc")
-
-            # And it has to be GCC older than the version we build:
-            vv = ["11", "12.1.0", "12.2.0"]
-            for prev_v, curr_v in zip(vv, vv[1:]):
-                conflicts(
-                    "%gcc@{0}:".format(curr_v),
-                    when="@{0}".format(curr_v),
-                    msg="'gcc@{0} languages=d' requires '%gcc@:{1}' "
-                    "with the D language support".format(curr_v, prev_v),
-                )
-
-            # In principle, it is possible to have GDC even with GCC 5.
-            # See https://github.com/D-Programming-GDC/gdc
-            # We, however, require at least the oldest version that officially supports GDC. It is
-            # also a good opportunity to tell the users that they need a working GDC:
-            conflicts(
-                "%gcc@:8",
-                msg="'gcc@12: languages=d' requires '%gcc@9:' with the D language support",
-            )
-
-    with when("+nvptx"):
-        depends_on("cuda")
-        resource(
-            name="newlib",
-            url="ftp://sourceware.org/pub/newlib/newlib-3.0.0.20180831.tar.gz",
-            sha256="3ad3664f227357df15ff34e954bfd9f501009a647667cd307bf0658aefd6eb5b",
-            destination="newlibsource",
-            fetch_options=timeout,
-        )
-        # nvptx-tools does not seem to work as a dependency,
-        # but does fine when the source is inside the gcc build directory
-        # nvptx-tools doesn't have any releases, so grabbing the last commit
-        resource(
-            name="nvptx-tools",
-            git="https://github.com/MentorEmbedded/nvptx-tools",
-            commit="d0524fbdc86dfca068db5a21cc78ac255b335be5",
-        )
-        # NVPTX offloading supported in 7 and later by limited languages
-        conflicts("@:6", msg="NVPTX only supported in gcc 7 and above")
-        conflicts("languages=ada")
-        conflicts("languages=brig")
-        conflicts("languages=go")
-        conflicts("languages=java")
-        conflicts("languages=jit")
-        conflicts("languages=objc")
-        conflicts("languages=obj-c++")
-        conflicts("languages=d")
-        # NVPTX build disables bootstrap
-        conflicts("+bootstrap")
-
-    # Binutils can't build ld on macOS
-    conflicts("+binutils", when="platform=darwin")
-
-    # Bootstrap comparison failure:
-    #   see https://github.com/spack/spack/issues/23296
-    #   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100340
-    #   on XCode 12.5
-    conflicts("+bootstrap", when="@:11.1 %apple-clang@12.0.5")
-
-    # aarch64/M1 is supported in GCC 11.3-12.2 and 13
-    requires(
-        "@11.3,12.2,13.1:",
-        when="target=aarch64: platform=darwin",
-        msg="Only GCC 11.3-12.2, 13.1+ support macOS M1 (aarch64)",
-    )
-
-    # Newer binutils than RHEL's is required to run `as` on some instructions
-    # generated by new GCC (see https://github.com/spack/spack/issues/12235)
-    conflicts("~binutils", when="@7: os=rhel6", msg="New GCC cannot use system assembler on RHEL6")
-    # Ditto for RHEL7/8: OpenBLAS uses flags which the RHEL system-binutils don't have:
-    # https://github.com/xianyi/OpenBLAS/issues/3805#issuecomment-1319878852
-    conflicts(
-        "~binutils", when="@10: os=rhel7", msg="gcc: Add +binutils - preinstalled as might be old"
-    )
-    conflicts(
-        "~binutils", when="@10: os=rhel8", msg="gcc: Add +binutils - preinstalled as might be old"
-    )
-
-    # GCC 11 requires GCC 4.8 or later (https://gcc.gnu.org/gcc-11/changes.html)
-    conflicts("%gcc@:4.7", when="@11:")
-
-    # https://github.com/iains/gcc-12-branch/issues/6
-    conflicts("@:12", when="%apple-clang@14:14.0")
-
-    if sys.platform == "darwin":
-        # Fix parallel build on APFS filesystem
-        # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81797
-        if macos_version() >= Version("10.13"):
-            patch("darwin/apfs.patch", when="@5.5.0,6.1:6.4,7.1:7.3")
-            # from homebrew via macports
-            # https://trac.macports.org/ticket/56502#no1
-            # see also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83531
-            patch("darwin/headers-10.13-fix.patch", when="@5.5.0")
-        if macos_version() >= Version("10.14"):
-            # Fix system headers for Mojave SDK:
-            # https://github.com/Homebrew/homebrew-core/pull/39041
-            patch(
-                "https://raw.githubusercontent.com/Homebrew/formula-patches/b8b8e65e/gcc/8.3.0-xcode-bug-_Atomic-fix.patch",
-                sha256="33ee92bf678586357ee8ab9d2faddf807e671ad37b97afdd102d5d153d03ca84",
-                when="@6:8.3",
-            )
-        if macos_version() >= Version("10.15"):
-            # Fix system headers for Catalina SDK
-            # (otherwise __OSX_AVAILABLE_STARTING ends up undefined)
-            patch(
-                "https://raw.githubusercontent.com/Homebrew/formula-patches/b8b8e65e/gcc/9.2.0-catalina.patch",
-                sha256="0b8d14a7f3c6a2f0d2498526e86e088926671b5da50a554ffa6b7f73ac4f132b",
-                when="@9.2.0",
-            )
-
-            # See https://raw.githubusercontent.com/Homebrew/homebrew-core/3b7db4457ac64a31e3bbffc54b04c4bd824a4a4a/Formula/gcc.rb
-            patch(
-                "https://github.com/iains/gcc-darwin-arm64/commit/20f61faaed3b335d792e38892d826054d2ac9f15.patch?full_index=1",
-                sha256="c0605179a856ca046d093c13cea4d2e024809ec2ad4bf3708543fc3d2e60504b",
-                when="@11.2.0",
-            )
-
-        # Apple M1 support, created from branch of Darwin maintainer for GCC:
-        # https://github.com/iains/gcc-11-branch
-        patch(
-            "https://raw.githubusercontent.com/Homebrew/formula-patches/22dec3fc/gcc/gcc-11.3.0-arm.diff",
-            sha256="e02006b7ec917cc1390645d95735a6a866caed0dfe506d5bef742f7862cab218",
-            when="@11.3.0 target=aarch64:",
-        )
-        # https://github.com/iains/gcc-12-branch
-        patch(
-            "https://raw.githubusercontent.com/Homebrew/formula-patches/76677f2b/gcc/gcc-12.1.0-arm.diff",
-            sha256="a000f1d9cb1dd98c7c4ef00df31435cd5d712d2f9d037ddc044f8bf82a16cf35",
-            when="@12.1.0 target=aarch64:",
-        )
-        patch(
-            "https://raw.githubusercontent.com/Homebrew/formula-patches/1d184289/gcc/gcc-12.2.0-arm.diff",
-            sha256="a7843b5c6bf1401e40c20c72af69c8f6fc9754ae980bb4a5f0540220b3dcb62d",
-            when="@12.2.0 target=aarch64:",
-        )
-        patch(
-            "https://raw.githubusercontent.com/Homebrew/formula-patches/5c206c47/gcc/gcc-13.1.0.diff",
-            sha256="cb4e8a89387f748a744da0273025d0dc2e3c76780cc390b18ada704676afea11",
-            when="@13.1.0 target=aarch64:",
-        )
-        patch(
-            "https://raw.githubusercontent.com/Homebrew/formula-patches/3c5cbc8e9cf444a1967786af48e430588e1eb481/gcc/gcc-13.2.0.diff",
-            sha256="2df7ef067871a30b2531a2013b3db661ec9e61037341977bfc451e30bf2c1035",
-            when="@13.2.0 target=aarch64:",
-        )
-        conflicts("+bootstrap", when="@11.3.0,13.1: target=aarch64:")
-
-        # Use -headerpad_max_install_names in the build,
-        # otherwise updated load commands won't fit in the Mach-O header.
-        # This is needed because `gcc` avoids the superenv shim.
-        patch("darwin/gcc-7.1.0-headerpad.patch", when="@5:11.2")
-        patch("darwin/gcc-6.1.0-jit.patch", when="@5:7")
-        patch("darwin/gcc-4.9.patch1", when="@4.9.0:4.9.3")
-        patch("darwin/gcc-4.9.patch2", when="@4.9.0:4.9.3")
-
-        # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92061
-        patch("darwin/clang13.patch", when="@:11.1 %apple-clang@13")
-
-    patch("piclibs.patch", when="+piclibs")
-    patch("gcc-backport.patch", when="@4.7:4.9.3,5:5.3")
-
-    # Backport libsanitizer patch for glibc >= 2.31 and 5.3.0 <= gcc <= 9.2.0
-    # https://bugs.gentoo.org/708346
-    patch("glibc-2.31-libsanitizer-1.patch", when="@7.1.0:7.5.0,8.1.0:8.3.0,9.0.0:9.2.0")
-    patch("glibc-2.31-libsanitizer-1-gcc-6.patch", when="@5.3.0:5.5.0,6.1.0:6.5.0")
-    patch("glibc-2.31-libsanitizer-2.patch", when="@8.1.0:8.3.0,9.0.0:9.2.0")
-    patch("glibc-2.31-libsanitizer-2-gcc-6.patch", when="@5.3.0:5.5.0,6.1.0:6.5.0")
-    patch("glibc-2.31-libsanitizer-2-gcc-7.patch", when="@7.1.0:7.5.0")
-    patch(
-        "patch-2b40941d23b1570cdd90083b58fa0f66aa58c86e.patch",
-        when="@6.5.0,7.4.0:7.5.0,8.2.0:9.3.0",
-    )
-    patch("patch-745dae5923aba02982563481d75a21595df22ff8.patch", when="@10.1.0:10.3.0,11.1.0")
-
-    # Backport libsanitizer patch for glibc >= 2.36
-    # https://reviews.llvm.org/D129471
-    patch("glibc-2.36-libsanitizer-gcc-5-9.patch", when="@5.1:5.5,6.1:6.5,7.1:7.5,8.1:8.5,9.1:9.5")
-    patch("glibc-2.36-libsanitizer-gcc-10-12.patch", when="@10.1:10.4,11.1:11.3,12.1.0")
-
-    # Older versions do not compile with newer versions of glibc
-    # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81712
-    patch("ucontext_t.patch", when="@4.9,5.1:5.4,6.1:6.4,7.1")
-    patch("ucontext_t-java.patch", when="@4.9,5.1:5.4,6.1:6.4 languages=java")
-    # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81066
-    patch("stack_t-4.9.patch", when="@4.9")
-    patch("stack_t.patch", when="@5.1:5.4,6.1:6.4,7.1")
-    # https://bugs.busybox.net/show_bug.cgi?id=10061
-    patch("signal.patch", when="@4.9,5.1:5.4")
-    # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85835
-    patch("sys_ustat.h.patch", when="@5.0:6.4,7.0:7.3,8.1")
-    patch("sys_ustat-4.9.patch", when="@4.9")
-
-    # this patch removes cylades support from gcc-5 and allows gcc-5 to be built
-    # with newer glibc versions.
-    patch("glibc-2.31-libsanitizer-3-gcc-5.patch", when="@5.3.0:5.5.0")
-
-    # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95005
-    patch("zstd.patch", when="@10")
-
-    # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100102
-    patch("patch-fc930b3010bd0de899a3da3209eab20664ddb703.patch", when="@10.1:10.3")
-    patch("patch-f1feb74046e0feb0596b93bbb822fae02940a90e.patch", when="@11.1")
-
-    # libstdc++: Fix inconsistent noexcept-specific for valarray begin/end
-    # begin EBRAINS (modified)
-    patch(
-        "https://github.com/gcc-mirror/gcc/commit/423cd47cfc9640ba3d6811b780e8a0b94b704dcb.patch?full_index=1",
-        sha256="0d136226eb07bc43f1b15284f48bd252e3748a0426b5d7ac9084ebc406e15490",
-        when="@9.5.0,10.4.0",
-    )
-    # end EBRAINS
-
-    build_directory = "spack-build"
-
-    @classproperty
-    def executables(cls):
-        names = [r"gcc", r"[^\w]?g\+\+", r"gfortran", r"gdc", r"gccgo"]
-        suffixes = [r"", r"-mp-\d+\.\d", r"-\d+\.\d", r"-\d+", r"\d\d"]
-        return [r"".join(x) for x in itertools.product(names, suffixes)]
-
-    @classmethod
-    def filter_detected_exes(cls, prefix, exes_in_prefix):
-        result = []
-        for exe in exes_in_prefix:
-            # On systems like Ubuntu we might get multiple executables
-            # with the string "gcc" in them. See:
-            # https://helpmanual.io/packages/apt/gcc/
-            basename = os.path.basename(exe)
-            substring_to_be_filtered = [
-                "c99-gcc",
-                "c89-gcc",
-                "-nm",
-                "-ar",
-                "ranlib",
-                "clang",  # clang++ matches g++ -> clan[g++]
-            ]
-            if any(x in basename for x in substring_to_be_filtered):
-                continue
-            # Filter out links in favor of real executables on
-            # all systems but Cray
-            host_platform = str(spack.platforms.host())
-            if os.path.islink(exe) and host_platform != "cray":
-                continue
-
-            result.append(exe)
-
-        return result
-
-    @classmethod
-    def determine_version(cls, exe):
-        try:
-            output = spack.compiler.get_compiler_version_output(exe, "--version")
-        except Exception:
-            output = ""
-        # Apple's gcc is actually apple clang, so skip it.
-        # Users can add it manually to compilers.yaml at their own risk.
-        if "Apple" in output:
-            return None
-
-        version_regex = re.compile(r"([\d\.]+)")
-        for vargs in ("-dumpfullversion", "-dumpversion"):
-            try:
-                output = spack.compiler.get_compiler_version_output(exe, vargs)
-                match = version_regex.search(output)
-                if match:
-                    return match.group(1)
-            except spack.util.executable.ProcessError:
-                pass
-            except Exception as e:
-                tty.debug(e)
-
-        return None
-
-    @classmethod
-    def determine_variants(cls, exes, version_str):
-        languages, compilers = set(), {}
-        # There are often at least two copies (not symlinks) of each compiler executable in the
-        # same directory: one with a canonical name, e.g. "gfortran", and another one with the
-        # target prefix, e.g. "x86_64-pc-linux-gnu-gfortran". There also might be a copy of "gcc"
-        # with the version suffix, e.g. "x86_64-pc-linux-gnu-gcc-6.3.0". To ensure the consistency
-        # of values in the "compilers" dictionary (i.e. we prefer all of them to reference copies
-        # with canonical names if possible), we iterate over the executables in the reversed sorted
-        # order:
-        for exe in sorted(exes, reverse=True):
-            basename = os.path.basename(exe)
-            if "g++" in basename:
-                languages.add("c++")
-                compilers["cxx"] = exe
-            elif "gfortran" in basename:
-                languages.add("fortran")
-                compilers["fortran"] = exe
-            elif "gcc" in basename:
-                languages.add("c")
-                compilers["c"] = exe
-            elif "gccgo" in basename:
-                languages.add("go")
-                compilers["go"] = exe
-            elif "gdc" in basename:
-                languages.add("d")
-                compilers["d"] = exe
-        variant_str = "languages={0}".format(",".join(languages))
-        return variant_str, {"compilers": compilers}
-
-    @classmethod
-    def validate_detected_spec(cls, spec, extra_attributes):
-        # For GCC 'compilers' is a mandatory attribute
-        msg = 'the extra attribute "compilers" must be set for ' 'the detected spec "{0}"'.format(
-            spec
-        )
-        assert "compilers" in extra_attributes, msg
-
-        compilers = extra_attributes["compilers"]
-        for constraint, key in {
-            "languages=c": "c",
-            "languages=c++": "cxx",
-            "languages=d": "d",
-            "languages=fortran": "fortran",
-        }.items():
-            if spec.satisfies(constraint):
-                msg = "{0} not in {1}"
-                assert key in compilers, msg.format(key, spec)
-
-    @property
-    def cc(self):
-        msg = "cannot retrieve C compiler [spec is not concrete]"
-        assert self.spec.concrete, msg
-        if self.spec.external:
-            return self.spec.extra_attributes["compilers"].get("c", None)
-        result = None
-        if "languages=c" in self.spec:
-            result = str(self.spec.prefix.bin.gcc)
-        return result
-
-    @property
-    def cxx(self):
-        msg = "cannot retrieve C++ compiler [spec is not concrete]"
-        assert self.spec.concrete, msg
-        if self.spec.external:
-            return self.spec.extra_attributes["compilers"].get("cxx", None)
-        result = None
-        if "languages=c++" in self.spec:
-            result = os.path.join(self.spec.prefix.bin, "g++")
-        return result
-
-    @property
-    def fortran(self):
-        msg = "cannot retrieve Fortran compiler [spec is not concrete]"
-        assert self.spec.concrete, msg
-        if self.spec.external:
-            return self.spec.extra_attributes["compilers"].get("fortran", None)
-        result = None
-        if "languages=fortran" in self.spec:
-            result = str(self.spec.prefix.bin.gfortran)
-        return result
-
-    def url_for_version(self, version):
-        # This function will be called when trying to fetch from url, before
-        # mirrors are tried. It takes care of modifying the suffix of gnu
-        # mirror path so that Spack will also look for the correct file in
-        # the mirrors
-        if (version < Version("6.4.0") and version != Version("5.5.0")) or version == Version(
-            "7.1.0"
-        ):
-            self.gnu_mirror_path = self.gnu_mirror_path.replace("xz", "bz2")
-        return super().url_for_version(version)
-
-    def patch(self):
-        spec = self.spec
-        prefix = self.spec.prefix
-
-        # Fix a standard header file for OS X Yosemite that
-        # is GCC incompatible by replacing non-GCC compliant macros
-        if "yosemite" in spec.architecture:
-            if os.path.isfile("/usr/include/dispatch/object.h"):
-                new_dispatch_dir = join_path(prefix, "include", "dispatch")
-                mkdirp(new_dispatch_dir)
-                new_header = join_path(new_dispatch_dir, "object.h")
-                install("/usr/include/dispatch/object.h", new_header)
-                filter_file(
-                    r"typedef void \(\^dispatch_block_t\)\(void\)",
-                    "typedef void* dispatch_block_t",
-                    new_header,
-                )
-
-        # Use installed libz
-        if self.version >= Version("6"):
-            filter_file(
-                "@zlibdir@", "-L{0}".format(spec["zlib-api"].prefix.lib), "gcc/Makefile.in"
-            )
-            filter_file(
-                "@zlibinc@", "-I{0}".format(spec["zlib-api"].prefix.include), "gcc/Makefile.in"
-            )
-
-        if spec.satisfies("+nvptx"):
-            # backport of 383400a6078d upstream to allow support of cuda@11:
-            filter_file(
-                '#define ASM_SPEC "%{misa=*:-m %*}"',
-                '#define ASM_SPEC "%{misa=*:-m %*; :-m sm_35}"',
-                "gcc/config/nvptx/nvptx.h",
-                string=True,
-            )
-            filter_file(
-                "Target RejectNegative ToLower Joined "
-                "Enum(ptx_isa) Var(ptx_isa_option) Init(PTX_ISA_SM30)",
-                "Target RejectNegative ToLower Joined "
-                "Enum(ptx_isa) Var(ptx_isa_option) Init(PTX_ISA_SM35)",
-                "gcc/config/nvptx/nvptx.opt",
-                string=True,
-            )
-        self.build_optimization_config()
-
-    def get_common_target_flags(self, spec):
-        """Get the right (but pessimistic) architecture specific flags supported by
-        both host gcc and to-be-built gcc. For example: gcc@7 %gcc@12 target=znver3
-        should pick -march=znver1, since that's what gcc@7 supports."""
-        archs = [spec.target] + spec.target.ancestors
-        for arch in archs:
-            try:
-                return arch.optimization_flags("gcc", spec.version)
-            except UnsupportedMicroarchitecture:
-                pass
-        # no arch specific flags in common, unlikely to happen.
-        return ""
-
-    def build_optimization_config(self):
-        """Write a config/spack.mk file with sensible optimization flags, taking into
-        account bootstrapping subtleties."""
-        build_type_flags = {
-            "Debug": "-O0 -g",
-            "Release": "-O3",
-            "RelWithDebInfo": "-O2 -g",
-            "MinSizeRel": "-Os",
-        }
-
-        # Generic optimization flags.
-        flags = build_type_flags[self.spec.variants["build_type"].value]
-
-        # Pessimistic target specific flags. For example, when building
-        # gcc@11 %gcc@7 on znver3, Spack will fix the target to znver1 during
-        # concretization, so we'll stick to that. The other way around however can
-        # result in compilation errors, when gcc@7 is built with gcc@11, and znver3
-        # is taken as a the target, which gcc@7 doesn't support.
-        # Note we're not adding this for aarch64 because of
-        # https://github.com/spack/spack/issues/31184
-        if "+bootstrap %gcc" in self.spec and self.spec.target.family != "aarch64":
-            flags += " " + self.get_common_target_flags(self.spec)
-
-        if "+bootstrap" in self.spec:
-            variables = ["BOOT_CFLAGS", "CFLAGS_FOR_TARGET", "CXXFLAGS_FOR_TARGET"]
-        else:
-            variables = ["CFLAGS", "CXXFLAGS"]
-
-        # Redefine a few variables without losing other defaults:
-        # BOOT_CFLAGS = $(filter-out -O% -g%, $(BOOT_CFLAGS)) -O3
-        # This makes sure that build_type=Release is really -O3, not -O3 -g.
-        fmt_string = "{} := $(filter-out -O% -g%, $({})) {}\n"
-        with open("config/spack.mk", "w") as f:
-            for var in variables:
-                f.write(fmt_string.format(var, var, flags))
-            # Improve the build time for stage 2 a bit by enabling -O1 in stage 1.
-            # Note: this is ignored under ~bootstrap.
-            f.write("STAGE1_CFLAGS += -O1\n")
-
-    # https://gcc.gnu.org/install/configure.html
-    def configure_args(self):
-        spec = self.spec
-
-        # Generic options to compile GCC
-        options = [
-            # Distributor options
-            "--with-pkgversion=Spack GCC",
-            "--with-bugurl=https://github.com/spack/spack/issues",
-            # Xcode 10 dropped 32-bit support
-            "--disable-multilib",
-            "--enable-languages={0}".format(",".join(spec.variants["languages"].value)),
-            # Drop gettext dependency
-            "--disable-nls",
-        ]
-
-        # Avoid excessive realpath/stat calls for every system header
-        # by making -fno-canonical-system-headers the default.
-        if self.version >= Version("4.8.0"):
-            options.append("--disable-canonical-system-headers")
-
-        # Use installed libz
-        if self.version >= Version("6"):
-            options.append("--with-system-zlib")
-
-        if "zstd" in spec:
-            options.append("--with-zstd-include={0}".format(spec["zstd"].headers.directories[0]))
-            options.append("--with-zstd-lib={0}".format(spec["zstd"].libs.directories[0]))
-
-        # Enabling language "jit" requires --enable-host-shared.
-        if "languages=jit" in spec:
-            options.append("--enable-host-shared")
-
-        # Binutils
-        if spec.satisfies("+binutils"):
-            binutils = spec["binutils"].prefix.bin
-            options.extend(
-                [
-                    "--with-gnu-ld",
-                    "--with-ld=" + binutils.ld,
-                    "--with-gnu-as",
-                    "--with-as=" + binutils.join("as"),
-                ]
-            )
-        elif spec.satisfies("%apple-clang@15:"):
-            # https://github.com/iains/gcc-darwin-arm64/issues/117
-            # https://github.com/iains/gcc-12-branch/issues/22
-            # https://github.com/iains/gcc-13-branch/issues/8
-            options.append("--with-ld=/Library/Developer/CommandLineTools/usr/bin/ld-classic")
-
-        # enable_bootstrap
-        if spec.satisfies("+bootstrap"):
-            options.extend(["--enable-bootstrap"])
-        else:
-            options.extend(["--disable-bootstrap"])
-
-        # Configure include and lib directories explicitly for these
-        # dependencies since the short GCC option assumes that libraries
-        # are installed in "/lib" which might not be true on all OS
-        # (see #10842)
-        #
-        # More info at: https://gcc.gnu.org/install/configure.html
-        for dep_str in ("mpfr", "gmp", "mpc", "isl"):
-            if dep_str not in spec:
-                options.append("--without-{0}".format(dep_str))
-                continue
-
-            dep_spec = spec[dep_str]
-            include_dir = dep_spec.headers.directories[0]
-            lib_dir = dep_spec.libs.directories[0]
-            options.extend(
-                [
-                    "--with-{0}-include={1}".format(dep_str, include_dir),
-                    "--with-{0}-lib={1}".format(dep_str, lib_dir),
-                ]
-            )
-
-        # nvptx-none offloading for host compiler
-        if spec.satisfies("+nvptx"):
-            options.extend(
-                [
-                    "--enable-offload-targets=nvptx-none",
-                    "--with-cuda-driver-include={0}".format(spec["cuda"].prefix.include),
-                    "--with-cuda-driver-lib={0}".format(spec["cuda"].libs.directories[0]),
-                    "--disable-bootstrap",
-                    "--disable-multilib",
-                ]
-            )
-
-        if sys.platform == "darwin":
-            options.extend(
-                [
-                    "--with-native-system-header-dir=/usr/include",
-                    "--with-sysroot={0}".format(macos_sdk_path()),
-                    "--with-libiconv-prefix={0}".format(spec["iconv"].prefix),
-                ]
-            )
-
-        # enable appropriate bootstrapping flags
-        stage1_ldflags = str(self.rpath_args)
-        boot_ldflags = stage1_ldflags + " -static-libstdc++ -static-libgcc"
-        options.append("--with-stage1-ldflags=" + stage1_ldflags)
-        options.append("--with-boot-ldflags=" + boot_ldflags)
-        options.append("--with-build-config=spack")
-
-        if "languages=d" in spec:
-            # Phobos is the standard library for the D Programming Language. The documentation says
-            # that on some targets, 'libphobos' is not enabled by default, but compiles and works
-            # if '--enable-libphobos' is used. Specifics are documented for affected targets.
-            # See https://gcc.gnu.org/install/prerequisites.html#GDC-prerequisite
-            # Unfortunately, it is unclear where exactly the aforementioned specifics are
-            # documented but GDC seems to be unusable without the library, therefore we enable it
-            # explicitly:
-            options.append("--enable-libphobos")
-            if spec.satisfies("@12:"):
-                options.append("GDC={0}".format(self.detect_gdc()))
-
-        return options
-
-    # run configure/make/make(install) for the nvptx-none target
-    # before running the host compiler phases
-    @run_before("configure")
-    def nvptx_install(self):
-        spec = self.spec
-        prefix = self.prefix
-
-        if not spec.satisfies("+nvptx"):
-            return
-
-        # config.guess returns the host triple, e.g. "x86_64-pc-linux-gnu"
-        guess = Executable("./config.guess")
-        targetguess = guess(output=str).rstrip("\n")
-
-        options = getattr(self, "configure_flag_args", [])
-        options += ["--prefix={0}".format(prefix)]
-
-        options += [
-            "--with-cuda-driver-include={0}".format(spec["cuda"].prefix.include),
-            "--with-cuda-driver-lib={0}".format(spec["cuda"].libs.directories[0]),
-        ]
-
-        with working_dir("nvptx-tools"):
-            configure = Executable("./configure")
-            configure(*options)
-            make()
-            make("install")
-
-        pattern = join_path(self.stage.source_path, "newlibsource", "*")
-        files = glob.glob(pattern)
-
-        if files:
-            symlink(join_path(files[0], "newlib"), "newlib")
-
-        # self.build_directory = 'spack-build-nvptx'
-        with working_dir("spack-build-nvptx", create=True):
-            options = [
-                "--prefix={0}".format(prefix),
-                "--enable-languages={0}".format(",".join(spec.variants["languages"].value)),
-                "--with-mpfr={0}".format(spec["mpfr"].prefix),
-                "--with-gmp={0}".format(spec["gmp"].prefix),
-                "--target=nvptx-none",
-                "--with-build-time-tools={0}".format(join_path(prefix, "nvptx-none", "bin")),
-                "--enable-as-accelerator-for={0}".format(targetguess),
-                "--disable-sjlj-exceptions",
-                "--enable-newlib-io-long-long",
-            ]
-
-            configure = Executable("../configure")
-            configure(*options)
-            make()
-            make("install")
-
-    @property
-    def build_targets(self):
-        if "+profiled" in self.spec:
-            return ["profiledbootstrap"]
-        return []
-
-    @property
-    def install_targets(self):
-        if "+strip" in self.spec:
-            return ["install-strip"]
-        return ["install"]
-
-    @property
-    def spec_dir(self):
-        # e.g. lib/gcc/x86_64-unknown-linux-gnu/4.9.2
-        spec_dir = glob.glob("{0}/gcc/*/*".format(self.prefix.lib))
-        return spec_dir[0] if spec_dir else None
-
-    @run_after("install")
-    def write_rpath_specs(self):
-        """Generate a spec file so the linker adds a rpath to the libs
-        the compiler used to build the executable.
-
-        .. caution::
-
-           The custom spec file by default with *always* pass ``-Wl,-rpath
-           ...`` to the linker, which will cause the linker to *ignore* the
-           value of ``LD_RUN_PATH``, which otherwise would be saved to the
-           binary as the default rpath. See the mitigation below for how to
-           temporarily disable this behavior.
-
-        Structure the specs file so that users can define a custom spec file
-        to suppress the spack-linked rpaths to facilitate rpath adjustment
-        for relocatable binaries. The custom spec file
-        :file:`{norpath}.spec` will have a single
-        line followed by two blanks lines::
-
-            *link_libgcc_rpath:
-
-
-
-        It can be passed to the GCC linker using the argument
-        ``--specs=norpath.spec`` to disable the automatic rpath and restore
-        the behavior of ``LD_RUN_PATH``."""
-        if not self.spec_dir:
-            tty.warn(
-                "Could not install specs for {0}.".format(self.spec.format("{name}{@version}"))
-            )
-            return
-
-        gcc = self.spec["gcc"].command
-        lines = gcc("-dumpspecs", output=str).splitlines(True)
-        specs_file = join_path(self.spec_dir, "specs")
-
-        # Save a backup
-        with open(specs_file + ".orig", "w") as out:
-            out.writelines(lines)
-
-        # Find which directories have shared libraries
-        rpath_libdirs = []
-        for dir in ["lib", "lib64"]:
-            libdir = join_path(self.prefix, dir)
-            if glob.glob(join_path(libdir, "*." + dso_suffix)):
-                rpath_libdirs.append(libdir)
-
-        if not rpath_libdirs:
-            # No shared libraries
-            tty.warn("No dynamic libraries found in lib/lib64")
-            return
-
-        # Overwrite the specs file
-        with open(specs_file, "w") as out:
-            for line in lines:
-                out.write(line)
-                if line.startswith("*link_libgcc:"):
-                    # Insert at start of line following link_libgcc, which gets
-                    # inserted into every call to the linker
-                    out.write("%(link_libgcc_rpath) ")
-
-            # Add easily-overridable rpath string at the end
-            out.write("*link_libgcc_rpath:\n")
-            out.write(" ".join("-rpath " + lib for lib in rpath_libdirs))
-            out.write("\n")
-        set_install_permissions(specs_file)
-        tty.info("Wrote new spec file to {0}".format(specs_file))
-
-    def setup_run_environment(self, env):
-        # Search prefix directory for possibly modified compiler names
-        from spack.compilers.gcc import Gcc as Compiler
-
-        # Get the contents of the installed binary directory
-        bin_path = self.spec.prefix.bin
-
-        if not os.path.isdir(bin_path):
-            return
-
-        bin_contents = os.listdir(bin_path)
-
-        # Find the first non-symlink compiler binary present for each language
-        for lang in ["cc", "cxx", "fc", "f77"]:
-            for filename, regexp in itertools.product(bin_contents, Compiler.search_regexps(lang)):
-                if not regexp.match(filename):
-                    continue
-
-                abspath = os.path.join(bin_path, filename)
-                if os.path.islink(abspath):
-                    continue
-
-                # Set the proper environment variable
-                env.set(lang.upper(), abspath)
-                # Stop searching filename/regex combos for this language
-                break
-
-    def detect_gdc(self):
-        """Detect and return the path to GDC that belongs to the same instance of GCC that is used
-        by self.compiler.
-
-        If the path cannot be detected, raise InstallError with recommendations for the users on
-        how to circumvent the problem.
-
-        Should be use only if self.spec.satisfies("@12: languages=d")
-        """
-        # Detect GCC package in the directory of the GCC compiler
-        # or in the $PATH if self.compiler.cc is not an absolute path:
-        from spack.detection import by_path
-
-        compiler_dir = os.path.dirname(self.compiler.cc)
-        detected_packages = by_path(
-            [self.name], path_hints=([compiler_dir] if os.path.isdir(compiler_dir) else None)
-        )
-
-        # We consider only packages that satisfy the following constraint:
-        required_spec = Spec("languages=c,c++,d")
-        candidate_specs = [
-            p.spec
-            for p in filter(
-                lambda p: p.spec.satisfies(required_spec), detected_packages.get(self.name, ())
-            )
-        ]
-
-        if candidate_specs:
-            # We now need to filter specs that match the compiler version:
-            compiler_spec = Spec(repr(self.compiler.spec))
-
-            # First, try to filter specs that satisfy the compiler spec:
-            new_candidate_specs = list(
-                filter(lambda s: s.satisfies(compiler_spec), candidate_specs)
-            )
-
-            # The compiler version might be more specific than what we can detect. For example, the
-            # user might have "gcc@10.2.1-sys" as the compiler spec in compilers.yaml. In that
-            # case, we end up with an empty list of candidates. To circumvent the problem, we try
-            # to filter specs that are satisfied by the compiler spec:
-            if not new_candidate_specs:
-                new_candidate_specs = list(
-                    filter(lambda s: compiler_spec.satisfies(s), candidate_specs)
-                )
-
-            candidate_specs = new_candidate_specs
-
-        error_nl = "\n    "  # see SpackError.__str__()
-
-        if not candidate_specs:
-            raise InstallError(
-                "Cannot detect GDC",
-                long_msg="Starting version 12, the D frontend requires a working GDC."
-                "{0}You can install it with Spack by running:"
-                "{0}{0}spack install gcc@9:11 languages=c,c++,d"
-                "{0}{0}Once that has finished, you will need to add it to your compilers.yaml file"
-                "{0}and use it to install this spec (i.e. {1} ...).".format(
-                    error_nl, self.spec.format("{name}{@version} {variants.languages}")
-                ),
-            )
-        elif len(candidate_specs) == 0:
-            return candidate_specs[0].extra_attributes["compilers"]["d"]
-        else:
-            # It is rather unlikely to end up here but let us try to resolve the ambiguity:
-            candidate_gdc = candidate_specs[0].extra_attributes["compilers"]["d"]
-            if all(
-                candidate_gdc == s.extra_attributes["compilers"]["d"] for s in candidate_specs[1:]
-            ):
-                # It does not matter which one we take if they are all the same:
-                return candidate_gdc
-            else:
-                raise InstallError(
-                    "Cannot resolve ambiguity when detecting GDC that belongs to "
-                    "%{0}".format(self.compiler.spec),
-                    long_msg="The candidates are:{0}{0}{1}{0}".format(
-                        error_nl,
-                        error_nl.join(
-                            "{0} (cc: {1})".format(
-                                s.extra_attributes["compilers"]["d"],
-                                s.extra_attributes["compilers"]["c"],
-                            )
-                            for s in candidate_specs
-                        ),
-                    ),
-                )
diff --git a/packages/gcc/patch-2b40941d23b1570cdd90083b58fa0f66aa58c86e.patch b/packages/gcc/patch-2b40941d23b1570cdd90083b58fa0f66aa58c86e.patch
deleted file mode 100644
index 3d76c47b..00000000
--- a/packages/gcc/patch-2b40941d23b1570cdd90083b58fa0f66aa58c86e.patch
+++ /dev/null
@@ -1,121 +0,0 @@
-From 2b40941d23b1570cdd90083b58fa0f66aa58c86e Mon Sep 17 00:00:00 2001
-From: Tamar Christina <tamar.christina@arm.com>
-Date: Fri, 21 May 2021 12:16:56 +0100
-Subject: [PATCH] libsanitizer: Remove cyclades from libsanitizer
-
-The Linux kernel has removed the interface to cyclades from
-the latest kernel headers[1] due to them being orphaned for the
-past 13 years.
-
-libsanitizer uses this header when compiling against glibc, but
-glibcs itself doesn't seem to have any references to cyclades.
-
-Further more it seems that the driver is broken in the kernel and
-the firmware doesn't seem to be available anymore.
-
-As such since this is breaking the build of libsanitizer (and so the
-GCC bootstrap[2]) I propose to remove this.
-
-[1] https://lkml.org/lkml/2021/3/2/153
-[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379
-
-libsanitizer/ChangeLog:
-
-	PR sanitizer/100379
-	* sanitizer_common/sanitizer_common_interceptors_ioctl.inc: Cherry-pick
-	llvm-project revision f7c5351552387bd43f6ca3631016d7f0dfe0f135.
-	* sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise.
-	* sanitizer_common/sanitizer_platform_limits_posix.h: Likewise.
----
- .../sanitizer_common_interceptors_ioctl.inc           |  9 ---------
- .../sanitizer_platform_limits_posix.cc                | 11 -----------
- .../sanitizer_platform_limits_posix.h                 | 10 ----------
- 3 files changed, 30 deletions(-)
-
-diff --git a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-index 5408ea17c59..7a9cd3f5968 100644
---- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-+++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-@@ -365,15 +365,6 @@ static void ioctl_table_fill() {
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
-   // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
--  _(CYGETDEFTHRESH, WRITE, sizeof(int));
--  _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
--  _(CYGETMON, WRITE, struct_cyclades_monitor_sz);
--  _(CYGETTHRESH, WRITE, sizeof(int));
--  _(CYGETTIMEOUT, WRITE, sizeof(int));
--  _(CYSETDEFTHRESH, NONE, 0);
--  _(CYSETDEFTIMEOUT, NONE, 0);
--  _(CYSETTHRESH, NONE, 0);
--  _(CYSETTIMEOUT, NONE, 0);
-   _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);
-   _(EQL_ENSLAVE, WRITE, struct_ifreq_sz);
-   _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-index d823a12190c..e8fce8a0287 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -157,7 +157,6 @@ typedef struct user_fpregs elf_fpregset_t;
- # include <sys/procfs.h>
- #endif
- #include <sys/user.h>
--#include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
- #include <linux/lp.h>
-@@ -466,7 +465,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
-   unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
--  unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
- #if EV_VERSION > (0x010000)
-   unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);
- #else
-@@ -833,15 +831,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--  unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
--  unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
--  unsigned IOCTL_CYGETMON = CYGETMON;
--  unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
--  unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
--  unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
--  unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
--  unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
--  unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;
-   unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;
-   unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;
-   unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-index 6a673a7c995..f921bf2b5b5 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-@@ -1040,7 +1040,6 @@ struct __sanitizer_cookie_io_functions_t {
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
-   extern unsigned struct_ax25_parms_struct_sz;
--  extern unsigned struct_cyclades_monitor_sz;
-   extern unsigned struct_input_keymap_entry_sz;
-   extern unsigned struct_ipx_config_data_sz;
-   extern unsigned struct_kbdiacrs_sz;
-@@ -1385,15 +1384,6 @@ struct __sanitizer_cookie_io_functions_t {
- #endif  // SANITIZER_LINUX || SANITIZER_FREEBSD
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--  extern unsigned IOCTL_CYGETDEFTHRESH;
--  extern unsigned IOCTL_CYGETDEFTIMEOUT;
--  extern unsigned IOCTL_CYGETMON;
--  extern unsigned IOCTL_CYGETTHRESH;
--  extern unsigned IOCTL_CYGETTIMEOUT;
--  extern unsigned IOCTL_CYSETDEFTHRESH;
--  extern unsigned IOCTL_CYSETDEFTIMEOUT;
--  extern unsigned IOCTL_CYSETTHRESH;
--  extern unsigned IOCTL_CYSETTIMEOUT;
-   extern unsigned IOCTL_EQL_EMANCIPATE;
-   extern unsigned IOCTL_EQL_ENSLAVE;
-   extern unsigned IOCTL_EQL_GETMASTRCFG;
--- 
-2.31.1
-
diff --git a/packages/gcc/patch-745dae5923aba02982563481d75a21595df22ff8.patch b/packages/gcc/patch-745dae5923aba02982563481d75a21595df22ff8.patch
deleted file mode 100644
index 57c51eb2..00000000
--- a/packages/gcc/patch-745dae5923aba02982563481d75a21595df22ff8.patch
+++ /dev/null
@@ -1,123 +0,0 @@
-From 745dae5923aba02982563481d75a21595df22ff8 Mon Sep 17 00:00:00 2001
-From: Tamar Christina <tamar.christina@arm.com>
-Date: Fri, 21 May 2021 10:30:59 +0100
-Subject: [PATCH] libsanitizer: Remove cyclades from libsanitizer
-
-The Linux kernel has removed the interface to cyclades from
-the latest kernel headers[1] due to them being orphaned for the
-past 13 years.
-
-libsanitizer uses this header when compiling against glibc, but
-glibcs itself doesn't seem to have any references to cyclades.
-
-Further more it seems that the driver is broken in the kernel and
-the firmware doesn't seem to be available anymore.
-
-As such since this is breaking the build of libsanitizer (and so the
-GCC bootstrap[2]) I propose to remove this.
-
-[1] https://lkml.org/lkml/2021/3/2/153
-[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379
-
-(cherry picked from commit f7c5351552387bd43f6ca3631016d7f0dfe0f135)
-
-libsanitizer/ChangeLog:
-
-	PR sanitizer/100379
-	* sanitizer_common/sanitizer_common_interceptors_ioctl.inc: Cherry-pick
-	llvm-project revision f7c5351552387bd43f6ca3631016d7f0dfe0f135.
-	* sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.
-	* sanitizer_common/sanitizer_platform_limits_posix.h: Likewise.
----
- .../sanitizer_common_interceptors_ioctl.inc           |  9 ---------
- .../sanitizer_platform_limits_posix.cpp               | 11 -----------
- .../sanitizer_platform_limits_posix.h                 | 10 ----------
- 3 files changed, 30 deletions(-)
-
-diff --git a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-index 7f181258eab..b7da6598755 100644
---- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-+++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-@@ -370,15 +370,6 @@ static void ioctl_table_fill() {
- 
- #if SANITIZER_GLIBC
-   // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
--  _(CYGETDEFTHRESH, WRITE, sizeof(int));
--  _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
--  _(CYGETMON, WRITE, struct_cyclades_monitor_sz);
--  _(CYGETTHRESH, WRITE, sizeof(int));
--  _(CYGETTIMEOUT, WRITE, sizeof(int));
--  _(CYSETDEFTHRESH, NONE, 0);
--  _(CYSETDEFTIMEOUT, NONE, 0);
--  _(CYSETTHRESH, NONE, 0);
--  _(CYSETTIMEOUT, NONE, 0);
-   _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);
-   _(EQL_ENSLAVE, WRITE, struct_ifreq_sz);
-   _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
-index 35a690cba5c..6e5c330b98e 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
-@@ -143,7 +143,6 @@ typedef struct user_fpregs elf_fpregset_t;
- # include <sys/procfs.h>
- #endif
- #include <sys/user.h>
--#include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
- #include <linux/lp.h>
-@@ -460,7 +459,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- 
- #if SANITIZER_GLIBC
-   unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
--  unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
- #if EV_VERSION > (0x010000)
-   unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);
- #else
-@@ -824,15 +822,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
- #endif // SANITIZER_LINUX
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--  unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
--  unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
--  unsigned IOCTL_CYGETMON = CYGETMON;
--  unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
--  unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
--  unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
--  unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
--  unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
--  unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;
-   unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;
-   unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;
-   unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-index ad358eef8b7..cba41ba5494 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
-@@ -983,7 +983,6 @@ extern unsigned struct_vt_mode_sz;
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
- extern unsigned struct_ax25_parms_struct_sz;
--extern unsigned struct_cyclades_monitor_sz;
- extern unsigned struct_input_keymap_entry_sz;
- extern unsigned struct_ipx_config_data_sz;
- extern unsigned struct_kbdiacrs_sz;
-@@ -1328,15 +1327,6 @@ extern unsigned IOCTL_VT_WAITACTIVE;
- #endif  // SANITIZER_LINUX
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--extern unsigned IOCTL_CYGETDEFTHRESH;
--extern unsigned IOCTL_CYGETDEFTIMEOUT;
--extern unsigned IOCTL_CYGETMON;
--extern unsigned IOCTL_CYGETTHRESH;
--extern unsigned IOCTL_CYGETTIMEOUT;
--extern unsigned IOCTL_CYSETDEFTHRESH;
--extern unsigned IOCTL_CYSETDEFTIMEOUT;
--extern unsigned IOCTL_CYSETTHRESH;
--extern unsigned IOCTL_CYSETTIMEOUT;
- extern unsigned IOCTL_EQL_EMANCIPATE;
- extern unsigned IOCTL_EQL_ENSLAVE;
- extern unsigned IOCTL_EQL_GETMASTRCFG;
--- 
-2.31.1
-
diff --git a/packages/gcc/patch-f1feb74046e0feb0596b93bbb822fae02940a90e.patch b/packages/gcc/patch-f1feb74046e0feb0596b93bbb822fae02940a90e.patch
deleted file mode 100644
index 2448be07..00000000
--- a/packages/gcc/patch-f1feb74046e0feb0596b93bbb822fae02940a90e.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From f1feb74046e0feb0596b93bbb822fae02940a90e Mon Sep 17 00:00:00 2001
-From: Patrick Palka <ppalka@redhat.com>
-Date: Fri, 4 Jun 2021 13:46:53 -0400
-Subject: [PATCH] c++: tsubst_function_decl and excess arg levels [PR100102]
-
-Here, when instantiating the dependent alias template
-duration::__is_harmonic with args={{T,U},{int}}, we find ourselves
-substituting the function decl _S_gcd.  Since we have more arg levels
-than _S_gcd has parm levels, an old special case in tsubst_function_decl
-causes us to unwantedly reduce args to its innermost level, yielding
-args={int}, which leads to a nonsensical substitution into the decl
-context and eventually a crash.
-
-The comment for this special case refers to three examples for which we
-ought to see more arg levels than parm levels here, but none of the
-examples actually demonstrate this.  In the first example, when
-defining S<int>::f(U) parms_depth is 2 and args_depth is 1, and
-later when instantiating say S<int>::f<char> both depths are 2.  In the
-second example, when substituting the template friend declaration
-parms_depth is 2 and args_depth is 1, and later when instantiating f
-both depths are 1.  Finally, the third example is invalid since we can't
-specialize a member template of an unspecialized class template like
-that.
-
-Given that this reduction code seems no longer relevant for its
-documented purpose and that it causes problems as in the PR, this patch
-just removes it.  Note that as far as bootstrap/regtest is concerned,
-this code is dead; the below two tests would be the first to reach it.
-
-	PR c++/100102
-
-gcc/cp/ChangeLog:
-
-	* pt.c (tsubst_function_decl): Remove old code for reducing
-	args when it has excess levels.
-
-gcc/testsuite/ChangeLog:
-
-	* g++.dg/cpp0x/alias-decl-72.C: New test.
-	* g++.dg/cpp0x/alias-decl-72a.C: New test.
-
-(cherry picked from commit 5357ab75dedef403b0eebf9277d61d1cbeb5898f)
----
- gcc/cp/pt.c                                 | 39 ---------------------
- gcc/testsuite/g++.dg/cpp0x/alias-decl-72.C  |  9 +++++
- gcc/testsuite/g++.dg/cpp0x/alias-decl-72a.C |  9 +++++
- 3 files changed, 18 insertions(+), 39 deletions(-)
- create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-72.C
- create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-72a.C
-
-diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
-index 1434beb80f4..1761a902218 100644
---- a/gcc/cp/pt.c
-+++ b/gcc/cp/pt.c
-@@ -13954,45 +13954,6 @@ tsubst_function_decl (tree t, tree args, tsubst_flags_t complain,
- 	  if (tree spec = retrieve_specialization (gen_tmpl, argvec, hash))
- 	    return spec;
- 	}
--
--      /* We can see more levels of arguments than parameters if
--	 there was a specialization of a member template, like
--	 this:
--
--	 template <class T> struct S { template <class U> void f(); }
--	 template <> template <class U> void S<int>::f(U);
--
--	 Here, we'll be substituting into the specialization,
--	 because that's where we can find the code we actually
--	 want to generate, but we'll have enough arguments for
--	 the most general template.
--
--	 We also deal with the peculiar case:
--
--	 template <class T> struct S {
--	   template <class U> friend void f();
--	 };
--	 template <class U> void f() {}
--	 template S<int>;
--	 template void f<double>();
--
--	 Here, the ARGS for the instantiation of will be {int,
--	 double}.  But, we only need as many ARGS as there are
--	 levels of template parameters in CODE_PATTERN.  We are
--	 careful not to get fooled into reducing the ARGS in
--	 situations like:
--
--	 template <class T> struct S { template <class U> void f(U); }
--	 template <class T> template <> void S<T>::f(int) {}
--
--	 which we can spot because the pattern will be a
--	 specialization in this case.  */
--      int args_depth = TMPL_ARGS_DEPTH (args);
--      int parms_depth =
--	TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (DECL_TI_TEMPLATE (t)));
--
--      if (args_depth > parms_depth && !DECL_TEMPLATE_SPECIALIZATION (t))
--	args = get_innermost_template_args (args, parms_depth);
-     }
-   else
-     {
-diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-72.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-72.C
-new file mode 100644
-index 00000000000..8009756dcba
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-72.C
-@@ -0,0 +1,9 @@
-+// PR c++/100102
-+// { dg-do compile { target c++11 } }
-+
-+template<int()> struct ratio;
-+template<class T, class U> struct duration {
-+  static constexpr int _S_gcd();
-+  template<class> using __is_harmonic = ratio<_S_gcd>;
-+  using type = __is_harmonic<int>;
-+};
-diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-72a.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-72a.C
-new file mode 100644
-index 00000000000..a4443e18f9d
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-72a.C
-@@ -0,0 +1,9 @@
-+// PR c++/100102
-+// { dg-do compile { target c++11 } }
-+
-+template<int> struct ratio;
-+template<class T> struct duration {
-+  static constexpr int _S_gcd();
-+  template<class> using __is_harmonic = ratio<(duration::_S_gcd)()>;
-+  using type = __is_harmonic<int>;
-+};
--- 
-2.31.1
-
diff --git a/packages/gcc/patch-fc930b3010bd0de899a3da3209eab20664ddb703.patch b/packages/gcc/patch-fc930b3010bd0de899a3da3209eab20664ddb703.patch
deleted file mode 100644
index 27e5a2b5..00000000
--- a/packages/gcc/patch-fc930b3010bd0de899a3da3209eab20664ddb703.patch
+++ /dev/null
@@ -1,133 +0,0 @@
-From fc930b3010bd0de899a3da3209eab20664ddb703 Mon Sep 17 00:00:00 2001
-From: Patrick Palka <ppalka@redhat.com>
-Date: Fri, 4 Jun 2021 13:46:53 -0400
-Subject: [PATCH] c++: tsubst_function_decl and excess arg levels [PR100102]
-
-Here, when instantiating the dependent alias template
-duration::__is_harmonic with args={{T,U},{int}}, we find ourselves
-substituting the function decl _S_gcd.  Since we have more arg levels
-than _S_gcd has parm levels, an old special case in tsubst_function_decl
-causes us to unwantedly reduce args to its innermost level, yielding
-args={int}, which leads to a nonsensical substitution into the decl
-context and eventually a crash.
-
-The comment for this special case refers to three examples for which we
-ought to see more arg levels than parm levels here, but none of the
-examples actually demonstrate this.  In the first example, when
-defining S<int>::f(U) parms_depth is 2 and args_depth is 1, and
-later when instantiating say S<int>::f<char> both depths are 2.  In the
-second example, when substituting the template friend declaration
-parms_depth is 2 and args_depth is 1, and later when instantiating f
-both depths are 1.  Finally, the third example is invalid since we can't
-specialize a member template of an unspecialized class template like
-that.
-
-Given that this reduction code seems no longer relevant for its
-documented purpose and that it causes problems as in the PR, this patch
-just removes it.  Note that as far as bootstrap/regtest is concerned,
-this code is dead; the below two tests would be the first to reach it.
-
-	PR c++/100102
-
-gcc/cp/ChangeLog:
-
-	* pt.c (tsubst_function_decl): Remove old code for reducing
-	args when it has excess levels.
-
-gcc/testsuite/ChangeLog:
-
-	* g++.dg/cpp0x/alias-decl-72.C: New test.
-	* g++.dg/cpp0x/alias-decl-72a.C: New test.
-
-(cherry picked from commit 5357ab75dedef403b0eebf9277d61d1cbeb5898f)
----
- gcc/cp/pt.c                                 | 39 ---------------------
- gcc/testsuite/g++.dg/cpp0x/alias-decl-72.C  |  9 +++++
- gcc/testsuite/g++.dg/cpp0x/alias-decl-72a.C |  9 +++++
- 3 files changed, 18 insertions(+), 39 deletions(-)
- create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-72.C
- create mode 100644 gcc/testsuite/g++.dg/cpp0x/alias-decl-72a.C
-
-diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
-index 5a957141ba3..7ce9ac234f8 100644
---- a/gcc/cp/pt.c
-+++ b/gcc/cp/pt.c
-@@ -13811,45 +13811,6 @@ tsubst_function_decl (tree t, tree args, tsubst_flags_t complain,
- 	  if (tree spec = retrieve_specialization (gen_tmpl, argvec, hash))
- 	    return spec;
- 	}
--
--      /* We can see more levels of arguments than parameters if
--	 there was a specialization of a member template, like
--	 this:
--
--	 template <class T> struct S { template <class U> void f(); }
--	 template <> template <class U> void S<int>::f(U);
--
--	 Here, we'll be substituting into the specialization,
--	 because that's where we can find the code we actually
--	 want to generate, but we'll have enough arguments for
--	 the most general template.
--
--	 We also deal with the peculiar case:
--
--	 template <class T> struct S {
--	   template <class U> friend void f();
--	 };
--	 template <class U> void f() {}
--	 template S<int>;
--	 template void f<double>();
--
--	 Here, the ARGS for the instantiation of will be {int,
--	 double}.  But, we only need as many ARGS as there are
--	 levels of template parameters in CODE_PATTERN.  We are
--	 careful not to get fooled into reducing the ARGS in
--	 situations like:
--
--	 template <class T> struct S { template <class U> void f(U); }
--	 template <class T> template <> void S<T>::f(int) {}
--
--	 which we can spot because the pattern will be a
--	 specialization in this case.  */
--      int args_depth = TMPL_ARGS_DEPTH (args);
--      int parms_depth =
--	TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (DECL_TI_TEMPLATE (t)));
--
--      if (args_depth > parms_depth && !DECL_TEMPLATE_SPECIALIZATION (t))
--	args = get_innermost_template_args (args, parms_depth);
-     }
-   else
-     {
-diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-72.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-72.C
-new file mode 100644
-index 00000000000..8009756dcba
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-72.C
-@@ -0,0 +1,9 @@
-+// PR c++/100102
-+// { dg-do compile { target c++11 } }
-+
-+template<int()> struct ratio;
-+template<class T, class U> struct duration {
-+  static constexpr int _S_gcd();
-+  template<class> using __is_harmonic = ratio<_S_gcd>;
-+  using type = __is_harmonic<int>;
-+};
-diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-72a.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-72a.C
-new file mode 100644
-index 00000000000..a4443e18f9d
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-72a.C
-@@ -0,0 +1,9 @@
-+// PR c++/100102
-+// { dg-do compile { target c++11 } }
-+
-+template<int> struct ratio;
-+template<class T> struct duration {
-+  static constexpr int _S_gcd();
-+  template<class> using __is_harmonic = ratio<(duration::_S_gcd)()>;
-+  using type = __is_harmonic<int>;
-+};
--- 
-2.31.1
-
diff --git a/packages/gcc/piclibs.patch b/packages/gcc/piclibs.patch
deleted file mode 100644
index 0ecb7930..00000000
--- a/packages/gcc/piclibs.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in
-index 62b9f7a..7666fdb 100644
---- a/libgfortran/Makefile.in
-+++ b/libgfortran/Makefile.in
-@@ -357,11 +357,11 @@ AUTOMAKE = @AUTOMAKE@
- AWK = @AWK@
- CC = @CC@
- CCDEPMODE = @CCDEPMODE@
--CFLAGS = @CFLAGS@
-+CFLAGS = @CFLAGS@ -fPIC
- CPP = @CPP@
--CPPFLAGS = @CPPFLAGS@
-+CPPFLAGS = @CPPFLAGS@ -fPIC
- CYGPATH_W = @CYGPATH_W@
--DEFS = @DEFS@
-+DEFS = @DEFS@ -fPIC
- DEPDIR = @DEPDIR@
- DSYMUTIL = @DSYMUTIL@
- DUMPBIN = @DUMPBIN@
-@@ -371,7 +371,7 @@ ECHO_T = @ECHO_T@
- EGREP = @EGREP@
- EXEEXT = @EXEEXT@
- FC = @FC@
--FCFLAGS = @FCFLAGS@
-+FCFLAGS = @FCFLAGS@ -fPIC
- FGREP = @FGREP@
- FPU_HOST_HEADER = @FPU_HOST_HEADER@
- GREP = @GREP@
-diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
-index bede542..9b3e442 100644
---- a/libstdc++-v3/Makefile.in
-+++ b/libstdc++-v3/Makefile.in
-@@ -115,7 +115,7 @@ CC = @CC@
- CCODECVT_CC = @CCODECVT_CC@
- CCOLLATE_CC = @CCOLLATE_CC@
- CCTYPE_CC = @CCTYPE_CC@
--CFLAGS = @CFLAGS@
-+CFLAGS = @CFLAGS@ -fPIC
- CLOCALE_CC = @CLOCALE_CC@
- CLOCALE_H = @CLOCALE_H@
- CLOCALE_INTERNAL_H = @CLOCALE_INTERNAL_H@
-@@ -124,7 +124,7 @@ CMESSAGES_H = @CMESSAGES_H@
- CMONEY_CC = @CMONEY_CC@
- CNUMERIC_CC = @CNUMERIC_CC@
- CPP = @CPP@
--CPPFLAGS = @CPPFLAGS@
-+CPPFLAGS = @CPPFLAGS@ -fPIC
- CPU_DEFINES_SRCDIR = @CPU_DEFINES_SRCDIR@
- CPU_OPT_BITS_RANDOM = @CPU_OPT_BITS_RANDOM@
- CPU_OPT_EXT_RANDOM = @CPU_OPT_EXT_RANDOM@
-@@ -139,7 +139,7 @@ CYGPATH_W = @CYGPATH_W@
- C_INCLUDE_DIR = @C_INCLUDE_DIR@
- DBLATEX = @DBLATEX@
- DEBUG_FLAGS = @DEBUG_FLAGS@
--DEFS = @DEFS@
-+DEFS = @DEFS@ -fPIC
- DOT = @DOT@
- DOXYGEN = @DOXYGEN@
- DSYMUTIL = @DSYMUTIL@
--- 
-2.8.3
-
diff --git a/packages/gcc/signal.patch b/packages/gcc/signal.patch
deleted file mode 100644
index 21bf9e03..00000000
--- a/packages/gcc/signal.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 6c709b6262e8b6441b1e94526d6d65d4ce7a7dec Mon Sep 17 00:00:00 2001
-From: doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Thu, 7 Sep 2017 07:18:57 +0000
-Subject: [PATCH] 2017-09-07  Matthias Klose  <doko@ubuntu.com>
-
-        * asan/asan_linux.cc: Include <signal.h>
-
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@251830 138bc75d-0d04-0410-961f-82ee72b054a4
----
- libsanitizer/asan/asan_linux.cc | 1 +
- 2 files changed, 5 insertions(+)
-
-diff --git a/libsanitizer/asan/asan_linux.cc b/libsanitizer/asan/asan_linux.cc
-index c504168..59087b9 100644
---- a/libsanitizer/asan/asan_linux.cc
-+++ b/libsanitizer/asan/asan_linux.cc
-@@ -29,6 +29,7 @@
- #include <dlfcn.h>
- #include <fcntl.h>
- #include <pthread.h>
-+#include <signal.h>
- #include <stdio.h>
- #include <unistd.h>
- #include <unwind.h>
--- 
-2.9.3
-
diff --git a/packages/gcc/stack_t-4.9.patch b/packages/gcc/stack_t-4.9.patch
deleted file mode 100644
index b894557c..00000000
--- a/packages/gcc/stack_t-4.9.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From 833e00c01e96f61e24cd7ec97b93fad212dc914b Mon Sep 17 00:00:00 2001
-From: doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Thu, 7 Sep 2017 07:17:17 +0000
-Subject: [PATCH] 2017-09-07  Matthias Klose  <doko@ubuntu.com>
-
-        Backported from mainline
-        2017-07-14  Jakub Jelinek  <jakub@redhat.com>
-
-        PR sanitizer/81066
-        * sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969.
-        * sanitizer_common/sanitizer_linux.cc: Likewise.
-        * sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise.
-        * tsan/tsan_platform_linux.cc: Likewise.
-
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@251829 138bc75d-0d04-0410-961f-82ee72b054a4
----
- libsanitizer/sanitizer_common/sanitizer_linux.cc              |  3 +--
- libsanitizer/sanitizer_common/sanitizer_linux.h               |  4 +---
- .../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc  |  2 +-
- libsanitizer/tsan/tsan_platform_linux.cc                      |  2 +-
- 5 files changed, 15 insertions(+), 7 deletions(-)
-
-diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
-index 9feb307..821b26d 100644
---- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
-@@ -514,8 +514,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
- }
- #endif
- 
--uptr internal_sigaltstack(const struct sigaltstack *ss,
--                         struct sigaltstack *oss) {
-+uptr internal_sigaltstack(const void *ss, void *oss) {
-   return internal_syscall(__NR_sigaltstack, (uptr)ss, (uptr)oss);
- }
- 
-diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
-index 086834c..3a6f4cd 100644
---- a/libsanitizer/sanitizer_common/sanitizer_linux.h
-+++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
-@@ -27,8 +26,7 @@ struct linux_dirent;
- // Syscall wrappers.
- uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
- uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
--uptr internal_sigaltstack(const struct sigaltstack* ss,
--                          struct sigaltstack* oss);
-+uptr internal_sigaltstack(const void* ss, void* oss);
- uptr internal_sigaction(int signum, const __sanitizer_kernel_sigaction_t *act,
-     __sanitizer_kernel_sigaction_t *oldact);
- uptr internal_sigprocmask(int how, __sanitizer_kernel_sigset_t *set,
-diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-index 5881202..c54894d 100644
---- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-@@ -234,7 +234,7 @@ static int TracerThread(void* argument) {
- 
-   // Alternate stack for signal handling.
-   InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
--  struct sigaltstack handler_stack;
-+  stack_t handler_stack;
-   internal_memset(&handler_stack, 0, sizeof(handler_stack));
-   handler_stack.ss_sp = handler_stack_memory.data();
-   handler_stack.ss_size = kHandlerStackSize;
-diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
-index 3259131..b8e9078 100644
---- a/libsanitizer/tsan/tsan_platform_linux.cc
-+++ b/libsanitizer/tsan/tsan_platform_linux.cc
-@@ -377,7 +377,7 @@ bool IsGlobalVar(uptr addr) {
- int ExtractResolvFDs(void *state, int *fds, int nfd) {
- #if SANITIZER_LINUX
-   int cnt = 0;
--  __res_state *statp = (__res_state*)state;
-+  struct __res_state *statp = (struct __res_state*)state;
-   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
-     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
-       fds[cnt++] = statp->_u._ext.nssocks[i];
--- 
-2.9.3
-
diff --git a/packages/gcc/stack_t.patch b/packages/gcc/stack_t.patch
deleted file mode 100644
index 48a5a47a..00000000
--- a/packages/gcc/stack_t.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 833e00c01e96f61e24cd7ec97b93fad212dc914b Mon Sep 17 00:00:00 2001
-From: doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Thu, 7 Sep 2017 07:17:17 +0000
-Subject: [PATCH] 2017-09-07  Matthias Klose  <doko@ubuntu.com>
-
-        Backported from mainline
-        2017-07-14  Jakub Jelinek  <jakub@redhat.com>
-
-        PR sanitizer/81066
-        * sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969.
-        * sanitizer_common/sanitizer_linux.cc: Likewise.
-        * sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise.
-        * tsan/tsan_platform_linux.cc: Likewise.
-
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@251829 138bc75d-0d04-0410-961f-82ee72b054a4
----
- libsanitizer/sanitizer_common/sanitizer_linux.cc              |  3 +--
- libsanitizer/sanitizer_common/sanitizer_linux.h               |  4 +---
- .../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc  |  2 +-
- libsanitizer/tsan/tsan_platform_linux.cc                      |  2 +-
- 5 files changed, 15 insertions(+), 7 deletions(-)
-
-diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cc b/libsanitizer/sanitizer_common/sanitizer_linux.cc
-index 9feb307..821b26d 100644
---- a/libsanitizer/sanitizer_common/sanitizer_linux.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_linux.cc
-@@ -514,8 +514,7 @@ uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5) {
- }
- #endif
- 
--uptr internal_sigaltstack(const struct sigaltstack *ss,
--                         struct sigaltstack *oss) {
-+uptr internal_sigaltstack(const void *ss, void *oss) {
-   return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss);
- }
- 
-diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.h b/libsanitizer/sanitizer_common/sanitizer_linux.h
-index 086834c..3a6f4cd 100644
---- a/libsanitizer/sanitizer_common/sanitizer_linux.h
-+++ b/libsanitizer/sanitizer_common/sanitizer_linux.h
-@@ -18,7 +18,6 @@
- #include "sanitizer_platform_limits_posix.h"
- 
- struct link_map;  // Opaque type returned by dlopen().
--struct sigaltstack;
- 
- namespace __sanitizer {
- // Dirent structure for getdents(). Note that this structure is different from
-@@ -27,8 +26,7 @@ struct linux_dirent;
- 
- // Syscall wrappers.
- uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
--uptr internal_sigaltstack(const struct sigaltstack* ss,
--                          struct sigaltstack* oss);
-+uptr internal_sigaltstack(const void* ss, void* oss);
- uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set,
-     __sanitizer_sigset_t *oldset);
- void internal_sigfillset(__sanitizer_sigset_t *set);
-diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-index 5881202..c54894d 100644
---- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
-@@ -234,7 +234,7 @@ static int TracerThread(void* argument) {
- 
-   // Alternate stack for signal handling.
-   InternalScopedBuffer<char> handler_stack_memory(kHandlerStackSize);
--  struct sigaltstack handler_stack;
-+  stack_t handler_stack;
-   internal_memset(&handler_stack, 0, sizeof(handler_stack));
-   handler_stack.ss_sp = handler_stack_memory.data();
-   handler_stack.ss_size = kHandlerStackSize;
-diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc
-index 3259131..b8e9078 100644
---- a/libsanitizer/tsan/tsan_platform_linux.cc
-+++ b/libsanitizer/tsan/tsan_platform_linux.cc
-@@ -377,7 +377,7 @@ bool IsGlobalVar(uptr addr) {
- int ExtractResolvFDs(void *state, int *fds, int nfd) {
- #if SANITIZER_LINUX
-   int cnt = 0;
--  __res_state *statp = (__res_state*)state;
-+  struct __res_state *statp = (struct __res_state*)state;
-   for (int i = 0; i < MAXNS && cnt < nfd; i++) {
-     if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1)
-       fds[cnt++] = statp->_u._ext.nssocks[i];
--- 
-2.9.3
-
diff --git a/packages/gcc/sys_ustat-4.9.patch b/packages/gcc/sys_ustat-4.9.patch
deleted file mode 100644
index 75453af3..00000000
--- a/packages/gcc/sys_ustat-4.9.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-The sys_ustat.h patch modified for gcc 4.9.x.
-
-diff -Naurb gcc-4.9.4.orig/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc gcc-4.9.4/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
---- gcc-4.9.4.orig/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc	2013-12-19 06:54:11.000000000 -0600
-+++ gcc-4.9.4/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc	2018-12-11 15:57:46.901800462 -0600
-@@ -81,7 +81,6 @@
- #include <sys/statvfs.h>
- #include <sys/timex.h>
- #include <sys/user.h>
--#include <sys/ustat.h>
- #include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
-@@ -163,7 +162,19 @@
-   unsigned struct_old_utsname_sz = sizeof(struct old_utsname);
-   unsigned struct_oldold_utsname_sz = sizeof(struct oldold_utsname);
-   unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
--  unsigned struct_ustat_sz = sizeof(struct ustat);
-+  // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which
-+  // has been removed from glibc 2.28.
-+#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
-+  || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \
-+  || defined(__x86_64__)
-+#define SIZEOF_STRUCT_USTAT 32
-+#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \
-+  || defined(__powerpc__) || defined(__s390__)
-+#define SIZEOF_STRUCT_USTAT 20
-+#else
-+#error Unknown size of struct ustat
-+#endif
-+  unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
- #endif // SANITIZER_LINUX
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
diff --git a/packages/gcc/sys_ustat.h.patch b/packages/gcc/sys_ustat.h.patch
deleted file mode 100644
index c65757b4..00000000
--- a/packages/gcc/sys_ustat.h.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From 9569b61168b963a6cea7b782fd350dee489ad42c Mon Sep 17 00:00:00 2001
-From: "H.J. Lu" <hjl.tools@gmail.com>
-Date: Mon, 21 May 2018 13:17:55 -0700
-Subject: [PATCH] libsanitizer: Use pre-computed size of struct ustat for Linux
-
-Cherry-pick compiler-rt revision 333213:
-
-<sys/ustat.h> has been removed from glibc 2.28 by:
-
-commit cf2478d53ad7071e84c724a986b56fe17f4f4ca7
-Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
-Date:   Sun Mar 18 11:28:59 2018 +0800
-
-    Deprecate ustat syscall interface
-
-This patch uses pre-computed size of struct ustat for Linux.
-
-	PR sanitizer/85835
-	* sanitizer_common/sanitizer_platform_limits_posix.cc: Don't
-	include <sys/ustat.h> for Linux.
-	(SIZEOF_STRUCT_USTAT): New.
-	(struct_ustat_sz): Use SIZEOF_STRUCT_USTAT for Linux.
----
- .../sanitizer_platform_limits_posix.cc            | 15 +++++++++++++--
- 1 file changed, 13 insertions(+), 2 deletions(-)
-
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-index 858bb218450..de18e56d11c 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -157,7 +157,6 @@ typedef struct user_fpregs elf_fpregset_t;
- # include <sys/procfs.h>
- #endif
- #include <sys/user.h>
--#include <sys/ustat.h>
- #include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
-@@ -250,7 +249,19 @@ namespace __sanitizer {
- #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--  unsigned struct_ustat_sz = sizeof(struct ustat);
-+  // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which
-+  // has been removed from glibc 2.28.
-+#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
-+  || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \
-+  || defined(__x86_64__)
-+#define SIZEOF_STRUCT_USTAT 32
-+#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \
-+  || defined(__powerpc__) || defined(__s390__)
-+#define SIZEOF_STRUCT_USTAT 20
-+#else
-+#error Unknown size of struct ustat
-+#endif
-+  unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
-   unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
-   unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
- #endif // SANITIZER_LINUX && !SANITIZER_ANDROID
--- 
-2.17.0
-
-
diff --git a/packages/gcc/ucontext_t-java.patch b/packages/gcc/ucontext_t-java.patch
deleted file mode 100644
index a43e0b5a..00000000
--- a/packages/gcc/ucontext_t-java.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 9b9287cde20ea57578cf07efb2a96ed4cc0da36f Mon Sep 17 00:00:00 2001
-From: doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Thu, 7 Sep 2017 07:22:07 +0000
-Subject: [PATCH] 2017-09-07  Matthias Klose  <doko@ubuntu.com>
-
-        * include/x86_64-signal.h (HANDLE_DIVIDE_OVERFLOW): Replace
-        'struct ucontext' with ucontext_t.
-        * include/i386-signal.h (HANDLE_DIVIDE_OVERFLOW): Likewise.
-        * include/s390-signal.h (HANDLE_DIVIDE_OVERFLOW): Likewise.
-
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@251832 138bc75d-0d04-0410-961f-82ee72b054a4
----
- libjava/include/i386-signal.h   | 2 +-
- libjava/include/s390-signal.h   | 2 +-
- libjava/include/x86_64-signal.h | 2 +-
- 4 files changed, 10 insertions(+), 3 deletions(-)
-
-diff --git a/libjava/include/i386-signal.h b/libjava/include/i386-signal.h
-index c2409b0..ef77e7e 100644
---- a/libjava/include/i386-signal.h
-+++ b/libjava/include/i386-signal.h
-@@ -29,7 +29,7 @@ static void _Jv_##_name (int, siginfo_t *,			\
- #define HANDLE_DIVIDE_OVERFLOW						\
- do									\
- {									\
--  struct ucontext *_uc = (struct ucontext *)_p;				\
-+  ucontext_t *_uc = (ucontext_t *)_p;					\
-   gregset_t &_gregs = _uc->uc_mcontext.gregs;				\
-   unsigned char *_eip = (unsigned char *)_gregs[REG_EIP];		\
- 									\
-diff --git a/libjava/include/s390-signal.h b/libjava/include/s390-signal.h
-index 4ca4c10..9261b52 100644
---- a/libjava/include/s390-signal.h
-+++ b/libjava/include/s390-signal.h
-@@ -51,7 +51,7 @@ do									\
-   struct                                                                \
-   {                                                                     \
-     unsigned long int uc_flags;                                         \
--    struct ucontext *uc_link;                                           \
-+    ucontext_t *uc_link;                                                \
-     stack_t uc_stack;                                                   \
-     mcontext_t uc_mcontext;                                             \
-     unsigned long sigmask[2];                                           \
-diff --git a/libjava/include/x86_64-signal.h b/libjava/include/x86_64-signal.h
-index 12383b5..e36c5a3 100644
---- a/libjava/include/x86_64-signal.h
-+++ b/libjava/include/x86_64-signal.h
-@@ -28,7 +28,7 @@ static void _Jv_##_name (int, siginfo_t *,			\
- #define HANDLE_DIVIDE_OVERFLOW						\
- do									\
- {									\
--  struct ucontext *_uc = (struct ucontext *)_p;				\
-+  ucontext_t *_uc = (ucontext_t *)_p;					\
-   gregset_t &_gregs = _uc->uc_mcontext.gregs;				\
-   unsigned char *_rip = (unsigned char *)_gregs[REG_RIP];		\
- 									\
--- 
-2.9.3
-
diff --git a/packages/gcc/ucontext_t.patch b/packages/gcc/ucontext_t.patch
deleted file mode 100644
index a4f04b47..00000000
--- a/packages/gcc/ucontext_t.patch
+++ /dev/null
@@ -1,189 +0,0 @@
-From ecf0d1a107133c715763940c2b197aa814710e1b Mon Sep 17 00:00:00 2001
-From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
-Date: Tue, 4 Jul 2017 10:25:10 +0000
-Subject: [PATCH] Use ucontext_t not struct ucontext in linux-unwind.h files.
-
-Current glibc no longer gives the ucontext_t type the tag struct
-ucontext, to conform with POSIX namespace rules.  This requires
-various linux-unwind.h files in libgcc, that were previously using
-struct ucontext, to be fixed to use ucontext_t instead.  This is
-similar to the removal of the struct siginfo tag from siginfo_t some
-years ago.
-
-This patch changes those files to use ucontext_t instead.  As the
-standard name that should be unconditionally safe, so this is not
-restricted to architectures supported by glibc, or conditioned on the
-glibc version.
-
-Tested compilation together with current glibc with glibc's
-build-many-glibcs.py.
-
-	* config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
-	config/alpha/linux-unwind.h (alpha_fallback_frame_state),
-	config/bfin/linux-unwind.h (bfin_fallback_frame_state),
-	config/i386/linux-unwind.h (x86_64_fallback_frame_state,
-	x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
-	uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
-	config/pa/linux-unwind.h (pa32_fallback_frame_state),
-	config/sh/linux-unwind.h (sh_fallback_frame_state),
-	config/tilepro/linux-unwind.h (tile_fallback_frame_state),
-	config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
-	ucontext_t instead of struct ucontext.
-
-
-git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@249958 138bc75d-0d04-0410-961f-82ee72b054a4
----
- libgcc/config/aarch64/linux-unwind.h |  2 +-
- libgcc/config/alpha/linux-unwind.h   |  2 +-
- libgcc/config/bfin/linux-unwind.h    |  2 +-
- libgcc/config/i386/linux-unwind.h    |  4 ++--
- libgcc/config/m68k/linux-unwind.h    |  2 +-
- libgcc/config/nios2/linux-unwind.h   |  2 +-
- libgcc/config/pa/linux-unwind.h      |  2 +-
- libgcc/config/sh/linux-unwind.h      |  2 +-
- libgcc/config/tilepro/linux-unwind.h |  2 +-
- libgcc/config/xtensa/linux-unwind.h  |  2 +-
- 11 files changed, 25 insertions(+), 11 deletions(-)
-
-diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
-index 86d17b1..909f68f 100644
---- a/libgcc/config/aarch64/linux-unwind.h
-+++ b/libgcc/config/aarch64/linux-unwind.h
-@@ -52,7 +52,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
-   struct rt_sigframe
-   {
-     siginfo_t info;
--    struct ucontext uc;
-+    ucontext_t uc;
-   };
- 
-   struct rt_sigframe *rt_;
-diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
-index d65474f..9a226b1 100644
---- a/libgcc/config/alpha/linux-unwind.h
-+++ b/libgcc/config/alpha/linux-unwind.h
-@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
-     {
-       struct rt_sigframe {
- 	siginfo_t info;
--	struct ucontext uc;
-+	ucontext_t uc;
-       } *rt_ = context->cfa;
-       sc = &rt_->uc.uc_mcontext;
-     }
-diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
-index 0c270e4..7fa95d2 100644
---- a/libgcc/config/bfin/linux-unwind.h
-+++ b/libgcc/config/bfin/linux-unwind.h
-@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
- 	void *puc;
- 	char retcode[8];
- 	siginfo_t info;
--	struct ucontext uc;
-+	ucontext_t uc;
-       } *rt_ = context->cfa;
- 
-       /* The void * cast is necessary to avoid an aliasing warning.
-diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
-index e54bf73..d35fc45 100644
---- a/libgcc/config/i386/linux-unwind.h
-+++ b/libgcc/config/i386/linux-unwind.h
-@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
-   if (*(unsigned char *)(pc+0) == 0x48
-       && *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
-     {
--      struct ucontext *uc_ = context->cfa;
-+      ucontext_t *uc_ = context->cfa;
-       /* The void * cast is necessary to avoid an aliasing warning.
-          The aliasing warning is correct, but should not be a problem
-          because it does not alias anything.  */
-@@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
- 	siginfo_t *pinfo;
- 	void *puc;
- 	siginfo_t info;
--	struct ucontext uc;
-+	ucontext_t uc;
-       } *rt_ = context->cfa;
-       /* The void * cast is necessary to avoid an aliasing warning.
-          The aliasing warning is correct, but should not be a problem
-diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
-index fb79a4d..b2f5ea4 100644
---- a/libgcc/config/m68k/linux-unwind.h
-+++ b/libgcc/config/m68k/linux-unwind.h
-@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
- /* <sys/ucontext.h> is unfortunately broken right now.  */
- struct uw_ucontext {
- 	unsigned long	  uc_flags;
--	struct ucontext  *uc_link;
-+	ucontext_t	 *uc_link;
- 	stack_t		  uc_stack;
- 	mcontext_t	  uc_mcontext;
- 	unsigned long	  uc_filler[80];
-diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
-index dff1c20..1d88afe 100644
---- a/libgcc/config/nios2/linux-unwind.h
-+++ b/libgcc/config/nios2/linux-unwind.h
-@@ -38,7 +38,7 @@ struct nios2_mcontext {
- 
- struct nios2_ucontext {
-   unsigned long uc_flags;
--  struct ucontext *uc_link;
-+  ucontext_t *uc_link;
-   stack_t uc_stack;
-   struct nios2_mcontext uc_mcontext;
-   sigset_t uc_sigmask;	/* mask last for extensibility */
-diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
-index 0149468..9157535 100644
---- a/libgcc/config/pa/linux-unwind.h
-+++ b/libgcc/config/pa/linux-unwind.h
-@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
-   struct sigcontext *sc;
-   struct rt_sigframe {
-     siginfo_t info;
--    struct ucontext uc;
-+    ucontext_t uc;
-   } *frame;
- 
-   /* rt_sigreturn trampoline:
-diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
-index e63091f..67033f0 100644
---- a/libgcc/config/sh/linux-unwind.h
-+++ b/libgcc/config/sh/linux-unwind.h
-@@ -180,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
-     {
-       struct rt_sigframe {
- 	siginfo_t info;
--	struct ucontext uc;
-+	ucontext_t uc;
-       } *rt_ = context->cfa;
-       /* The void * cast is necessary to avoid an aliasing warning.
-          The aliasing warning is correct, but should not be a problem
-diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
-index fd83ba7..e3c9ef0 100644
---- a/libgcc/config/tilepro/linux-unwind.h
-+++ b/libgcc/config/tilepro/linux-unwind.h
-@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
-   struct rt_sigframe {
-     unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
-     siginfo_t info;
--    struct ucontext uc;
-+    ucontext_t uc;
-   } *rt_;
- 
-   /* Return if this is not a signal handler.  */
-diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
-index 9a67b5d..98b7ea6 100644
---- a/libgcc/config/xtensa/linux-unwind.h
-+++ b/libgcc/config/xtensa/linux-unwind.h
-@@ -67,7 +67,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
- 
-   struct rt_sigframe {
-     siginfo_t info;
--    struct ucontext uc;
-+    ucontext_t uc;
-   } *rt_;
- 
-   /* movi a2, __NR_rt_sigreturn; syscall */
--- 
-2.9.3
-
diff --git a/packages/gcc/zstd.patch b/packages/gcc/zstd.patch
deleted file mode 100644
index 8fb7583a..00000000
--- a/packages/gcc/zstd.patch
+++ /dev/null
@@ -1,43 +0,0 @@
---- a/gcc/Makefile.in
-+++ b/gcc/Makefile.in
-@@ -1075,7 +1075,8 @@ GNATMAKE = @GNATMAKE@
- # Libs needed (at present) just for jcf-dump.
- LDEXP_LIB = @LDEXP_LIB@
- 
--ZSTD_LIB = @ZSTD_LIB@
-+ZSTD_INC = @ZSTD_CPPFLAGS@
-+ZSTD_LIB = @ZSTD_LDFLAGS@ @ZSTD_LIB@
- 
- # Likewise, for use in the tools that must run on this machine
- # even if we are cross-building GCC.
-@@ -2275,7 +2276,7 @@ CFLAGS-version.o += -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
- version.o: $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
- 
- # lto-compress.o needs $(ZLIBINC) added to the include flags.
--CFLAGS-lto-compress.o += $(ZLIBINC)
-+CFLAGS-lto-compress.o += $(ZLIBINC) $(ZSTD_INC)
- 
- CFLAGS-lto-streamer-in.o += -DTARGET_MACHINE=\"$(target_noncanonical)\"
- 
---- a/gcc/configure
-+++ b/gcc/configure
-@@ -786,6 +786,8 @@ LTLIBICONV
- LIBICONV
- ZSTD_LIB
- ZSTD_INCLUDE
-+ZSTD_LDFLAGS
-+ZSTD_CPPFLAGS
- DL_LIB
- LDEXP_LIB
- EXTRA_GCC_LIBS
---- a/gcc/configure.ac
-+++ b/gcc/configure.ac
-@@ -1339,6 +1339,8 @@ AC_SUBST(ZSTD_INCLUDE)
- AC_SUBST(ZSTD_LIB)
- ZSTD_CPPFLAGS=
- ZSTD_LDFLAGS=
-+AC_SUBST(ZSTD_CPPFLAGS)
-+AC_SUBST(ZSTD_LDFLAGS)
- AC_ARG_WITH(zstd,
- 	[AS_HELP_STRING([--with-zstd=PATH],
- 		[specify prefix directory for installed zstd library.
diff --git a/packages/libvips/package.py b/packages/libvips/package.py
index ab8a8849..19db301d 100644
--- a/packages/libvips/package.py
+++ b/packages/libvips/package.py
@@ -12,14 +12,26 @@ class Libvips(AutotoolsPackage):
     little memory."""
 
     homepage = "https://libvips.github.io/libvips/"
-    url = "https://github.com/libvips/libvips/releases/download/v8.9.0/vips-8.9.0.tar.gz"
+    url = "https://github.com/libvips/libvips/releases/download/v8.15.3/vips-8.15.3.tar.xz"
     git = "https://github.com/libvips/libvips.git"
 
+    license("LGPL-2.1-or-later", checked_by="wdconinc")
+
+    version("8.15.3", sha256="3e27d9f536eafad64013958fe9e8a1964c90b564c731d49db7c1a1c11b1052a0")
     version("8.13.3", sha256="4eff5cdc8dbe1a05a926290a99014e20ba386f5dcca38d9774bef61413435d4c")
     version("8.10.5", sha256="a4eef2f5334ab6dbf133cd3c6d6394d5bdb3e76d5ea4d578b02e1bc3d9e1cfd8")
     version("8.9.1", sha256="45633798877839005016c9d3494e98dee065f5cb9e20f4552d3b315b8e8bce91")
     version("8.9.0", sha256="97334a5e70aff343d2587f23cb8068fc846a58cd937c89a446142ccf00ea0349")
 
+    build_system(
+        conditional("autotools", when="@:8.13"),
+        conditional("meson", when="@8.13:"),
+        default="meson",
+    )
+
+    depends_on("c", type="build")  # generated
+    depends_on("cxx", type="build")  # generated
+
     variant("fftw", default=True, description="Uses FFTW3 for fourier transforms.")
 
     variant("jpeg", default=False, description="Enable JPEG support")
@@ -32,10 +44,7 @@ class Libvips(AutotoolsPackage):
 
     # TODO: Add more variants!
 
-    # begin EBRAINS (added)
     depends_on("pkgconfig", type="build")
-    # end EBRAINS
-
     depends_on("glib")
     depends_on("expat")
 
@@ -43,7 +52,7 @@ class Libvips(AutotoolsPackage):
     depends_on("libjpeg", when="+jpeg")
     depends_on("libtiff", when="+tiff")
     depends_on("libpng", when="+png")
-    depends_on("poppler", when="+poppler")
+    depends_on("poppler +glib", when="+poppler")
 
     # begin EBRAINS (added): to fix build errors
     depends_on("gobject-introspection")
@@ -51,3 +60,7 @@ class Libvips(AutotoolsPackage):
     depends_on("pango")
     depends_on("libtiff")
     # end EBRAINS
+
+    def url_for_version(self, version):
+        ext = "xz" if version >= Version("8.14") else "gz"
+        return f"https://github.com/libvips/libvips/releases/download/v{version}/vips-{version}.tar.{ext}"
diff --git a/packages/libxcb/package.py b/packages/libxcb/package.py
index 2cb1418c..dcaff208 100644
--- a/packages/libxcb/package.py
+++ b/packages/libxcb/package.py
@@ -6,26 +6,44 @@
 from spack.package import *
 
 
-class Libxcb(AutotoolsPackage):
+class Libxcb(AutotoolsPackage, XorgPackage):
     """The X protocol C-language Binding (XCB) is a replacement
     for Xlib featuring a small footprint, latency hiding, direct
     access to the protocol, improved threading support, and
     extensibility."""
 
     homepage = "https://xcb.freedesktop.org/"
-    url = "https://xorg.freedesktop.org/archive/individual/lib/libxcb-1.14.tar.xz"
+    xorg_mirror_path = "lib/libxcb-1.14.tar.xz"
 
+    license("MIT")
+
+    maintainers("wdconinc")
+
+    version("1.17.0", sha256="599ebf9996710fea71622e6e184f3a8ad5b43d0e5fa8c4e407123c88a59a6d55")
+    version("1.16.1", sha256="f24d187154c8e027b358fc7cb6588e35e33e6a92f11c668fe77396a7ae66e311")
+    version("1.16", sha256="4348566aa0fbf196db5e0a576321c65966189210cb51328ea2bb2be39c711d71")
+    version("1.15", sha256="cc38744f817cf6814c847e2df37fcb8997357d72fa4bcbc228ae0fe47219a059")
     version("1.14", sha256="a55ed6db98d43469801262d81dc2572ed124edc3db31059d4e9916eb9f844c34")
-    version("1.13", sha256="0bb3cfd46dbd90066bf4d7de3cad73ec1024c7325a4a0cbf5f4a0d4fa91155fb")
+    version(
+        "1.13",
+        sha256="0bb3cfd46dbd90066bf4d7de3cad73ec1024c7325a4a0cbf5f4a0d4fa91155fb",
+        url="https://xcb.freedesktop.org/dist/libxcb-1.13.tar.gz",
+        deprecated=True,
+    )
+
+    depends_on("c", type="build")  # generated
 
     depends_on("libpthread-stubs")
     depends_on("libxau@0.99.2:")
     depends_on("libxdmcp")
 
     # libxcb 1.X requires xcb-proto >= 1.X
-    depends_on("xcb-proto")
-    depends_on("xcb-proto@1.14:", when="@1.14")
-    depends_on("xcb-proto@1.13:", when="@1.13")
+    depends_on("xcb-proto", type="build")
+    depends_on("xcb-proto@1.17:", when="@1.17", type="build")
+    depends_on("xcb-proto@1.16:", when="@1.16", type="build")
+    depends_on("xcb-proto@1.15:", when="@1.15", type="build")
+    depends_on("xcb-proto@1.14:", when="@1.14", type="build")
+    depends_on("xcb-proto@1.13:", when="@1.13", type="build")
 
     # begin EBRAINS (deleted): break cyclic dependency in python+tkinter
     # depends_on("python", type="build")
@@ -33,14 +51,6 @@ class Libxcb(AutotoolsPackage):
     depends_on("pkgconfig", type="build")
     depends_on("util-macros", type="build")
 
-    def url_for_version(self, version):
-        if version >= Version("1.14"):
-            url = "https://xorg.freedesktop.org/archive/individual/lib/libxcb-{0}.tar.xz"
-        else:
-            url = "https://xcb.freedesktop.org/dist/libxcb-{0}.tar.gz"
-
-        return url.format(version)
-
     def configure_args(self):
         config_args = []
 
@@ -51,4 +61,18 @@ class Libxcb(AutotoolsPackage):
         return config_args
 
     def patch(self):
-        filter_file("typedef struct xcb_auth_info_t {", "typedef struct {", "src/xcb.h")
\ No newline at end of file
+        filter_file("typedef struct xcb_auth_info_t {", "typedef struct {", "src/xcb.h")
+
+    # libxcb fails to build with non-UTF-8 locales, see:
+    # https://www.linuxfromscratch.org/blfs/view/git/x/libxcb.html
+    # https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/53 (merged in 1.17.0)
+    # https://gitlab.freedesktop.org/xorg/lib/libxcb/-/merge_requests/60
+    # If a newer release can be verified to build with LC_ALL=en_US.ISO-8859-1,
+    # then we can limit the following function, e.g.
+    # when("@:1.17")
+    def setup_build_environment(self, env):
+        env.set("LC_ALL", "C.UTF-8")
+
+    # begin EBRAINS (deleted): break cyclic dependency in python+tkinter
+    # depends_on("python", type="build")
+    # end EBRAINS
diff --git a/packages/llvm/constexpr_longdouble.patch b/packages/llvm/constexpr_longdouble.patch
deleted file mode 100644
index 8b90001d..00000000
--- a/packages/llvm/constexpr_longdouble.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 3bf63cf3b366d3a57cf5cbad4112a6abf6c0c3b1 Mon Sep 17 00:00:00 2001
-From: Marshall Clow <mclow.lists@gmail.com>
-Date: Tue, 2 Apr 2019 14:46:36 +0000
-Subject: [PATCH] Special case some duration arithmetic for GCC and PPC because
- their long double constant folding is broken. Fixes PR#39696.
-
-llvm-svn: 357478
----
- libcxx/include/thread | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/libcxx/include/thread b/libcxx/include/thread
-index df06ff70f8e37f22f4108be8e5e79a38052a11dd..400459ae7f32c4d7cd24b2d85c49d789500e432d 100644
---- a/libcxx/include/thread
-+++ b/libcxx/include/thread
-@@ -434,7 +434,12 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d)
-     using namespace chrono;
-     if (__d > duration<_Rep, _Period>::zero())
-     {
-+#if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
-+    //  GCC's long double const folding is incomplete for IBM128 long doubles.
-+        _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
-+#else
-         _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
-+#endif
-         nanoseconds __ns;
-         if (__d < _Max)
-         {
diff --git a/packages/llvm/constexpr_longdouble_9.0.patch b/packages/llvm/constexpr_longdouble_9.0.patch
deleted file mode 100644
index 9a62f270..00000000
--- a/packages/llvm/constexpr_longdouble_9.0.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From d9a42ec98adcb1ebc0c3837715df4e5a50c7ccc0 Mon Sep 17 00:00:00 2001
-From: "Joel E. Denny" <jdenny.ornl@gmail.com>
-Date: Wed, 10 Jun 2020 12:40:43 -0400
-Subject: [PATCH] [libc++] Work around gcc/Power9 bug in `include/thread`
-
-This fixes PR39696, which breaks the libcxx build with gcc (I tested
-7.5.0) on Power9.  This fix was suggested at
-
-https://bugs.llvm.org/show_bug.cgi?id=39696#c38
-
-but never applied.  It just reverts 0583d9ea8d5e, which reverses
-components of the original fix in 3bf63cf3b366, which is correct.
-
-Fixes https://llvm.org/PR39696
-
-Reviewed By: ldionne
-
-Differential Revision: https://reviews.llvm.org/D81438
----
- libcxx/include/thread | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/libcxx/include/thread b/libcxx/include/thread
-index 22aa4f201295867cff57b7a944e6b7bd67b22ad3..6eff1800acdbef09eae4417eee977fa350c596ea 100644
---- a/libcxx/include/thread
-+++ b/libcxx/include/thread
-@@ -365,9 +365,9 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d)
-     {
- #if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
-     //  GCC's long double const folding is incomplete for IBM128 long doubles.
--        _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
--#else
-         _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
-+#else
-+        _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
- #endif
-         nanoseconds __ns;
-         if (__d < _Max)
diff --git a/packages/llvm/detection_test.yaml b/packages/llvm/detection_test.yaml
new file mode 100644
index 00000000..860b3061
--- /dev/null
+++ b/packages/llvm/detection_test.yaml
@@ -0,0 +1,104 @@
+paths:
+- layout:
+  - executables:
+    - "bin/clang-3.9"
+    - "bin/clang++-3.9"
+    script: |
+      echo "clang version 3.9.1-19ubuntu1 (tags/RELEASE_391/rc2)"
+      echo "Target: x86_64-pc-linux-gnu"
+      echo "Thread model: posix"
+      echo "InstalledDir: /usr/bin"
+  platforms: ["darwin", "linux"]
+  results:
+  - spec: 'llvm@3.9.1 +clang~lld~lldb'
+    extra_attributes:
+      compilers:
+        c: ".*/bin/clang-3.9$"
+        cxx: ".*/bin/clang[+][+]-3.9$"
+
+# `~` and other weird characters in the version string
+- layout:
+  - executables:
+    - "bin/clang-6.0"
+    - "bin/clang++-6.0"
+    script: |
+        echo "clang version 6.0.1-svn334776-1~exp1~20181018152737.116 (branches/release_60)"
+        echo "Target: x86_64-pc-linux-gnu"
+        echo "Thread model: posix"
+        echo "InstalledDir: /usr/bin",
+
+  platforms: ["darwin", "linux"]
+  results:
+  - spec: 'llvm@6.0.1 +clang~lld~lldb'
+    extra_attributes:
+      compilers:
+        c: ".*/bin/clang-6.0$"
+        cxx: ".*/bin/clang[+][+]-6.0$"
+- layout:
+  - executables:
+    - "bin/clang-9.0"
+    - "bin/clang++-9.0"
+    script: |      
+        echo "clang version 9.0.1-+201911131414230800840845a1eea-1~exp1~20191113231141.78"
+        echo "Target: x86_64-pc-linux-gnu"
+        echo "Thread model: posix"
+        echo "InstalledDir: /usr/bin"
+
+  platforms: ["darwin", "linux"]
+  results:
+  - spec: 'llvm@9.0.1 +clang~lld~lldb'
+    extra_attributes:
+      compilers:
+        c: ".*/bin/clang-9.0$"
+        cxx: ".*/bin/clang[+][+]-9.0$"
+
+# Multiple LLVM packages in the same prefix
+- layout:
+  - executables:
+    - "bin/clang-8"
+    - "bin/clang++-8"
+    script: |
+      echo "clang version 8.0.0-3~ubuntu18.04.2 (tags/RELEASE_800/final)"
+      echo "Target: x86_64-pc-linux-gnu"
+      echo "Thread model: posix"
+      echo "InstalledDir: /usr/bin"
+  - executables:
+    - "bin/ld.lld-8"
+    script: 'echo "LLD 8.0.0 (compatible with GNU linkers)"'
+  - executables:
+    - "bin/lldb"
+    script: 'echo "lldb version 8.0.0"'
+  - executables:
+    - "bin/clang-3.9"
+    - "bin/clang++-3.9"
+    script: |
+      echo "clang version 3.9.1-19ubuntu1 (tags/RELEASE_391/rc2)"
+      echo "Target: x86_64-pc-linux-gnu"
+      echo "Thread model: posix"
+      echo "InstalledDir: /usr/bin"
+  platforms: ["darwin", "linux"]
+  results:
+  - spec: 'llvm@8.0.0+clang+lld+lldb'
+    extra_attributes:
+      compilers:
+        c: ".*/bin/clang-8$"
+        cxx: ".*/bin/clang[+][+]-8$"
+
+  - spec: 'llvm@3.9.1+clang~lld~lldb'
+    extra_attributes:
+      compilers:
+        c: ".*/bin/clang-3.9$"
+        cxx: ".*/bin/clang[+][+]-3.9$"
+
+# Apple Clang should not be detected
+- layout:
+  - executables:
+    - "bin/clang"
+    - "bin/clang++"
+    script: |
+      echo "Apple clang version 11.0.0 (clang-1100.0.33.8)"
+      echo "Target: x86_64-apple-darwin19.5.0"
+      echo "Thread model: posix"
+      echo "InstalledDir: /Library/Developer/CommandLineTools/usr/bin"
+  platforms: ["darwin"]
+  results: []
diff --git a/packages/llvm/libomp-libflags-as-list.patch b/packages/llvm/libomp-libflags-as-list.patch
deleted file mode 100644
index 995f55a4..00000000
--- a/packages/llvm/libomp-libflags-as-list.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/openmp/runtime/cmake/LibompHandleFlags.cmake b/openmp/runtime/cmake/LibompHandleFlags.cmake
-index 9e19e59ba17d..f92fa12d851a 100644
---- a/openmp/runtime/cmake/LibompHandleFlags.cmake
-+++ b/openmp/runtime/cmake/LibompHandleFlags.cmake
-@@ -144,7 +144,8 @@ function(libomp_get_libflags libflags)
-   endif()
-   set(libflags_local ${libflags_local} ${LIBOMP_LIBFLAGS})
-   libomp_setup_flags(libflags_local)
--  set(${libflags} ${libflags_local} PARENT_SCOPE)
-+  libomp_string_to_list("${libflags_local}" libflags_local_list)
-+  set(${libflags} ${libflags_local_list} PARENT_SCOPE)
- endfunction()
-
- # Fortran flags
diff --git a/packages/llvm/lldb_external_ncurses-10.patch b/packages/llvm/lldb_external_ncurses-10.patch
deleted file mode 100644
index 34ed0e3c..00000000
--- a/packages/llvm/lldb_external_ncurses-10.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-diff --git a/lldb/include/lldb/Host/Config.h.cmake b/lldb/include/lldb/Host/Config.h.cmake
---- a/lldb/include/lldb/Host/Config.h.cmake
-+++ b/lldb/include/lldb/Host/Config.h.cmake
-@@ -38,6 +38,8 @@
- 
- #cmakedefine01 LLDB_ENABLE_CURSES
- 
-+#cmakedefine01 CURSES_HAVE_NCURSES_CURSES_H
-+
- #cmakedefine01 LLDB_ENABLE_LIBEDIT
- 
- #cmakedefine01 LLDB_ENABLE_LIBXML2
-diff --git a/lldb/source/Core/IOHandlerCursesGUI.cpp b/lldb/source/Core/IOHandlerCursesGUI.cpp
---- a/lldb/source/Core/IOHandlerCursesGUI.cpp
-+++ b/lldb/source/Core/IOHandlerCursesGUI.cpp
-@@ -10,9 +10,14 @@
- #include "lldb/Host/Config.h"
- 
- #if LLDB_ENABLE_CURSES
-+#if CURSES_HAVE_NCURSES_CURSES_H
-+#include <ncurses/curses.h>
-+#include <ncurses/panel.h>
-+#else
- #include <curses.h>
- #include <panel.h>
- #endif
-+#endif
- 
- #if defined(__APPLE__)
- #include <deque>
-
diff --git a/packages/llvm/llvm-gcc11.patch b/packages/llvm/llvm-gcc11.patch
deleted file mode 100644
index 8e081e87..00000000
--- a/packages/llvm/llvm-gcc11.patch
+++ /dev/null
@@ -1,9 +0,0 @@
---- a/llvm/utils/benchmark/src/benchmark_register.h
-+++ b/llvm/utils/benchmark/src/benchmark_register.h
-@@ -2,6 +2,7 @@
- #define BENCHMARK_REGISTER_H
- 
- #include <vector>
-+#include <limits>
- 
- #include "check.h"
diff --git a/packages/llvm/llvm13-thread.patch b/packages/llvm/llvm13-thread.patch
deleted file mode 100644
index 0067a930..00000000
--- a/packages/llvm/llvm13-thread.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- spack-src/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake.org	2022-02-08 14:58:13.000000000 +0900
-+++ spack-src/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake	2022-02-08 13:58:53.000000000 +0900
-@@ -276,4 +276,5 @@
-   endif()
- endif()
-
--set(OPENMP_PTHREAD_LIB ${LLVM_PTHREAD_LIB})
-+find_package(Threads REQUIRED)
-+set(OPENMP_PTHREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
---- spack-src/openmp/libomptarget/src/CMakeLists.txt.org	2022-02-09 08:49:35.000000000 +0900
-+++ spack-src/openmp/libomptarget/src/CMakeLists.txt	2022-02-09 08:50:18.000000000 +0900
-@@ -36,6 +36,7 @@
- endif()
- target_link_libraries(omptarget PRIVATE
-   ${CMAKE_DL_LIBS}
-+  ${OPENMP_PTHREAD_LIB}
-   "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
- 
- # Install libomptarget under the lib destination folder.
diff --git a/packages/llvm/llvm14-hwloc-ompd.patch b/packages/llvm/llvm14-hwloc-ompd.patch
deleted file mode 100644
index bdae92e0..00000000
--- a/packages/llvm/llvm14-hwloc-ompd.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/openmp/libompd/src/CMakeLists.txt
-+++ b/openmp/libompd/src/CMakeLists.txt
-@@ -44,6 +44,10 @@
-         ${LIBOMP_SRC_DIR}
- )
-
-+if(${LIBOMP_USE_HWLOC})
-+  include_directories(${LIBOMP_HWLOC_INSTALL_DIR}/include)
-+endif()
-+
- INSTALL( TARGETS ompd
-         LIBRARY DESTINATION ${OPENMP_INSTALL_LIBDIR}
-         ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR}
diff --git a/packages/llvm/llvm17-18-thread.patch b/packages/llvm/llvm17-18-thread.patch
new file mode 100644
index 00000000..7e337433
--- /dev/null
+++ b/packages/llvm/llvm17-18-thread.patch
@@ -0,0 +1,22 @@
+diff --git a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+index 1f2a50667c4f..d3ff232f6bd3 100644
+--- a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
++++ b/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+@@ -280,4 +280,5 @@ if (NOT LIBOMPTARGET_CUDA_TOOLKIT_ROOT_DIR_PRESET AND
+   endif()
+ endif()
+ 
+-set(OPENMP_PTHREAD_LIB ${LLVM_PTHREAD_LIB})
++find_package(Threads REQUIRED)
++set(OPENMP_PTHREAD_LIB Threads::Threads)
+diff --git a/openmp/libomptarget/src/CMakeLists.txt b/openmp/libomptarget/src/CMakeLists.txt
+index 071ec61889a2..b782c3b07e6f 100644
+--- a/openmp/libomptarget/src/CMakeLists.txt.orig	2024-03-26 14:30:52.000000000 +0900
++++ b/openmp/libomptarget/src/CMakeLists.txt	2024-03-26 14:34:02.000000000 +0900
+@@ -41,5 +41,6 @@
+ 
+ if (LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
+   target_link_libraries(omptarget PRIVATE
++    ${OPENMP_PTHREAD_LIB}
+     "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports")
+ endif()
diff --git a/packages/llvm/llvm17-fujitsu.patch b/packages/llvm/llvm17-fujitsu.patch
new file mode 100644
index 00000000..f960830c
--- /dev/null
+++ b/packages/llvm/llvm17-fujitsu.patch
@@ -0,0 +1,28 @@
+diff --git a/lldb/include/lldb/Utility/LLDBAssert.h_org b/lldb/include/lldb/Utility/LLDBAssert.h
+index aeef3e5..2f14ff3 100644
+--- a/lldb/include/lldb/Utility/LLDBAssert.h_org
++++ b/lldb/include/lldb/Utility/LLDBAssert.h
+@@ -14,7 +14,7 @@
+ #ifndef NDEBUG
+ #define lldbassert(x) assert(x)
+ #else
+-#if defined(__clang__)
++#if defined(__clang__) && !defined(__CLANG_FUJITSU)
+ // __FILE_NAME__ is a Clang-specific extension that functions similar to
+ // __FILE__ but only renders the last path component (the filename) instead of
+ // an invocation dependent full path to that file.
+
+diff --git runtimes/CMakeLists.txt_org runtimes/CMakeLists.txt
+--- a/runtimes/CMakeLists.txt_org
++++ b/runtimes/CMakeLists.txt
+@@ -6,2 +6,2 @@
+ include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
+   NO_POLICY_SCOPE)
+
++string(REPLACE "-Nclang" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
++string(REPLACE "-Nnofjprof" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
++string(REPLACE "-Nfjprof" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
++
+ project(Runtimes C CXX ASM)
+
+ list(INSERT CMAKE_MODULE_PATH 0
diff --git a/packages/llvm/llvm4-lld-ELF-Symbols.patch b/packages/llvm/llvm4-lld-ELF-Symbols.patch
deleted file mode 100644
index 1a86cda3..00000000
--- a/packages/llvm/llvm4-lld-ELF-Symbols.patch
+++ /dev/null
@@ -1,112 +0,0 @@
---- a/lldb/include/lldb/Utility/TaskPool.h
-+++ b/lldb/include/lldb/Utility/TaskPool.h
-@@ -33,6 +33,7 @@
- #include <queue>
- #include <thread>
- #include <vector>
-+#include <functional>
- 
- // Global TaskPool class for running tasks in parallel on a set of worker thread
- // created the first
-# Fix lld templates: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230463
---- a/lld/ELF/LTO.cpp
-+++ b/lld/ELF/LTO.cpp
-@@ -158,7 +158,7 @@
-   return Ret;
- }
- 
--template void BitcodeCompiler::template add<ELF32LE>(BitcodeFile &);
--template void BitcodeCompiler::template add<ELF32BE>(BitcodeFile &);
--template void BitcodeCompiler::template add<ELF64LE>(BitcodeFile &);
--template void BitcodeCompiler::template add<ELF64BE>(BitcodeFile &);
-+template void BitcodeCompiler::add<ELF32LE>(BitcodeFile &);
-+template void BitcodeCompiler::add<ELF32BE>(BitcodeFile &);
-+template void BitcodeCompiler::add<ELF64LE>(BitcodeFile &);
-+template void BitcodeCompiler::add<ELF64BE>(BitcodeFile &);
---- a/lld/ELF/Symbols.cpp
-+++ b/lld/ELF/Symbols.cpp
-@@ -343,45 +343,45 @@
- template bool SymbolBody::hasThunk<ELF64LE>() const;
- template bool SymbolBody::hasThunk<ELF64BE>() const;
- 
--template uint32_t SymbolBody::template getVA<ELF32LE>(uint32_t) const;
--template uint32_t SymbolBody::template getVA<ELF32BE>(uint32_t) const;
--template uint64_t SymbolBody::template getVA<ELF64LE>(uint64_t) const;
--template uint64_t SymbolBody::template getVA<ELF64BE>(uint64_t) const;
--
--template uint32_t SymbolBody::template getGotVA<ELF32LE>() const;
--template uint32_t SymbolBody::template getGotVA<ELF32BE>() const;
--template uint64_t SymbolBody::template getGotVA<ELF64LE>() const;
--template uint64_t SymbolBody::template getGotVA<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getGotOffset<ELF32LE>() const;
--template uint32_t SymbolBody::template getGotOffset<ELF32BE>() const;
--template uint64_t SymbolBody::template getGotOffset<ELF64LE>() const;
--template uint64_t SymbolBody::template getGotOffset<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getGotPltVA<ELF32LE>() const;
--template uint32_t SymbolBody::template getGotPltVA<ELF32BE>() const;
--template uint64_t SymbolBody::template getGotPltVA<ELF64LE>() const;
--template uint64_t SymbolBody::template getGotPltVA<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getThunkVA<ELF32LE>() const;
--template uint32_t SymbolBody::template getThunkVA<ELF32BE>() const;
--template uint64_t SymbolBody::template getThunkVA<ELF64LE>() const;
--template uint64_t SymbolBody::template getThunkVA<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getGotPltOffset<ELF32LE>() const;
--template uint32_t SymbolBody::template getGotPltOffset<ELF32BE>() const;
--template uint64_t SymbolBody::template getGotPltOffset<ELF64LE>() const;
--template uint64_t SymbolBody::template getGotPltOffset<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getPltVA<ELF32LE>() const;
--template uint32_t SymbolBody::template getPltVA<ELF32BE>() const;
--template uint64_t SymbolBody::template getPltVA<ELF64LE>() const;
--template uint64_t SymbolBody::template getPltVA<ELF64BE>() const;
--
--template uint32_t SymbolBody::template getSize<ELF32LE>() const;
--template uint32_t SymbolBody::template getSize<ELF32BE>() const;
--template uint64_t SymbolBody::template getSize<ELF64LE>() const;
--template uint64_t SymbolBody::template getSize<ELF64BE>() const;
-+template uint32_t SymbolBody::getVA<ELF32LE>(uint32_t) const;
-+template uint32_t SymbolBody::getVA<ELF32BE>(uint32_t) const;
-+template uint64_t SymbolBody::getVA<ELF64LE>(uint64_t) const;
-+template uint64_t SymbolBody::getVA<ELF64BE>(uint64_t) const;
-+
-+template uint32_t SymbolBody::getGotVA<ELF32LE>() const;
-+template uint32_t SymbolBody::getGotVA<ELF32BE>() const;
-+template uint64_t SymbolBody::getGotVA<ELF64LE>() const;
-+template uint64_t SymbolBody::getGotVA<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getGotOffset<ELF32LE>() const;
-+template uint32_t SymbolBody::getGotOffset<ELF32BE>() const;
-+template uint64_t SymbolBody::getGotOffset<ELF64LE>() const;
-+template uint64_t SymbolBody::getGotOffset<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getGotPltVA<ELF32LE>() const;
-+template uint32_t SymbolBody::getGotPltVA<ELF32BE>() const;
-+template uint64_t SymbolBody::getGotPltVA<ELF64LE>() const;
-+template uint64_t SymbolBody::getGotPltVA<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getThunkVA<ELF32LE>() const;
-+template uint32_t SymbolBody::getThunkVA<ELF32BE>() const;
-+template uint64_t SymbolBody::getThunkVA<ELF64LE>() const;
-+template uint64_t SymbolBody::getThunkVA<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getGotPltOffset<ELF32LE>() const;
-+template uint32_t SymbolBody::getGotPltOffset<ELF32BE>() const;
-+template uint64_t SymbolBody::getGotPltOffset<ELF64LE>() const;
-+template uint64_t SymbolBody::getGotPltOffset<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getPltVA<ELF32LE>() const;
-+template uint32_t SymbolBody::getPltVA<ELF32BE>() const;
-+template uint64_t SymbolBody::getPltVA<ELF64LE>() const;
-+template uint64_t SymbolBody::getPltVA<ELF64BE>() const;
-+
-+template uint32_t SymbolBody::getSize<ELF32LE>() const;
-+template uint32_t SymbolBody::getSize<ELF32BE>() const;
-+template uint64_t SymbolBody::getSize<ELF64LE>() const;
-+template uint64_t SymbolBody::getSize<ELF64BE>() const;
- 
- template class elf::Undefined<ELF32LE>;
- template class elf::Undefined<ELF32BE>;
diff --git a/packages/llvm/llvm5-lld-ELF-Symbols.patch b/packages/llvm/llvm5-lld-ELF-Symbols.patch
deleted file mode 100644
index 727647d3..00000000
--- a/packages/llvm/llvm5-lld-ELF-Symbols.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-# Fix lld templates: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230463
---- a/lld/ELF/Symbols.cpp
-+++ b/lld/ELF/Symbols.cpp
-@@ -383,17 +383,17 @@
-   return B.getName();
- }
- 
--template uint32_t SymbolBody::template getSize<ELF32LE>() const;
--template uint32_t SymbolBody::template getSize<ELF32BE>() const;
--template uint64_t SymbolBody::template getSize<ELF64LE>() const;
--template uint64_t SymbolBody::template getSize<ELF64BE>() const;
-+template uint32_t SymbolBody::getSize<ELF32LE>() const;
-+template uint32_t SymbolBody::getSize<ELF32BE>() const;
-+template uint64_t SymbolBody::getSize<ELF64LE>() const;
-+template uint64_t SymbolBody::getSize<ELF64BE>() const;
- 
--template bool DefinedRegular::template isMipsPIC<ELF32LE>() const;
--template bool DefinedRegular::template isMipsPIC<ELF32BE>() const;
--template bool DefinedRegular::template isMipsPIC<ELF64LE>() const;
--template bool DefinedRegular::template isMipsPIC<ELF64BE>() const;
-+template bool DefinedRegular::isMipsPIC<ELF32LE>() const;
-+template bool DefinedRegular::isMipsPIC<ELF32BE>() const;
-+template bool DefinedRegular::isMipsPIC<ELF64LE>() const;
-+template bool DefinedRegular::isMipsPIC<ELF64BE>() const;
- 
--template uint32_t SharedSymbol::template getAlignment<ELF32LE>() const;
--template uint32_t SharedSymbol::template getAlignment<ELF32BE>() const;
--template uint32_t SharedSymbol::template getAlignment<ELF64LE>() const;
--template uint32_t SharedSymbol::template getAlignment<ELF64BE>() const;
-+template uint32_t SharedSymbol::getAlignment<ELF32LE>() const;
-+template uint32_t SharedSymbol::getAlignment<ELF32BE>() const;
-+template uint32_t SharedSymbol::getAlignment<ELF64LE>() const;
-+template uint32_t SharedSymbol::getAlignment<ELF64BE>() const;
diff --git a/packages/llvm/llvm5-sanitizer-ustat.patch b/packages/llvm/llvm5-sanitizer-ustat.patch
deleted file mode 100644
index 531a3c5d..00000000
--- a/packages/llvm/llvm5-sanitizer-ustat.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-# <sys/ustat.h> has been removed from glibc 2.28,
-# backport fix from llvm-6.0.1:
---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
-@@ -159,1 +159,0 @@
--#include <sys/ustat.h>
-@@ -252,5 +252,17 @@
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--  unsigned struct_ustat_sz = sizeof(struct ustat);
-+  // Use pre-computed size of struct ustat to avoid <sys/ustat.h> which
-+  // has been removed from glibc 2.28.
-+#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \
-+  || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \
-+  || defined(__x86_64__)
-+#define SIZEOF_STRUCT_USTAT 32
-+#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \
-+  || defined(__powerpc__) || defined(__s390__)
-+#define SIZEOF_STRUCT_USTAT 20
-+#else
-+#error Unknown size of struct ustat
-+#endif
-+  unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT;
-   unsigned struct_rlimit64_sz = sizeof(struct rlimit64);
-   unsigned struct_statvfs64_sz = sizeof(struct statvfs64);
diff --git a/packages/llvm/llvm_py37.patch b/packages/llvm/llvm_py37.patch
deleted file mode 100644
index 478be879..00000000
--- a/packages/llvm/llvm_py37.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From ecdefed7f6ba11421fe1ecc6c13a135ab7bcda73 Mon Sep 17 00:00:00 2001
-From: Pavel Labath <labath@google.com>
-Date: Mon, 23 Jul 2018 11:37:36 +0100
-Subject: [PATCH] Fix PythonString::GetString for >=python-3.7
-
-The return value of PyUnicode_AsUTF8AndSize is now "const char *".
----
- .../Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp  | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/tools/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
-index 6a9d57d5a..94f16b2c7 100644
---- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
-+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
-@@ -404,14 +404,16 @@ llvm::StringRef PythonString::GetString() const {
-     return llvm::StringRef();
- 
-   Py_ssize_t size;
--  char *c;
-+  const char *data;
- 
- #if PY_MAJOR_VERSION >= 3
--  c = PyUnicode_AsUTF8AndSize(m_py_obj, &size);
-+  data = PyUnicode_AsUTF8AndSize(m_py_obj, &size);
- #else
-+  char *c;
-   PyString_AsStringAndSize(m_py_obj, &c, &size);
-+  data = c;
- #endif
--  return llvm::StringRef(c, size);
-+  return llvm::StringRef(data, size);
- }
- 
- size_t PythonString::GetSize() const {
--- 
-2.18.0.233.g985f88cf7e-goog
-
diff --git a/packages/llvm/llvm_python_path.patch b/packages/llvm/llvm_python_path.patch
deleted file mode 100644
index 9f821cc3..00000000
--- a/packages/llvm/llvm_python_path.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
-index dab55707338..6f4c6791141 100644
---- a/compiler-rt/cmake/Modules/AddCompilerRT.cmake
-+++ b/compiler-rt/cmake/Modules/AddCompilerRT.cmake
-@@ -612,6 +612,9 @@ macro(add_custom_libcxx name prefix)
-     CMAKE_OBJDUMP
-     CMAKE_STRIP
-     CMAKE_SYSROOT
-+    PYTHON_EXECUTABLE
-+    Python3_EXECUTABLE
-+    Python2_EXECUTABLE
-     CMAKE_SYSTEM_NAME)
-   foreach(variable ${PASSTHROUGH_VARIABLES})
-     get_property(is_value_set CACHE ${variable} PROPERTY VALUE SET)
diff --git a/packages/llvm/missing-includes.patch b/packages/llvm/missing-includes.patch
deleted file mode 100644
index e88b8fcf..00000000
--- a/packages/llvm/missing-includes.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-# https://github.com/spack/spack/issues/24270 (This hunk is upstream since llvm-10)
---- a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
-+++ b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
-@@ -4,6 +4,8 @@
- #include "llvm/Demangle/Compiler.h"
- #include "llvm/Demangle/StringView.h"
- #include <array>
-+#include <cstdint>
-+#include <string>
- 
- class OutputStream;
- 
-# https://github.com/spack/spack/pull/27233
---- a/llvm/utils/benchmark/src/benchmark_register.h
-+++ b/llvm/utils/benchmark/src/benchmark_register.h
-@@ -2,6 +2,7 @@
- #define BENCHMARK_REGISTER_H
- 
- #include <vector>
-+#include <limits>
- 
- #include "check.h"
- 
diff --git a/packages/llvm/no_cyclades.patch b/packages/llvm/no_cyclades.patch
deleted file mode 100644
index 10f9d079..00000000
--- a/packages/llvm/no_cyclades.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
---- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
-@@ -370,15 +370,6 @@
- 
- #if SANITIZER_GLIBC
-   // _(SIOCDEVPLIP, WRITE, struct_ifreq_sz); // the same as EQL_ENSLAVE
--  _(CYGETDEFTHRESH, WRITE, sizeof(int));
--  _(CYGETDEFTIMEOUT, WRITE, sizeof(int));
--  _(CYGETMON, WRITE, struct_cyclades_monitor_sz);
--  _(CYGETTHRESH, WRITE, sizeof(int));
--  _(CYGETTIMEOUT, WRITE, sizeof(int));
--  _(CYSETDEFTHRESH, NONE, 0);
--  _(CYSETDEFTIMEOUT, NONE, 0);
--  _(CYSETTHRESH, NONE, 0);
--  _(CYSETTIMEOUT, NONE, 0);
-   _(EQL_EMANCIPATE, WRITE, struct_ifreq_sz);
-   _(EQL_ENSLAVE, WRITE, struct_ifreq_sz);
-   _(EQL_GETMASTRCFG, WRITE, struct_ifreq_sz);
-diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
-@@ -983,7 +983,6 @@
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
- extern unsigned struct_ax25_parms_struct_sz;
--extern unsigned struct_cyclades_monitor_sz;
- extern unsigned struct_input_keymap_entry_sz;
- extern unsigned struct_ipx_config_data_sz;
- extern unsigned struct_kbdiacrs_sz;
-@@ -1328,15 +1327,6 @@
- #endif  // SANITIZER_LINUX
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--extern unsigned IOCTL_CYGETDEFTHRESH;
--extern unsigned IOCTL_CYGETDEFTIMEOUT;
--extern unsigned IOCTL_CYGETMON;
--extern unsigned IOCTL_CYGETTHRESH;
--extern unsigned IOCTL_CYGETTIMEOUT;
--extern unsigned IOCTL_CYSETDEFTHRESH;
--extern unsigned IOCTL_CYSETDEFTIMEOUT;
--extern unsigned IOCTL_CYSETTHRESH;
--extern unsigned IOCTL_CYSETTIMEOUT;
- extern unsigned IOCTL_EQL_EMANCIPATE;
- extern unsigned IOCTL_EQL_ENSLAVE;
- extern unsigned IOCTL_EQL_GETMASTRCFG;
-diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
---- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
-+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
-@@ -143,7 +143,6 @@
- # include <sys/procfs.h>
- #endif
- #include <sys/user.h>
--#include <linux/cyclades.h>
- #include <linux/if_eql.h>
- #include <linux/if_plip.h>
- #include <linux/lp.h>
-@@ -460,7 +459,6 @@
- 
- #if SANITIZER_GLIBC
-   unsigned struct_ax25_parms_struct_sz = sizeof(struct ax25_parms_struct);
--  unsigned struct_cyclades_monitor_sz = sizeof(struct cyclades_monitor);
- #if EV_VERSION > (0x010000)
-   unsigned struct_input_keymap_entry_sz = sizeof(struct input_keymap_entry);
- #else
-@@ -824,15 +822,6 @@
- #endif // SANITIZER_LINUX
- 
- #if SANITIZER_LINUX && !SANITIZER_ANDROID
--  unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
--  unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
--  unsigned IOCTL_CYGETMON = CYGETMON;
--  unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
--  unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
--  unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
--  unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
--  unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
--  unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;
-   unsigned IOCTL_EQL_EMANCIPATE = EQL_EMANCIPATE;
-   unsigned IOCTL_EQL_ENSLAVE = EQL_ENSLAVE;
-   unsigned IOCTL_EQL_GETMASTRCFG = EQL_GETMASTRCFG;
diff --git a/packages/llvm/package.py b/packages/llvm/package.py
index c6cf4897..b437b0ee 100644
--- a/packages/llvm/package.py
+++ b/packages/llvm/package.py
@@ -2,20 +2,40 @@
 # Spack Project Developers. See the top-level COPYRIGHT file for details.
 #
 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
 import os
 import os.path
 import re
 import sys
 
 import llnl.util.tty as tty
+from llnl.util.lang import classproperty
 
-import spack.build_environment
 import spack.util.executable
+from spack.build_systems.cmake import get_cmake_prefix_path
 from spack.package import *
+from spack.package_base import PackageBase
+
+
+class LlvmDetection(PackageBase):
+    """Base class to detect LLVM based compilers"""
+
+    compiler_version_argument = "--version"
+    c_names = ["clang"]
+    cxx_names = ["clang++"]
+
+    @classmethod
+    def filter_detected_exes(cls, prefix, exes_in_prefix):
+        # Executables like lldb-vscode-X are daemon listening on some port and would hang Spack
+        # during detection. clang-cl, clang-cpp, etc. are dev tools that we don't need to test
+        reject = re.compile(
+            r"-(vscode|cpp|cl|ocl|gpu|tidy|rename|scan-deps|format|refactor|offload|"
+            r"check|query|doc|move|extdef|apply|reorder|change-namespace|"
+            r"include-fixer|import-test|dap|server)"
+        )
+        return [x for x in exes_in_prefix if not reject.search(x)]
 
 
-class Llvm(CMakePackage, CudaPackage):
+class Llvm(CMakePackage, CudaPackage, LlvmDetection, CompilerPackage):
     """The LLVM Project is a collection of modular and reusable compiler and
     toolchain technologies. Despite its name, LLVM has little to do
     with traditional virtual machines, though it does provide helpful
@@ -29,13 +49,28 @@ class Llvm(CMakePackage, CudaPackage):
     git = "https://github.com/llvm/llvm-project"
     maintainers("trws", "haampie", "skosukhin")
 
-    tags = ["e4s"]
+    tags = ["e4s", "compiler"]
 
     generator("ninja")
 
-    family = "compiler"  # Used by lmod
+    license("Apache-2.0")
 
     version("main", branch="main")
+    version("19.1.3", sha256="e5106e2bef341b3f5e41340e4b6c6a58259f4021ad801acf14e88f1a84567b05")
+    version("19.1.2", sha256="622cb6c5e95a3bb7e9876c4696a65671f235bd836cfd0c096b272f6c2ada41e7")
+    version("19.1.1", sha256="115dfd98a353d05bffdab3f80db22f159da48aca0124e8c416f437adcd54b77f")
+    version("19.1.0", sha256="0a08341036ca99a106786f50f9c5cb3fbe458b3b74cab6089fd368d0edb2edfe")
+    version("18.1.8", sha256="09c08693a9afd6236f27a2ebae62cda656eba19021ef3f94d59e931d662d4856")
+    version("18.1.7", sha256="b60df7cbe02cef2523f7357120fb0d46cbb443791cde3a5fb36b82c335c0afc9")
+    version("18.1.6", sha256="01390edfae5b809e982b530ff9088e674c62b13aa92cb9dc1e067fa2cf501083")
+    version("18.1.5", sha256="d543309f55ae3f9b422108302b45c40f5696c96862f4bda8f5526955daa54284")
+    version("18.1.4", sha256="deca5a29e8b1d103ecc4badb3c304aca50d5cac6453364d88ee415dc55699dfb")
+    version("18.1.3", sha256="fc5a2fd176d73ceb17f4e522f8fe96d8dde23300b8c233476d3609f55d995a7a")
+    version("18.1.2", sha256="8d686d5ece6f12b09985cb382a3a530dc06bb6e7eb907f57c7f8bf2d868ebb0b")
+    version("18.1.1", sha256="62439f733311869dbbaf704ce2e02141d2a07092d952fc87ef52d1d636a9b1e4")
+    version("18.1.0", sha256="eb18f65a68981e94ea1a5aae4f02321b17da9e99f76bfdb983b953f4ba2d3550")
+    version("17.0.6", sha256="81494d32e6f12ea6f73d6d25424dbd2364646011bb8f7e345ca870750aa27de1")
+    version("17.0.5", sha256="432c1eda3d1c9379cd52a9bee8e0ea6f7b204bff5075895f963fd8e575aa4fb8")
     version("17.0.4", sha256="46200b79f52a02fe26d0a43fd856ab6ceff49ab2a0b7c240ac4b700a6ada700c")
     version("17.0.3", sha256="1e3d9d04fb5fbd8d0080042ad72c7e2a5c68788b014b186647a604dbbdd625d2")
     version("17.0.2", sha256="dcba3eb486973dce45b6edfe618f3f29b703ae7e6ef9df65182fb50fb6fe4235")
@@ -83,6 +118,9 @@ class Llvm(CMakePackage, CudaPackage):
     version("5.0.1", sha256="84ca454abf262579814a2a2b846569f6e0cb3e16dc33ca3642b4f1dff6fbafd3")
     version("5.0.0", sha256="1f1843315657a4371d8ca37f01265fa9aae17dbcf46d2d0a95c1fdb3c6a4bab6")
 
+    depends_on("c", type="build")
+    depends_on("cxx", type="build")
+
     variant(
         "clang", default=True, description="Build the LLVM C/C++/Objective-C compiler frontend"
     )
@@ -131,8 +169,12 @@ class Llvm(CMakePackage, CudaPackage):
         "or as a project (with the compiler in use)",
     )
 
+    variant("offload", default=True, when="@19:", description="Build the Offload subproject")
+    conflicts("+offload", when="~clang")
+
     variant("libomptarget", default=True, description="Build the OpenMP offloading library")
     conflicts("+libomptarget", when="~clang")
+    conflicts("+libomptarget", when="~offload @19:")
     for _p in ["darwin", "windows"]:
         conflicts("+libomptarget", when="platform={0}".format(_p))
     del _p
@@ -239,6 +281,8 @@ class Llvm(CMakePackage, CudaPackage):
     conflicts("+z3", when="~clang")
     conflicts("+lua", when="@:10")
     conflicts("+lua", when="~lldb")
+    # Python distutils were removed with 3.12 and are required to build LLVM <= 14
+    conflicts("^python@3.12:", when="@:14")
 
     variant(
         "zstd",
@@ -247,6 +291,9 @@ class Llvm(CMakePackage, CudaPackage):
         description="Enable zstd support for static analyzer / lld",
     )
 
+    provides("libllvm@19", when="@19.0.0:19")
+    provides("libllvm@18", when="@18.0.0:18")
+    provides("libllvm@17", when="@17.0.0:17")
     provides("libllvm@16", when="@16.0.0:16")
     provides("libllvm@15", when="@15.0.0:15")
     provides("libllvm@14", when="@14.0.0:14")
@@ -308,19 +355,15 @@ class Llvm(CMakePackage, CudaPackage):
         depends_on("swig", when="+lua")
         depends_on("swig", when="+python")
         depends_on("xz")
-        # begin VISIONS: modified, bring upstream FIXME: maybe no longer needed
-        depends_on("swig@2:4.0", when="@10:")
-        depends_on("swig@3:4.0", when="@12:")
-        # end VISIONS
-
-    # Use ^swig cause it's triggered by both python & lua scripting in lldb
-    with when("^swig"):
-        depends_on("swig@2:", when="@10:")
-        depends_on("swig@3:", when="@12:")
-        depends_on("swig@4:", when="@17:")
-        # Commits f0a25fe0b746f56295d5c02116ba28d2f965c175 and
-        # 81fc5f7909a4ef5a8d4b5da2a10f77f7cb01ba63 fixed swig 4.1 support
-        depends_on("swig@:4.0", when="@:15")
+
+    for _when_spec in ("+lldb+python", "+lldb+lua"):
+        with when(_when_spec):
+            depends_on("swig@2:", when="@10:")
+            depends_on("swig@3:", when="@12:")
+            depends_on("swig@4:", when="@17:")
+            # Commits f0a25fe0b746f56295d5c02116ba28d2f965c175 and
+            # 81fc5f7909a4ef5a8d4b5da2a10f77f7cb01ba63 fixed swig 4.1 support
+            depends_on("swig@:4.0", when="@:15")
 
     # gold support, required for some features
     depends_on("binutils+gold+ld+plugins+headers", when="+gold")
@@ -384,6 +427,19 @@ class Llvm(CMakePackage, CudaPackage):
     # cuda_arch value must be specified
     conflicts("cuda_arch=none", when="+cuda", msg="A value for cuda_arch must be specified.")
 
+    # clang/test/Misc/target-invalid-cpu-note.c
+    conflicts("cuda_arch=10")
+    conflicts("cuda_arch=11")
+    conflicts("cuda_arch=12")
+    conflicts("cuda_arch=13")
+    conflicts("cuda_arch=75", when="@:13")
+    conflicts("cuda_arch=80", when="@:13")
+    conflicts("cuda_arch=86", when="@:13")
+    conflicts("cuda_arch=87", when="@:15")
+    conflicts("cuda_arch=89", when="@:15")
+    conflicts("cuda_arch=90", when="@:15")
+    conflicts("cuda_arch=90a", when="@:17")
+
     # LLVM bug https://bugs.llvm.org/show_bug.cgi?id=48234
     # CMake bug: https://gitlab.kitware.com/cmake/cmake/-/issues/21469
     # Fixed in upstream versions of both
@@ -486,6 +542,12 @@ class Llvm(CMakePackage, CudaPackage):
         when="@14:15",
     )
 
+    # missing <cstdint> include
+    patch(
+        "https://github.com/llvm/llvm-project/commit/ff1681ddb303223973653f7f5f3f3435b48a1983.patch?full_index=1",
+        sha256="c6ca6b925f150e8644ce756023797b7f94c9619c62507231f979edab1c09af78",
+        when="@6:13",
+    )
     # fix building of older versions of llvm with newer versions of glibc
     for compiler_rt_as in ["project", "runtime"]:
         with when("compiler-rt={0}".format(compiler_rt_as)):
@@ -583,6 +645,10 @@ class Llvm(CMakePackage, CudaPackage):
     # avoid build failed with Fujitsu compiler
     patch("llvm13-fujitsu.patch", when="@13 %fj")
 
+    # avoid build failed with Fujitsu compiler since llvm17
+    patch("llvm17-fujitsu.patch", when="@17: %fj")
+    patch("llvm17-18-thread.patch", when="@17:18 %fj")
+
     # patch for missing hwloc.h include for libompd
     # see https://reviews.llvm.org/D123888
     patch(
@@ -623,6 +689,8 @@ class Llvm(CMakePackage, CudaPackage):
     patch("add-include-for-libelf-llvm-12-14.patch", when="@12:14")
     patch("add-include-for-libelf-llvm-15.patch", when="@15")
 
+    patch("sanitizer-platform-limits-posix-xdr-macos.patch", when="@10:14 platform=darwin")
+
     @when("@14:17")
     def patch(self):
         # https://github.com/llvm/llvm-project/pull/69458
@@ -633,47 +701,43 @@ class Llvm(CMakePackage, CudaPackage):
             string=True,
         )
 
-    # The functions and attributes below implement external package
-    # detection for LLVM. See:
-    #
-    # https://spack.readthedocs.io/en/latest/packaging_guide.html#making-a-package-discoverable-with-spack-external-find
-    executables = ["clang", "flang", "ld.lld", "lldb"]
+    compiler_version_regex = (
+        # Normal clang compiler versions are left as-is
+        r"clang version ([^ )\n]+)-svn[~.\w\d-]*|"
+        # Don't include hyphenated patch numbers in the version
+        # (see https://github.com/spack/spack/pull/14365 for details)
+        r"clang version ([^ )\n]+?)-[~.\w\d-]*|"
+        r"clang version ([^ )\n]+)|"
+        # LLDB
+        r"lldb version ([^ )\n]+)|"
+        # LLD
+        r"LLD ([^ )\n]+) \(compatible with GNU linkers\)"
+    )
+    fortran_names = ["flang"]
 
-    @classmethod
-    def filter_detected_exes(cls, prefix, exes_in_prefix):
-        result = []
-        for exe in exes_in_prefix:
-            # Executables like lldb-vscode-X are daemon listening
-            # on some port and would hang Spack during detection.
-            # clang-cl and clang-cpp are dev tools that we don't
-            # need to test
-            if any(x in exe for x in ("vscode", "cpp", "-cl", "-gpu")):
-                continue
-            result.append(exe)
-        return result
+    @property
+    def supported_languages(self):
+        languages = []
+        if self.spec.satisfies("+clang"):
+            languages.extend(["c", "cxx"])
+        if self.spec.satisfies("+flang"):
+            languages.append("fortran")
+        return languages
+
+    @classproperty
+    def executables(cls):
+        return super().executables + [r"^ld\.lld(-\d+)?$", r"^lldb(-\d+)?$"]
 
     @classmethod
     def determine_version(cls, exe):
-        version_regex = re.compile(
-            # Normal clang compiler versions are left as-is
-            r"clang version ([^ )\n]+)-svn[~.\w\d-]*|"
-            # Don't include hyphenated patch numbers in the version
-            # (see https://github.com/spack/spack/pull/14365 for details)
-            r"clang version ([^ )\n]+?)-[~.\w\d-]*|"
-            r"clang version ([^ )\n]+)|"
-            # LLDB
-            r"lldb version ([^ )\n]+)|"
-            # LLD
-            r"LLD ([^ )\n]+) \(compatible with GNU linkers\)"
-        )
         try:
             compiler = Executable(exe)
-            output = compiler("--version", output=str, error=str)
+            output = compiler(cls.compiler_version_argument, output=str, error=str)
             if "Apple" in output:
                 return None
             if "AMD" in output:
                 return None
-            match = version_regex.search(output)
+            match = re.search(cls.compiler_version_regex, output)
             if match:
                 return match.group(match.lastindex)
         except spack.util.executable.ProcessError:
@@ -685,23 +749,23 @@ class Llvm(CMakePackage, CudaPackage):
 
     @classmethod
     def determine_variants(cls, exes, version_str):
+        # Do not need to reuse more general logic from CompilerPackage
+        # because LLVM has kindly named compilers
         variants, compilers = ["+clang"], {}
         lld_found, lldb_found = False, False
-        for exe in exes:
-            if "clang++" in exe:
-                compilers["cxx"] = exe
-            elif "clang" in exe:
-                compilers["c"] = exe
-            elif "flang" in exe:
+        for exe in sorted(exes, key=len):
+            name = os.path.basename(exe)
+            if "clang++" in name:
+                compilers.setdefault("cxx", exe)
+            elif "clang" in name:
+                compilers.setdefault("c", exe)
+            elif "flang" in name:
                 variants.append("+flang")
-                compilers["fc"] = exe
-                compilers["f77"] = exe
-            elif "ld.lld" in exe:
+                compilers.setdefault("fortran", exe)
+            elif "ld.lld" in name:
                 lld_found = True
-                compilers["ld"] = exe
-            elif "lldb" in exe:
+            elif "lldb" in name:
                 lldb_found = True
-                compilers["lldb"] = exe
 
         variants.append("+lld" if lld_found else "~lld")
         variants.append("+lldb" if lldb_found else "~lldb")
@@ -727,7 +791,7 @@ class Llvm(CMakePackage, CudaPackage):
         if self.spec.external:
             return self.spec.extra_attributes["compilers"].get("c", None)
         result = None
-        if "+clang" in self.spec:
+        if self.spec.satisfies("+clang"):
             result = os.path.join(self.spec.prefix.bin, "clang")
         return result
 
@@ -738,7 +802,7 @@ class Llvm(CMakePackage, CudaPackage):
         if self.spec.external:
             return self.spec.extra_attributes["compilers"].get("cxx", None)
         result = None
-        if "+clang" in self.spec:
+        if self.spec.satisfies("+clang"):
             result = os.path.join(self.spec.prefix.bin, "clang++")
         return result
 
@@ -749,7 +813,7 @@ class Llvm(CMakePackage, CudaPackage):
         if self.spec.external:
             return self.spec.extra_attributes["compilers"].get("fc", None)
         result = None
-        if "+flang" in self.spec:
+        if self.spec.satisfies("+flang"):
             result = os.path.join(self.spec.prefix.bin, "flang")
         return result
 
@@ -760,7 +824,7 @@ class Llvm(CMakePackage, CudaPackage):
         if self.spec.external:
             return self.spec.extra_attributes["compilers"].get("f77", None)
         result = None
-        if "+flang" in self.spec:
+        if self.spec.satisfies("+flang"):
             result = os.path.join(self.spec.prefix.bin, "flang")
         return result
 
@@ -794,10 +858,7 @@ class Llvm(CMakePackage, CudaPackage):
                     )
 
     def flag_handler(self, name, flags):
-        if name == "cxxflags":
-            flags.append(self.compiler.cxx11_flag)
-            return (None, flags, None)
-        elif name == "ldflags" and self.spec.satisfies("%intel"):
+        if name == "ldflags" and self.spec.satisfies("%intel"):
             flags.append("-shared-intel")
             return (None, flags, None)
         return (flags, None, None)
@@ -813,6 +874,14 @@ class Llvm(CMakePackage, CudaPackage):
                     os.symlink(bin, sym)
             env.prepend_path("PATH", self.stage.path)
 
+    def setup_run_environment(self, env):
+        if self.spec.satisfies("+clang"):
+            env.set("CC", join_path(self.spec.prefix.bin, "clang"))
+            env.set("CXX", join_path(self.spec.prefix.bin, "clang++"))
+        if self.spec.satisfies("+flang"):
+            env.set("FC", join_path(self.spec.prefix.bin, "flang"))
+            env.set("F77", join_path(self.spec.prefix.bin, "flang"))
+
     root_cmakelists_dir = "llvm"
 
     def cmake_args(self):
@@ -820,13 +889,11 @@ class Llvm(CMakePackage, CudaPackage):
         define = self.define
         from_variant = self.define_from_variant
 
-        python = spec["python"]
         cmake_args = [
             define("LLVM_REQUIRES_RTTI", True),
             define("LLVM_ENABLE_RTTI", True),
             define("LLVM_ENABLE_LIBXML2", False),
             define("CLANG_DEFAULT_OPENMP_RUNTIME", "libomp"),
-            define("PYTHON_EXECUTABLE", python.command.path),
             define("LIBOMP_USE_HWLOC", True),
             define("LIBOMP_HWLOC_INSTALL_DIR", spec["hwloc"].prefix),
             from_variant("LLVM_ENABLE_ZSTD", "zstd"),
@@ -850,15 +917,10 @@ class Llvm(CMakePackage, CudaPackage):
         if shlib_symbol_version is not None and shlib_symbol_version.value != "none":
             cmake_args.append(define("LLVM_SHLIB_SYMBOL_VERSION", shlib_symbol_version.value))
 
-        if python.version >= Version("3"):
-            cmake_args.append(define("Python3_EXECUTABLE", python.command.path))
-        else:
-            cmake_args.append(define("Python2_EXECUTABLE", python.command.path))
-
         projects = []
         runtimes = []
 
-        if "+cuda" in spec:
+        if spec.satisfies("+cuda"):
             cmake_args.extend(
                 [
                     define("CUDA_TOOLKIT_ROOT_DIR", spec["cuda"].prefix),
@@ -872,7 +934,7 @@ class Llvm(CMakePackage, CudaPackage):
                     ),
                 ]
             )
-            if "openmp=runtime" in spec:
+            if spec.satisfies("openmp=runtime"):
                 cmake_args.append(define("LIBOMPTARGET_NVPTX_ENABLE_BCLIB", True))
         else:
             # still build libomptarget but disable cuda
@@ -887,7 +949,15 @@ class Llvm(CMakePackage, CudaPackage):
 
         cmake_args.append(from_variant("LIBOMPTARGET_ENABLE_DEBUG", "libomptarget_debug"))
 
-        if "+lldb" in spec:
+        if spec.satisfies("@14:"):
+            # The hsa-rocr-dev package may be pulled in through hwloc, which can lead to cmake
+            # finding libhsa and enabling the AMDGPU plugin. Since we don't support this yet,
+            # disable explicitly. See commit a05a0c3c2f8eefc80d84b7a87a23a4452d4a3087.
+            cmake_args.append(define("LIBOMPTARGET_BUILD_AMDGPU_PLUGIN", False))
+            if "python" in spec:  # lit's Python needs to be set with this variable
+                cmake_args.append(define("python_executable", spec["python"].command.path))
+
+        if spec.satisfies("+lldb"):
             projects.append("lldb")
             cmake_args.extend(
                 [
@@ -898,59 +968,65 @@ class Llvm(CMakePackage, CudaPackage):
                     define("LLDB_ENABLE_LZMA", True),
                 ]
             )
-            if spec["ncurses"].satisfies("+termlib"):
-                cmake_args.append(define("LLVM_ENABLE_TERMINFO", True))
+            if spec.satisfies("@19:"):
+                cmake_args.append(define("LLDB_CURSES_LIBS", spec["ncurses"].libs))
             else:
-                cmake_args.append(define("LLVM_ENABLE_TERMINFO", False))
+                if spec["ncurses"].satisfies("+termlib"):
+                    cmake_args.append(define("LLVM_ENABLE_TERMINFO", True))
+                else:
+                    cmake_args.append(define("LLVM_ENABLE_TERMINFO", False))
             if spec.version >= Version("10"):
                 cmake_args.append(from_variant("LLDB_ENABLE_PYTHON", "python"))
             else:
-                cmake_args.append(define("LLDB_DISABLE_PYTHON", "~python" in spec))
+                cmake_args.append(define("LLDB_DISABLE_PYTHON", spec.satisfies("~python")))
             if spec.satisfies("@5.0.0: +python"):
                 cmake_args.append(define("LLDB_USE_SYSTEM_SIX", True))
-        else:
+        elif spec.satisfies("@:19"):
             cmake_args.append(define("LLVM_ENABLE_TERMINFO", False))
 
-        if "+gold" in spec:
+        if spec.satisfies("+gold"):
             cmake_args.append(define("LLVM_BINUTILS_INCDIR", spec["binutils"].prefix.include))
 
-        if "+clang" in spec:
+        if spec.satisfies("+clang"):
             projects.append("clang")
             projects.append("clang-tools-extra")
-            if "openmp=runtime" in spec:
+            if spec.satisfies("openmp=runtime"):
                 runtimes.append("openmp")
-            elif "openmp=project" in spec:
+            elif spec.satisfies("openmp=project"):
                 projects.append("openmp")
 
-            if "+libomptarget" in spec:
+            if spec.satisfies("+offload"):
+                runtimes.append("offload")
+
+            if spec.satisfies("+libomptarget"):
                 cmake_args.append(define("OPENMP_ENABLE_LIBOMPTARGET", True))
             else:
                 cmake_args.append(define("OPENMP_ENABLE_LIBOMPTARGET", False))
 
-            if "@8" in spec:
+            if spec.satisfies("@8"):
                 cmake_args.append(from_variant("CLANG_ANALYZER_ENABLE_Z3_SOLVER", "z3"))
-            elif "@9:" in spec:
+            elif spec.satisfies("@9:"):
                 cmake_args.append(from_variant("LLVM_ENABLE_Z3_SOLVER", "z3"))
 
-        if "+flang" in spec:
+        if spec.satisfies("+flang"):
             projects.append("flang")
-        if "+lld" in spec:
+        if spec.satisfies("+lld"):
             projects.append("lld")
-        if "compiler-rt=runtime" in spec:
+        if spec.satisfies("compiler-rt=runtime"):
             runtimes.append("compiler-rt")
-        elif "compiler-rt=project" in spec:
+        elif spec.satisfies("compiler-rt=project"):
             projects.append("compiler-rt")
-        if "libcxx=runtime" in spec:
+        if spec.satisfies("libcxx=runtime"):
             runtimes.extend(["libcxx", "libcxxabi"])
-        elif "libcxx=project" in spec:
+        elif spec.satisfies("libcxx=project"):
             projects.extend(["libcxx", "libcxxabi"])
-        if "+mlir" in spec:
+        if spec.satisfies("+mlir"):
             projects.append("mlir")
-        if "libunwind=runtime" in spec:
+        if spec.satisfies("libunwind=runtime"):
             runtimes.append("libunwind")
-        elif "libunwind=project" in spec:
+        elif spec.satisfies("libunwind=project"):
             projects.append("libunwind")
-        if "+polly" in spec:
+        if spec.satisfies("+polly"):
             projects.append("polly")
             cmake_args.append(define("LINK_POLLY_INTO_TOOLS", True))
 
@@ -964,6 +1040,14 @@ class Llvm(CMakePackage, CudaPackage):
                 # CMAKE_INSTALL_RPATH to it, which fails. Statically link libc++abi.a
                 # into libc++.so, linking with -lc++ or -stdlib=libc++ is enough.
                 define("LIBCXX_ENABLE_STATIC_ABI_LIBRARY", True),
+                # Make sure that CMake does not pick host-installed tools for the build
+                # Until #45535 is merged, prevent CMake from delivering incompatible
+                # system tools like python3.12 to older LLVM versions like LLVM-14:
+                define("CMAKE_FIND_PACKAGE_PREFER_CONFIG", True),
+                define("CMAKE_FIND_USE_PACKAGE_ROOT_PATH", False),
+                define("CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY", False),
+                define("CMAKE_FIND_USE_PACKAGE_REGISTRY", False),
+                define("CMAKE_FIND_USE_SYSTEM_PATH", False),
             ]
         )
 
@@ -971,14 +1055,16 @@ class Llvm(CMakePackage, CudaPackage):
 
         cmake_args.append(from_variant("LIBOMP_TSAN_SUPPORT", "libomp_tsan"))
 
-        if self.compiler.name == "gcc":
+        # From clang 16 onwards we use a more precise --gcc-install-dir flag in post-install
+        # generated config files.
+        if self.spec.satisfies("@:15 %gcc"):
             cmake_args.append(define("GCC_INSTALL_PREFIX", self.compiler.prefix))
 
         if self.spec.satisfies("~code_signing platform=darwin"):
             cmake_args.append(define("LLDB_USE_SYSTEM_DEBUGSERVER", True))
 
         # LLDB test suite requires libc++
-        if "libcxx=none" in spec:
+        if spec.satisfies("libcxx=none"):
             cmake_args.append(define("LLDB_INCLUDE_TESTS", False))
 
         # Enable building with CLT [and not require full Xcode]
@@ -991,12 +1077,44 @@ class Llvm(CMakePackage, CudaPackage):
 
         # Semicolon seperated list of runtimes to enable
         if runtimes:
+            # The older versions are not careful enough with the order of the runtimes.
+            # Instead of applying
+            # https://github.com/llvm/llvm-project/commit/06400a0142af8297b5d39b8f34a7c59db6f9910c,
+            # which might be incompatible with the version that we install,
+            # we sort the runtimes here according to the same order as
+            # in the aforementioned commit:
+            if self.spec.satisfies("@:14"):
+                runtimes_order = [
+                    "libc",
+                    "libunwind",
+                    "libcxxabi",
+                    "libcxx",
+                    "compiler-rt",
+                    "openmp",
+                ]
+                runtimes.sort(
+                    key=lambda x: (
+                        runtimes_order.index(x) if x in runtimes_order else len(runtimes_order)
+                    )
+                )
+
+            # CMake args passed just to runtimes
+            runtime_cmake_args = [define("CMAKE_INSTALL_RPATH_USE_LINK_PATH", True)]
+
+            # When building runtimes, just-built clang has to know where GCC is.
+            gcc_install_dir_flag = get_gcc_install_dir_flag(spec, self.compiler)
+            if gcc_install_dir_flag:
+                runtime_cmake_args.extend(
+                    [
+                        define("CMAKE_C_FLAGS", gcc_install_dir_flag),
+                        define("CMAKE_CXX_FLAGS", gcc_install_dir_flag),
+                    ]
+                )
+
             cmake_args.extend(
                 [
                     define("LLVM_ENABLE_RUNTIMES", runtimes),
-                    define(
-                        "RUNTIMES_CMAKE_ARGS", [define("CMAKE_INSTALL_RPATH_USE_LINK_PATH", True)]
-                    ),
+                    define("RUNTIMES_CMAKE_ARGS", runtime_cmake_args),
                 ]
             )
 
@@ -1008,9 +1126,9 @@ class Llvm(CMakePackage, CudaPackage):
         define = self.define
 
         # unnecessary if we build openmp via LLVM_ENABLE_RUNTIMES
-        if "+cuda openmp=project" in self.spec:
+        if self.spec.satisfies("+cuda openmp=project"):
             ompdir = "build-bootstrapped-omp"
-            prefix_paths = spack.build_environment.get_cmake_prefix_path(self)
+            prefix_paths = get_cmake_prefix_path(self)
             prefix_paths.append(str(spec.prefix))
             # rebuild libomptarget to get bytecode runtime library files
             with working_dir(ompdir, create=True):
@@ -1034,15 +1152,31 @@ class Llvm(CMakePackage, CudaPackage):
                 cmake(*cmake_args)
                 ninja()
                 ninja("install")
-        if "+python" in self.spec:
-            install_tree("llvm/bindings/python", python_platlib)
+        if self.spec.satisfies("+python"):
+            if spec.version < Version("17.0.0"):
+                # llvm bindings were removed in v17:
+                # https://releases.llvm.org/17.0.1/docs/ReleaseNotes.html#changes-to-the-python-bindings
+                install_tree("llvm/bindings/python", python_platlib)
 
-            if "+clang" in self.spec:
+            if self.spec.satisfies("+clang"):
                 install_tree("clang/bindings/python", python_platlib)
 
         with working_dir(self.build_directory):
             install_tree("bin", join_path(self.prefix, "libexec", "llvm"))
 
+        cfg_files = []
+        if spec.satisfies("+clang"):
+            cfg_files.extend(("clang.cfg", "clang++.cfg"))
+        if spec.satisfies("@19: +flang"):
+            # The config file is `flang.cfg` even though the executable is `flang-new`.
+            # `--gcc-install-dir` / `--gcc-toolchain` support was only added in LLVM 19.
+            cfg_files.append("flang.cfg")
+        gcc_install_dir_flag = get_gcc_install_dir_flag(spec, self.compiler)
+        if gcc_install_dir_flag:
+            for cfg in cfg_files:
+                with open(os.path.join(self.prefix.bin, cfg), "w") as f:
+                    print(gcc_install_dir_flag, file=f)
+
     def llvm_config(self, *args, **kwargs):
         lc = Executable(self.prefix.bin.join("llvm-config"))
         if not kwargs.get("output"):
@@ -1054,6 +1188,18 @@ class Llvm(CMakePackage, CudaPackage):
             return ret
 
 
+def get_gcc_install_dir_flag(spec: Spec, compiler) -> Optional[str]:
+    """Get the --gcc-install-dir=... flag, so that clang does not do a system scan for GCC."""
+    if not spec.satisfies("@16: %gcc"):
+        return None
+    gcc = Executable(compiler.cc)
+    libgcc_path = gcc("-print-file-name=libgcc.a", output=str, fail_on_error=False).strip()
+    if not os.path.isabs(libgcc_path):
+        return None
+    libgcc_dir = os.path.dirname(libgcc_path)
+    return f"--gcc-install-dir={libgcc_dir}" if os.path.exists(libgcc_dir) else None
+
+
 def get_llvm_targets_to_build(spec):
     targets = spec.variants["targets"].value
 
@@ -1100,4 +1246,3 @@ def get_llvm_targets_to_build(spec):
         llvm_targets.add("PowerPC")
 
     return list(llvm_targets)
-
diff --git a/packages/llvm/sanitizer-platform-limits-posix-xdr-macos.patch b/packages/llvm/sanitizer-platform-limits-posix-xdr-macos.patch
new file mode 100644
index 00000000..d4477390
--- /dev/null
+++ b/packages/llvm/sanitizer-platform-limits-posix-xdr-macos.patch
@@ -0,0 +1,11 @@
+--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -1250,7 +1250,7 @@ CHECK_SIZE_AND_OFFSET(group, gr_passwd);
+ CHECK_SIZE_AND_OFFSET(group, gr_gid);
+ CHECK_SIZE_AND_OFFSET(group, gr_mem);
+ 
+-#if HAVE_RPC_XDR_H
++#if HAVE_RPC_XDR_H && !SANITIZER_MAC
+ CHECK_TYPE_SIZE(XDR);
+ CHECK_SIZE_AND_OFFSET(XDR, x_op);
+ CHECK_SIZE_AND_OFFSET(XDR, x_ops);
diff --git a/packages/llvm/thread-p9.patch b/packages/llvm/thread-p9.patch
deleted file mode 100644
index 140473a8..00000000
--- a/packages/llvm/thread-p9.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/libcxx/include/thread b/libcxx/include/thread
-index 02da703..d1677a1 100644
---- a/projects/libcxx/include/thread
-+++ b/projects/libcxx/include/thread
-@@ -368,9 +368,9 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d)
-     {
- #if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
-     //  GCC's long double const folding is incomplete for IBM128 long doubles.
--        _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
--#else
-         _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
-+#else
-+        _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
- #endif
-         nanoseconds __ns;
-         if (__d < _Max)
diff --git a/packages/log4cxx/package.py b/packages/log4cxx/package.py
index 0cf8f7a9..eb0c9071 100644
--- a/packages/log4cxx/package.py
+++ b/packages/log4cxx/package.py
@@ -10,18 +10,42 @@ class Log4cxx(CMakePackage):
     """A C++ port of Log4j"""
 
     homepage = "https://logging.apache.org/log4cxx/latest_stable/"
+    # begin EBRAINS (modified): fix url
     url = "https://github.com/apache/logging-log4cxx/archive/refs/tags/rel/v1.2.0.tar.gz"
+    # end EBRAINS
 
     maintainers("nicmcd")
 
-    # begin EBRAINS (added): bring upstream (ref. spack@0.21.2)
+    license("Apache-2.0", checked_by="wdconinc")
+
+    # begin EBRAINS (modified): fix checksums
     version("1.2.0",  sha256="3e0af426011718c634194200cdd79b49ec13c322697bdcddef3d8b2ac9efd7b6")
-    version("1.1.0",  sha256="feb425ce35a391cf0927356bebb7da53f96c8a7aaf634aaf740e011203c732bb")
+    with default_args(deprecated=True):
+        # https://nvd.nist.gov/vuln/detail/CVE-2023-31038
+        version(
+            "0.12.1", sha256="567a4200c5b005a816c401e798d98294782950c7750eb3e285e851b970c8beed"
+        )
+        version(
+            "0.12.0", sha256="31730a17b8ff3f416256755b7aa6d7e95b167c670eb469eb9ff99aa006376e79"
+        )
     # end EBRAINS
-    version("0.12.1", sha256="567a4200c5b005a816c401e798d98294782950c7750eb3e285e851b970c8beed")
-    version("0.12.0", sha256="31730a17b8ff3f416256755b7aa6d7e95b167c670eb469eb9ff99aa006376e79")
 
-    variant("cxxstd", default="17", description="C++ standard", values=("11", "17"), multi=False)
+    variant(
+        "cxxstd",
+        default="17",
+        description="C++ standard",
+        values=("11", "17"),
+        multi=False,
+        when="@:1.1",
+    )
+    variant(
+        "cxxstd",
+        default="20",
+        description="C++ standard",
+        values=("11", "17", "20"),
+        multi=False,
+        when="@1.2:",
+    )
     # begin EBRAINS (added)
     variant("events_at_exit",
             default=False,
@@ -34,6 +58,7 @@ class Log4cxx(CMakePackage):
     depends_on("apr-util")
     depends_on("apr")
     depends_on("boost+thread+system", when="cxxstd=11")
+    depends_on("expat")
     depends_on("zlib-api")
     depends_on("zip")
 
diff --git a/packages/nanoflann/package.py b/packages/nanoflann/package.py
deleted file mode 100644
index 7dd9d7f3..00000000
--- a/packages/nanoflann/package.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class Nanoflann(CMakePackage):
-    """a C++ header-only library for Nearest Neighbor (NN) search wih KD-trees."""
-
-    homepage = "https://github.com/jlblancoc/nanoflann"
-    url = "https://github.com/jlblancoc/nanoflann/archive/v1.2.3.tar.gz"
-
-    # begin EBRAINS (added): add version
-    version("1.5.4", sha256="a7f64d0bdff42614c561e52680b16de46c0edac9719f21f935c5e1f8b0654afc")
-    # end EBRAINS
-    version("1.4.3", sha256="cbcecf22bec528a8673a113ee9b0e134f91f1f96be57e913fa1f74e98e4449fa")
-    version("1.2.3", sha256="5ef4dfb23872379fe9eb306aabd19c9df4cae852b72a923af01aea5e8d7a59c3")
-
-    def patch(self):
-        filter_file("-mtune=native", "", "CMakeLists.txt")
-
-    def cmake_args(self):
-        args = ["-DBUILD_SHARED_LIBS=ON"]
-        return args
diff --git a/packages/netlib-xblas/package.py b/packages/netlib-xblas/package.py
deleted file mode 100644
index cc65577f..00000000
--- a/packages/netlib-xblas/package.py
+++ /dev/null
@@ -1,74 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class NetlibXblas(AutotoolsPackage):
-    """XBLAS is a reference implementation for extra precision BLAS.
-
-    XBLAS is a reference implementation for the dense and banded BLAS
-    routines, along with extended and mixed precision version. Extended
-    precision is only used internally; input and output arguments remain
-    the same as in the existing BLAS. Extra precisions is implemented as
-    double-double (i.e., 128-bit total, 106-bit significand). Mixed
-    precision permits some input/output arguments of different types
-    (mixing real and complex) or precisions (mixing single and
-    double). This implementation is proof of concept, and no attempt was
-    made to optimize performance; performance should be as good as
-    straightforward but careful code written by hand."""
-
-    homepage = "https://www.netlib.org/xblas"
-    url = "https://www.netlib.org/xblas/xblas.tar.gz"
-
-    version("1.0.248", sha256="b5fe7c71c2da1ed9bcdc5784a12c5fa9fb417577513fe8a38de5de0007f7aaa1")
-
-    variant("fortran", default=True, description="Build Fortran interfaces")
-    variant("plain_blas", default=True, description="As part of XBLAS, build plain BLAS routines")
-
-    provides("blas", when="+plain_blas")
-
-    # begin EBRAINS (added)
-    depends_on("m4", type="build")
-    # end EBRAINS
-
-    @property
-    def libs(self):
-        return find_libraries(["libxblas"], root=self.prefix, shared=False, recursive=True)
-
-    def configure_args(self):
-        args = []
-
-        if self.spec.satisfies("~fortran"):
-            args += ["--disable-fortran"]
-
-        if self.spec.satisfies("~plain_blas"):
-            args += ["--disable-plain-blas"]
-
-        return args
-
-    def install(self, spec, prefix):
-        mkdirp(prefix.lib)
-        install("libxblas.a", prefix.lib)
-
-        if self.spec.satisfies("+plain_blas"):
-            # XBLAS should be a drop-in BLAS replacement
-            install("libxblas.a", join_path(prefix.lib, "libblas.a"))
-
-        headers = [
-            "f2c-bridge.h",
-            "blas_dense_proto.h",
-            "blas_enum.h",
-            "blas_extended.h",
-            "blas_extended_private.h",
-            "blas_extended_proto.h",
-            "blas_fpu.h",
-            "blas_malloc.h",
-        ]
-        mkdirp(prefix.include)
-        for h in headers:
-            install(join_path("src", h), prefix.include)
-
-        return
diff --git a/packages/nglview/package.py b/packages/nglview/package.py
deleted file mode 100644
index e86cd491..00000000
--- a/packages/nglview/package.py
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
-class Nglview(PythonPackage):
-    """An IPython/Jupyter widget to interactively view molecular structures and trajectories. 
-    Utilizes the embeddable NGL Viewer for rendering."""
-
-    # Homepage and download url
-    homepage = "https://github.com/nglviewer/nglview"
-    git = 'https://github.com/nglviewer/nglview.git'
-    url = 'https://github.com/nglviewer/nglview/archive/refs/tags/v3.0.4.tar.gz'
-
-    # Set the gitlab accounts of this package maintainers
-    maintainers = ['dbeltran']
-
-    # Versions
-    version('master', branch='master')
-    version('3.0.4', sha256='78b4413b796965a94045df0d584ec51e256c3dca5f366020439fe7e9744ce61b')
-
-    # Dependencies
-    depends_on('python@3.8:', type=('build', 'run'))
-    depends_on('py-setuptools')
-    depends_on('py-jupyter-packaging')
-    depends_on('py-versioneer')
-    depends_on('py-numpy', type=('run'))
-    depends_on('py-ipywidgets', type=('run'))
-
-    # Test
-    @run_after('install')
-    @on_package_attributes(run_tests=True)
-    def check_install (self):
-        python("-c", 'import nglview')
diff --git a/packages/open3d/package.py b/packages/open3d/package.py
index f3d2f626..c1faaa0b 100644
--- a/packages/open3d/package.py
+++ b/packages/open3d/package.py
@@ -13,14 +13,24 @@ from spack.package import *
 class Open3d(CMakePackage, CudaPackage):
     """Open3D: A Modern Library for 3D Data Processing."""
 
-    homepage = "http://www.open3d.org/"
+    homepage = "https://www.open3d.org/"
     url = "https://github.com/isl-org/Open3D/archive/refs/tags/v0.13.0.tar.gz"
     git = "https://github.com/isl-org/Open3D.git"
 
+    license("MIT")
+
     # begin EBRAINS (added): add version
-    version("0.18.0", tag="v0.18.0", submodules=True)
+    version(
+        "0.18.0", tag="v0.18.0", commit="0f06a149c4fb9406fd3e432a5cb0c024f38e2f0e", submodules=True
+    )
     # end EBRAINS
-    version("0.13.0", tag="v0.13.0", submodules=True)
+    version(
+        "0.13.0", tag="v0.13.0", commit="c3f9de224e13838a72da0e5565a7ba51038b0f11", submodules=True
+    )
+
+    depends_on("c", type="build")  # generated
+    depends_on("cxx", type="build")  # generated
+    depends_on("fortran", type="build")  # generated
 
     variant("python", default=False, description="Build the Python module")
 
@@ -159,9 +169,6 @@ class Open3d(CMakePackage, CudaPackage):
         args.append(self.define("DEFINE_GLEW_NO_GLU", True))
         # end EBRAINS
 
-        if "+python" in self.spec:
-            args.append(self.define("PYTHON_EXECUTABLE", self.spec["python"].command.path))
-
         return args
 
     def check(self):
@@ -189,11 +196,11 @@ class Open3d(CMakePackage, CudaPackage):
 
     @run_after("install")
     @on_package_attributes(run_tests=True)
-    def test(self):
-        if "+python" in self.spec:
-            self.run_test(
-                self.spec["python"].command.path,
-                ["-c", "import open3d"],
-                purpose="checking import of open3d",
-                work_dir="spack-test",
-            )
+    def test_open3d_import(self):
+        """Checking import of open3d"""
+        if "+python" not in self.spec:
+            return
+
+        with working_dir("spack-test"):
+            python = which(python.path)
+            python("-c", "import open3d")
diff --git a/packages/openbabel/gcc12-cmake.patch b/packages/openbabel/gcc12-cmake.patch
deleted file mode 100644
index c568c899..00000000
--- a/packages/openbabel/gcc12-cmake.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From c0570bfeb2d7e0a6a6de1f257cf28e7f3cac8739 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Sun, 12 Jun 2022 11:23:59 +0100
-Subject: [PATCH] CMake: fix time check typo (fixes build failure w/ GCC 12)
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Without this fixed check, we get a build failure with GCC 12:
-```
-/var/tmp/portage/sci-chemistry/openbabel-3.1.1_p20210225/work/openbabel-08e23f39b0cc39b4eebd937a5a2ffc1a7bac3e1b/include/openbabel/obutil.h:65:14: error: �~@~Xclock�~@~Y was not declared in this scope; did you mean �~@~Xclock_t�~@~Y?
-   65 |       start= clock();
-      |              ^~~~~
-      |              clock_t
-```
-
-Bug: https://bugs.gentoo.org/851510
----
- src/config.h.cmake | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/config.h.cmake b/src/config.h.cmake
-index 1c59c67699..26e5dde94f 100644
---- a/src/config.h.cmake
-+++ b/src/config.h.cmake
-@@ -182,8 +182,8 @@
- #define OB_MODULE_PATH "@OB_MODULE_PATH@"
-
- #ifndef TIME_WITH_SYS_TIME
--  #ifdef HAVE_SYS_TIME
--    #ifdef HAVE_TIME
-+  #ifdef HAVE_SYS_TIME_H
-+    #ifdef HAVE_TIME_H
-       #define TIME_WITH_SYS_TIME 1
-     #else
-       #define TIME_WITH_SYS_TIME 0
-
diff --git a/packages/openbabel/package.py b/packages/openbabel/package.py
deleted file mode 100644
index 17641509..00000000
--- a/packages/openbabel/package.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class Openbabel(CMakePackage):
-    """Open Babel is a chemical toolbox designed to speak the many languages
-    of chemical data. It's an open, collaborative project allowing anyone to
-    search, convert, analyze, or store data from molecular modeling, chemistry,
-    solid-state materials, biochemistry, or related areas."""
-
-    homepage = "https://openbabel.org/wiki/Main_Page"
-    url = "https://github.com/openbabel/openbabel/archive/openbabel-3-0-0.tar.gz"
-    git = "https://github.com/openbabel/openbabel.git"
-
-    maintainers("RMeli")
-
-    version("master", branch="master")
-    version("3.1.1", tag="openbabel-3-1-1", commit="cbd4db43f8908b874864280fdc03bf92569eebc1")
-    version("3.1.0", tag="openbabel-3-1-0", commit="1e593abc1edf47352d5e8a0887654edf69a2f5f3")
-    version("3.0.0", tag="openbabel-3-0-0", commit="49f9cfb32bd0bc6ea440639d338123eb27accbe2")
-    version("2.4.1", tag="openbabel-2-4-1", commit="701f6049c483b1349118c2ff736a7f609a84dedd")
-    version("2.4.0", tag="openbabel-2-4-0", commit="087f33320e6796f39e6a1da04f4de7ec46bec4af")
-
-    variant("python", default=True, description="Build Python bindings")
-    variant("gui", default=True, description="Build with GUI")
-    variant("cairo", default=True, description="Build with Cairo (PNG output support)")
-    variant("openmp", default=False, description="Build with OpenMP")
-    variant("maeparser", default=False, description="Built with MAE parser")
-    variant("coordgen", default=False, description="Build with Coordgen")
-
-    extends("python", when="+python")
-
-    depends_on("python", type=("build", "run"), when="+python")
-    depends_on("cmake@3.1:", type="build")
-    depends_on("pkgconfig", type="build")
-    depends_on("swig@2.0:", type="build", when="+python")
-
-    depends_on("boost +filesystem +iostreams +test")
-    depends_on("cairo", when="+cairo")  # required to support PNG depiction
-    depends_on("pango", when="+cairo")  # custom cairo requires custom pango
-    depends_on("eigen@3.0:")  # required if using the language bindings
-    depends_on("libxml2")  # required to read/write CML files, XML formats
-    depends_on("zlib-api")  # required to support reading gzipped files
-    depends_on("rapidjson")  # required to support JSON
-    depends_on("libsm")
-    depends_on("uuid")
-
-    depends_on("maeparser", when="+maeparser")
-    depends_on("coordgen", when="+coordgen")
-
-    # Needed for Python 3.6 support
-    patch("python-3.6-rtld-global.patch", when="@:2.4.1+python")
-
-    # Convert tabs to spaces. Allows unit tests to pass
-    patch("testpdbformat-tabs-to-spaces.patch", when="@:2.4.1")
-
-    # begin EBRAINS (added)
-    # CMake: fix time check typo (fixes build failure w/ GCC 12)
-    patch("gcc12-cmake.patch", when="@:3.1.1")
-    # end EBRAINS
-
-    def cmake_args(self):
-        spec = self.spec
-        args = []
-
-        if "+python" in spec:
-            args.extend(
-                [
-                    "-DPYTHON_BINDINGS=ON",
-                    "-DPYTHON_EXECUTABLE={0}".format(spec["python"].command.path),
-                    "-DRUN_SWIG=ON",
-                ]
-            )
-        else:
-            args.append("-DPYTHON_BINDINGS=OFF")
-
-        args.append(self.define_from_variant("BUILD_GUI", "gui"))
-        args.append(self.define_from_variant("ENABLE_OPENMP", "openmp"))
-        args.append(self.define_from_variant("WITH_MAEPARSER", "maeparser"))
-        args.append(self.define_from_variant("WITH_COORDGEN", "coordgen"))
-
-        return args
-
-    @run_after("install")
-    @on_package_attributes(run_tests=True)
-    def check_install(self):
-        obabel = Executable(join_path(self.prefix.bin, "obabel"))
-        obabel("-:C1=CC=CC=C1Br", "-omol")
-
-        if "+python" in self.spec:
-            python("-c", "import openbabel")
-            if self.spec.version < Version("3.0.0"):
-                python("-c", "import pybel")
diff --git a/packages/openbabel/python-3.6-rtld-global.patch b/packages/openbabel/python-3.6-rtld-global.patch
deleted file mode 100644
index 68cd56a1..00000000
--- a/packages/openbabel/python-3.6-rtld-global.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-The DLFCN module has been removed from python 3.6, as it is not
-documented. Same funtionality can be achive with the os module
-that makes available the os.RTLD_GLOBAL variable for dlopen()
-
-See https://github.com/openbabel/openbabel/pull/372 for the
-source of this patch. The original patch only affects the CMake
-file that SWIG uses to generate openbabel.py. This patch also
-includes changes to openbabel.py.
-
-diff -Nuar a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
---- a/scripts/CMakeLists.txt	2017-05-17 10:02:54.408527942 -0500
-+++ b/scripts/CMakeLists.txt	2017-05-17 10:04:09.701598715 -0500
-@@ -81,11 +81,8 @@
-             COMMAND ${SWIG_EXECUTABLE} -python -c++ -small -O -templatereduce -naturalvar -I${openbabel_SOURCE_DIR}/include -I${openbabel_BINARY_DIR}/include -o ${openbabel_SOURCE_DIR}/scripts/python/openbabel-python.cpp ${eigen_define} -outdir ${openbabel_SOURCE_DIR}/scripts/python ${openbabel_SOURCE_DIR}/scripts/openbabel-python.i
-               COMMAND ${CMAKE_COMMAND} -E echo "import sys" > ob.py
-               COMMAND ${CMAKE_COMMAND} -E echo "if sys.platform.find('linux'\) != -1:" >> ob.py
--              COMMAND ${CMAKE_COMMAND} -E echo "  try:" >> ob.py
--              COMMAND ${CMAKE_COMMAND} -E echo "    import dl" >> ob.py
--              COMMAND ${CMAKE_COMMAND} -E echo "  except ImportError:" >> ob.py
--              COMMAND ${CMAKE_COMMAND} -E echo "    import DLFCN as dl" >> ob.py
--              COMMAND ${CMAKE_COMMAND} -E echo "  sys.setdlopenflags(sys.getdlopenflags() | dl.RTLD_GLOBAL)" >> ob.py
-+              COMMAND ${CMAKE_COMMAND} -E echo "  import os" >> ob.py
-+              COMMAND ${CMAKE_COMMAND} -E echo "  sys.setdlopenflags(sys.getdlopenflags() | os.RTLD_GLOBAL)" >> ob.py
-               COMMAND cat ${openbabel_SOURCE_DIR}/scripts/python/openbabel.py >> ob.py
-               COMMAND ${CMAKE_COMMAND} -E copy ob.py ${openbabel_SOURCE_DIR}/scripts/python/openbabel.py
-               COMMAND ${CMAKE_COMMAND} -E remove ob.py
-diff -Nuar a/scripts/python/openbabel.py b/scripts/python/openbabel.py
---- a/scripts/python/openbabel.py	2017-05-17 10:02:54.398527534 -0500
-+++ b/scripts/python/openbabel.py	2017-05-17 10:04:26.705292138 -0500
-@@ -1,10 +1,7 @@
- import sys
- if sys.platform.find('linux') != -1:
--  try:
--    import dl
--  except ImportError:
--    import DLFCN as dl
--  sys.setdlopenflags(sys.getdlopenflags() | dl.RTLD_GLOBAL)
-+  import os
-+  sys.setdlopenflags(sys.getdlopenflags() | os.RTLD_GLOBAL)
- # This file was automatically generated by SWIG (http://www.swig.org).
- # Version 3.0.10
- #
diff --git a/packages/openbabel/testpdbformat-tabs-to-spaces.patch b/packages/openbabel/testpdbformat-tabs-to-spaces.patch
deleted file mode 100644
index 0a71a72e..00000000
--- a/packages/openbabel/testpdbformat-tabs-to-spaces.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From 08cd38485d4cf1df8802da540f3018921dbc735e Mon Sep 17 00:00:00 2001
-From: "Adam J. Stewart" <ajstewart426@gmail.com>
-Date: Wed, 17 May 2017 10:56:23 -0500
-Subject: [PATCH] Convert tabs to spaces in testpdbformat.py
-
-See https://github.com/openbabel/openbabel/pull/1568
-
----
- test/testpdbformat.py | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/test/testpdbformat.py b/test/testpdbformat.py
-index 40bd316..ceb8496 100644
---- a/test/testpdbformat.py
-+++ b/test/testpdbformat.py
-@@ -24,12 +24,12 @@ class TestPDBFormat(BaseTest):
- 
-     def testInsertionCodes(self):
-         """
--	Testing a PDB entry with insertion codes to distinguish residues
--	upon conversion to FASTA.
-+        Testing a PDB entry with insertion codes to distinguish residues
-+        upon conversion to FASTA.
-         """
-         self.canFindExecutable("babel")
- 
--	self.entryPDBwithInsertioncodes="""ATOM    406  N   VAL L  29      58.041  17.797  48.254  1.00  0.00           N  
-+        self.entryPDBwithInsertioncodes="""ATOM    406  N   VAL L  29      58.041  17.797  48.254  1.00  0.00           N  
- ATOM    407  CA  VAL L  29      57.124  18.088  47.170  1.00  0.00           C  
- ATOM    408  C   VAL L  29      55.739  17.571  47.538  1.00  0.00           C  
- ATOM    409  O   VAL L  29      55.535  16.362  47.550  1.00  0.00           O  
-@@ -100,9 +100,9 @@ ATOM    473  HE1 TYR L  32      48.512  15.775  42.066  1.00  0.00           H
- ATOM    474  HE2 TYR L  32      48.145  19.172  44.648  1.00  0.00           H  
- ATOM    475  HH  TYR L  32      46.462  17.658  44.280  1.00  0.00           H  
- """
--	output, error = run_exec(self.entryPDBwithInsertioncodes,
--				     "babel -ipdb -ofasta")
--	self.assertEqual(output.rstrip().rsplit("\n",1)[1], "VSSSY")
-+        output, error = run_exec(self.entryPDBwithInsertioncodes,
-+                                     "babel -ipdb -ofasta")
-+        self.assertEqual(output.rstrip().rsplit("\n",1)[1], "VSSSY")
- 
- if __name__ == "__main__":
-     testsuite = []
--- 
-2.9.4
-
diff --git a/packages/py-astropy/package.py b/packages/py-astropy/package.py
index a58d9ebe..e780f21c 100644
--- a/packages/py-astropy/package.py
+++ b/packages/py-astropy/package.py
@@ -17,9 +17,9 @@ class PyAstropy(PythonPackage):
     pypi = "astropy/astropy-4.0.1.post1.tar.gz"
     git = "https://github.com/astropy/astropy.git"
 
-    # begin EBRAINS (added): add version
-    version("5.2.2", sha256="e6a9e34716bda5945788353c63f0644721ee7e5447d16b1cdcb58c48a96b0d9c")
-    # end EBRAINS
+    license("BSD-3-Clause")
+
+    version("6.1.0", sha256="6c3b915f10b1576190730ddce45f6245f9927dda3de6e3f692db45779708950f")
     version("5.1", sha256="1db1b2c7eddfc773ca66fa33bd07b25d5b9c3b5eee2b934e0ca277fa5b1b7b7e")
     version(
         "4.0.1.post1", sha256="5c304a6c1845ca426e7bc319412b0363fccb4928cb4ba59298acd1918eec44b5"
@@ -29,15 +29,24 @@ class PyAstropy(PythonPackage):
     version("1.1.2", sha256="6f0d84cd7dfb304bb437dda666406a1d42208c16204043bc920308ff8ffdfad1")
     version("1.1.post1", sha256="64427ec132620aeb038e4d8df94d6c30df4cc8b1c42a6d8c5b09907a31566a21")
 
+    depends_on("c", type="build")  # generated
+
     variant("all", default=False, when="@3.2:", description="Enable all functionality")
 
     # Required dependencies
+    depends_on("python@3.10:", when="@6.1.0:", type=("build", "run"))
     depends_on("python@3.8:", when="@5.1:", type=("build", "run"))
     depends_on("py-setuptools", type="build")
+#  TODO: probably fix, unrealistic
     depends_on("py-cython@0.29.13:", type="build")
+    depends_on("py-cython@0.29.30", when="@5.1:6.0", type="build")
+    depends_on("py-cython@3.0.0", when="@6.1.0:", type="build")
+
     # in newer pip versions --install-option does not exist
     depends_on("py-pip@:23.0", type="build")
 
+    depends_on("py-astropy-iers-data", when="@6:", type=("build", "run"))
+    depends_on("py-numpy@1.23:", when="@6.1:", type=("build", "run"))
     depends_on("py-numpy@1.18:", when="@5.1:", type=("build", "run"))
     depends_on("py-numpy@1.16:", when="@4.0:", type=("build", "run"))
     depends_on("py-numpy@1.13:", when="@3.1:", type=("build", "run"))
@@ -45,13 +54,13 @@ class PyAstropy(PythonPackage):
     depends_on("py-numpy@1.9:", when="@2.0:", type=("build", "run"))
     depends_on("py-numpy@1.7:", when="@1.2:", type=("build", "run"))
     depends_on("py-numpy", type=("build", "run"))
+    # https://github.com/astropy/astropy/issues/16200
+    depends_on("py-numpy@:1", when="@:6.0")
     depends_on("py-packaging@19.0:", when="@5.1:", type=("build", "run"))
     depends_on("py-pyyaml@3.13:", when="@5.1:", type=("build", "run"))
     depends_on("py-pyerfa@2.0:", when="@5.1:", type=("build", "run"))
+    depends_on("py-pyerfa@2.0.1.1:", when="@6.1.0:", type=("build", "run"))
     depends_on("py-setuptools-scm@6.2:", when="@5.1:", type="build")
-    # begin EBRAINS (modified)
-    depends_on("py-cython@0.29.30:", when="@5.1:", type="build")
-    # end EBRAINS
     depends_on("py-extension-helpers", when="@5.1:", type="build")
     depends_on("pkgconfig", type="build")
 
@@ -63,8 +72,10 @@ class PyAstropy(PythonPackage):
 
     # Optional dependencies
     with when("+all"):
+        depends_on("py-scipy@1.8:", when="@6:", type=("build", "run"))
         depends_on("py-scipy@1.3:", when="@5:", type=("build", "run"))
         depends_on("py-scipy@0.18:", type=("build", "run"))
+        depends_on("py-matplotlib@3.3:", when="@6:", type=("build", "run"))
         depends_on("py-matplotlib@3.1:", when="@5:", type=("build", "run"))
         depends_on("py-matplotlib@2.1:", when="@4:", type=("build", "run"))
         depends_on("py-matplotlib@2.0:", type=("build", "run"))
@@ -88,6 +99,8 @@ class PyAstropy(PythonPackage):
         depends_on("py-ipython", type=("build", "run"))
         depends_on("py-pytest@7:", when="@5.0.2:", type=("build", "run"))
         depends_on("py-pytest", type=("build", "run"))
+        depends_on("py-fsspec+http@2023.4:", when="@6.1:", type=("build", "run"))
+        depends_on("py-s3fs@2023.4:", when="@6.1:", type=("build", "run"))
         depends_on("py-typing-extensions@3.10.0.1:", when="@5.0.2:", type=("build", "run"))
 
         # Historical optional dependencies
diff --git a/packages/py-autopep8/package.py b/packages/py-autopep8/package.py
index e09fd53f..5e37dec3 100644
--- a/packages/py-autopep8/package.py
+++ b/packages/py-autopep8/package.py
@@ -13,6 +13,8 @@ class PyAutopep8(PythonPackage):
     homepage = "https://github.com/hhatto/autopep8"
     pypi = "autopep8/autopep8-1.2.4.tar.gz"
 
+    license("MIT")
+
     # begin EBRAINS (added): add version
     version("2.0.4", sha256="2913064abd97b3419d1cc83ea71f042cb821f87e45b9c88cad5ad3c4ea87fe0c")
     # end EBRAINS
diff --git a/packages/py-bokeh/package.py b/packages/py-bokeh/package.py
index 5c92e166..f6556f83 100644
--- a/packages/py-bokeh/package.py
+++ b/packages/py-bokeh/package.py
@@ -9,9 +9,12 @@ from spack.package import *
 class PyBokeh(PythonPackage):
     """Statistical and novel interactive HTML plots for Python"""
 
-    homepage = "https://github.com/bokeh/bokeh"
+    homepage = "https://bokeh.org/"
     pypi = "bokeh/bokeh-0.12.2.tar.gz"
 
+    license("BSD-3-Clause")
+
+    version("3.3.1", sha256="2a7b3702d7e9f03ef4cd801b02b7380196c70cff2773859bcb84fa565218955c")
     version("2.4.3", sha256="ef33801161af379665ab7a34684f2209861e3aefd5c803a21fbbb99d94874b03")
     version("2.4.1", sha256="d0410717d743a0ac251e62480e2ea860a7341bdcd1dbe01499a904f233c90512")
     version("2.4.0", sha256="6fa00ed8baab5cca33f4175792c309fa2536eaae7e90abee884501ba8c90fddb")
@@ -20,6 +23,9 @@ class PyBokeh(PythonPackage):
     version("0.12.2", sha256="0a840f6267b6d342e1bd720deee30b693989538c49644142521d247c0f2e6939")
 
     depends_on("py-setuptools", type="build", when="@1.3.4:")
+    depends_on("py-setuptools@64:", type="build", when="@3:")
+    depends_on("py-setuptools-git-versioning", type="build", when="@3:")
+    depends_on("py-colorama", type="build", when="@3:")
 
     # begin EBRAINS (added)
     depends_on("npm", type=("build", "run"))
@@ -29,6 +35,8 @@ class PyBokeh(PythonPackage):
     depends_on("python@2.7:", type=("build", "run"), when="@1.3.4:")
     depends_on("python@3.6:", type=("build", "run"), when="@2.3.3:")
     depends_on("python@3.7:", type=("build", "run"), when="@2.4.0:")
+    depends_on("python@3.8:", type=("build", "run"), when="@3.0.0:")
+    depends_on("python@3.9:", type=("build", "run"), when="@3.2.0:")
 
     depends_on("py-requests@1.2.3:", type=("build", "run"), when="@0.12.2")
     depends_on("py-six@1.5.2:", type=("build", "run"), when="@:1.3.4")
@@ -37,11 +45,18 @@ class PyBokeh(PythonPackage):
     depends_on("py-jinja2@2.7:", type=("build", "run"))
     depends_on("py-jinja2@2.9:", type=("build", "run"), when="@2.3.3:")
 
+    depends_on("py-contourpy@1:", type=("build", "run"), when="@3:")
+
     depends_on("py-numpy@1.7.1:", type=("build", "run"))
     depends_on("py-numpy@1.11.3:", type=("build", "run"), when="@2.3.3:")
+    depends_on("py-numpy@1.16:", type=("build", "run"), when="@3.1:")
+    # https://github.com/bokeh/bokeh/issues/13835
+    depends_on("py-numpy@:1", when="@:3.4.0", type=("build", "run"))
 
     depends_on("py-packaging@16.8:", type=("build", "run"), when="@1.3.4:")
 
+    depends_on("py-pandas@1.2:", type=("build", "run"), when="@3:")
+
     depends_on("pil@4.0:", type=("build", "run"), when="@1.3.4:")
     depends_on("pil@7.1.0:", type=("build", "run"), when="@2.3.3:")
 
@@ -50,5 +65,7 @@ class PyBokeh(PythonPackage):
     depends_on("py-tornado@4.3:", type=("build", "run"))
     depends_on("py-tornado@5.1:", type=("build", "run"), when="@2.3.3:")
 
-    depends_on("py-typing-extensions@3.7.4:", type=("build", "run"), when="@2.3.3:")
-    depends_on("py-typing-extensions@3.10.0:", type=("build", "run"), when="@2.4.0:")
\ No newline at end of file
+    depends_on("py-typing-extensions@3.7.4:", type=("build", "run"), when="@2.3.3:3.0.0")
+    depends_on("py-typing-extensions@3.10.0:", type=("build", "run"), when="@2.4.0:3.0.0")
+
+    depends_on("py-xyzservices@2021.09.1:", type=("build", "run"), when="@3:")
diff --git a/packages/py-chex/package.py b/packages/py-chex/package.py
deleted file mode 100644
index 86c2f71a..00000000
--- a/packages/py-chex/package.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class PyChex(PythonPackage):
-    """Chex is a library of utilities for helping to write reliable JAX code."""
-
-    homepage = "https://github.com/deepmind/chex"
-    pypi = "chex/chex-0.1.0.tar.gz"
-
-    # begin EBRAINS (added): bring upstream
-    version("0.1.7", sha256="74ed49799ac4d229881456d468136f1b19a9f9839e3de72b058824e2a4f4dedd")
-    # end EBRAINS
-    version("0.1.5", sha256="686858320f8f220c82a6c7eeb54dcdcaa4f3d7f66690dacd13a24baa1ee8299e")
-    version("0.1.0", sha256="9e032058f5fed2fc1d5e9bf8e12ece5910cf6a478c12d402b6d30984695f2161")
-
-    depends_on("python@3.7:", type=("build", "run"))
-    depends_on("py-setuptools", type="build")
-    depends_on("py-absl-py@0.9.0:", type=("build", "run"))
-    # begin EBRAINS (added): bring upstream
-    depends_on("py-typing-extensions@4.2.0:", when="@0.1.6: ^python@:3.10", type=("build", "run"))
-    # end EBRAINS
-    depends_on("py-dm-tree@0.1.5:", type=("build", "run"))
-    depends_on("py-jax@0.1.55:", type=("build", "run"))
-    # begin EBRAINS (added): bring upstream
-    depends_on("py-jax@0.4.6:", when="@0.1.7:", type=("build", "run"))
-    # end EBRAINS
-    depends_on("py-jaxlib@0.1.37:", type=("build", "run"))
-    depends_on("py-numpy@1.18.0:", type=("build", "run"))
-    depends_on("py-toolz@0.9.0:", type=("build", "run"))
diff --git a/packages/py-dash/package.py b/packages/py-dash/package.py
deleted file mode 100644
index cca2a47d..00000000
--- a/packages/py-dash/package.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class PyDash(PythonPackage):
-    """Python framework for building ML & data science web apps"""
-
-    homepage = "https://dash.plotly.com/"
-    pypi = "dash/dash-2.16.1.tar.gz"
-
-    version("2.16.1", sha256="b2871d6b8d4c9dfd0a64f89f22d001c93292910b41d92d9ff2bb424a28283976")
-    version("2.15.0", sha256="d38891337fc855d5673f75e5346354daa063c4ff45a8a6a21f25e858fcae41c2")
-
-    depends_on("python@3.8:", type=("build", "run"))
-    depends_on("py-setuptools", type="build")
-    
-    depends_on("py-flask@1.0.4:3.0", type=("build", "run"))
-    depends_on("py-werkzeug@:3.0", type=("build", "run"))
-    depends_on("py-plotly@5:", type=("build", "run"))
-    depends_on("py-importlib-metadata", type=("build", "run"))
-    depends_on("py-typing-extensions@4.1.1:", type=("build", "run"))
-    depends_on("py-requests", type=("build", "run"))
-    depends_on("py-retrying", type=("build", "run"))
-    depends_on("py-nest-asyncio", type=("build", "run"))
-
diff --git a/packages/py-flit-core/package.py b/packages/py-flit-core/package.py
deleted file mode 100644
index 9cd30a97..00000000
--- a/packages/py-flit-core/package.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class PyFlitCore(PythonPackage):
-    """Distribution-building parts of Flit."""
-
-    homepage = "https://github.com/pypa/flit"
-    pypi = "flit-core/flit_core-3.9.0.tar.gz"
-    # begin EBRAINS (added): tag as build-tool
-    tags = ["build-tools"]
-    # end EBRAINS
-    maintainers("takluyver")
-
-    version("3.9.0", sha256="72ad266176c4a3fcfab5f2930d76896059851240570ce9a98733b658cb786eba")
-    version("3.8.0", sha256="b305b30c99526df5e63d6022dd2310a0a941a187bd3884f4c8ef0418df6c39f3")
-    version("3.7.1", sha256="14955af340c43035dbfa96b5ee47407e377ee337f69e70f73064940d27d0a44f")
-    version("3.6.0", sha256="5892962ab8b8ea945835b3a288fe9dd69316f1903d5288c3f5cafdcdd04756ad")
-    version("3.5.1", sha256="3083720351a6cb00e0634a1ec0e26eae7b273174c3c6c03d5b597a14203b282e")
-    version("3.5.0", sha256="2db800d33ff41e4c6e7c1b594666cb2a11553024106655272c7245933b1d75bd")
-    version("3.4.0", sha256="29468fa2330969167d1f5c23eb9c0661cb6dacfcd46f361a274609a7f4197530")
-    version("3.3.0", sha256="b1404accffd6504b5f24eeca9ec5d3c877f828d16825348ba81515fa084bd5f0")
-    version("3.2.0", sha256="ff87f25c5dbc24ef30ea334074e35030e4885e4c5de3bf4e21f15746f6d99431")
-    version("3.1.0", sha256="22ff73be39a2b3c9e0692dfbbea3ad4a9d127e5733736a87dbb8ddcbf7309b1e")
-    version("3.0.0", sha256="a465052057e2d6d957e6850e9915245adedfc4fd0dd5737d0791bf3132417c2d")
-    version("2.3.0", sha256="a50bcd8bf5785e3a7d95434244f30ba693e794c5204ac1ee908fc07c4acdbf80")
-
-    # pyproject.toml
-    depends_on("python@3.6:", when="@3.4:", type=("build", "run"))
-    depends_on("python@3.4:", when="@3:", type=("build", "run"))
-    depends_on("python@2.7,3.4:", type=("build", "run"))
-
-    # flit_core/build_thyself.py
-    depends_on("py-tomli", when="@3.4:3.5", type="run")
-    depends_on("py-toml", when="@3.1:3.3", type="run")
-    depends_on("py-pytoml", when="@:3.0", type="run")
diff --git a/packages/py-ipycanvas/package.py b/packages/py-ipycanvas/package.py
index f9cd586a..0883611f 100644
--- a/packages/py-ipycanvas/package.py
+++ b/packages/py-ipycanvas/package.py
@@ -12,6 +12,8 @@ class PyIpycanvas(PythonPackage):
     homepage = "https://github.com/martinRenou/ipycanvas"
     pypi = "ipycanvas/ipycanvas-0.9.0.tar.gz"
 
+    license("BSD-3-Clause")
+
     # begin EBRAINS (added): add version
     version("0.12.0", sha256="3984339cef0c15674e347dd65ffb0cd1edc62e37869cbb5efea46f3259e976f3")
     # end EBRAINS
diff --git a/packages/py-ipympl/package.py b/packages/py-ipympl/package.py
index 2bd82b56..a22c00e6 100644
--- a/packages/py-ipympl/package.py
+++ b/packages/py-ipympl/package.py
@@ -1,4 +1,4 @@
-# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
+# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
 # Spack Project Developers. See the top-level COPYRIGHT file for details.
 #
 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
@@ -13,19 +13,44 @@ class PyIpympl(PythonPackage):
     pypi = "ipympl/ipympl-0.8.8.tar.gz"
     maintainers("haralmha")
 
-    version("0.8.8", sha256="5bf5d780b07fafe7924922ac6b2f3abd22721f341e5e196b3b82737dfbd0e1c9")
-
-    depends_on("py-setuptools@40.8:", type="build")
-    depends_on("py-ipython@:8", type=("build", "run"))
-    depends_on("py-numpy", type=("build", "run"))
-    depends_on("py-ipython-genutils", type=("build", "run"))
-    depends_on("pil", type=("build", "run"))
-    depends_on("py-traitlets@:5", type=("build", "run"))
-    depends_on("py-ipywidgets@7.6:7", type=("build", "run"))
-    depends_on("py-matplotlib@2:3", type=("build", "run"))
-    depends_on("py-jupyter-packaging@0.7", type="build")
-    depends_on("py-jupyterlab@3", type="build")
-    depends_on("yarn", type="build")
+    license("BSD-3-Clause")
+
+    version("0.9.4", sha256="cfb53c5b4fcbcee6d18f095eecfc6c6c474303d5b744e72cc66e7a2804708907")
+    # Build failures
+    version(
+        "0.8.8",
+        sha256="5bf5d780b07fafe7924922ac6b2f3abd22721f341e5e196b3b82737dfbd0e1c9",
+        # begin EBRAINS (modified): don't deprecate to keep compatibility with jupyterlab@3
+        deprecated=False,
+        # end EBRAINS
+    )
+
+    with default_args(type="build"):
+        with when("@0.9:"):
+            depends_on("py-hatchling")
+            depends_on("py-jupyterlab@4")
+            depends_on("py-hatch-nodejs-version@0.3.2:")
+
+        # Historical dependencies
+        with when("@:0.8"):
+            depends_on("py-jupyter-packaging@0.7")
+            depends_on("py-jupyterlab@3")
+            depends_on("py-setuptools@40.8:")
+            depends_on("yarn")
+
+    with default_args(type=("build", "run")):
+        depends_on("py-ipython@:8")
+        depends_on("py-ipython-genutils")
+        depends_on("py-ipywidgets@7.6:8", when="@0.9:")
+        depends_on("py-ipywidgets@7.6:7", when="@:0.8")
+        depends_on("py-matplotlib@3.4:3", when="@0.9:")
+        depends_on("py-matplotlib@2:3", when="@:0.8")
+        depends_on("py-numpy")
+        depends_on("pil")
+        depends_on("py-traitlets@:5")
+
+        # Necessary for jupyter extension env vars
+        depends_on("py-jupyter-core")
 
     # begin EBRAINS (added): use newer typescript
     # (see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/69932)
diff --git a/packages/py-jax/package.py b/packages/py-jax/package.py
deleted file mode 100644
index 5d57d7ec..00000000
--- a/packages/py-jax/package.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class PyJax(PythonPackage):
-    """JAX is Autograd and XLA, brought together for high-performance
-    machine learning research. With its updated version of Autograd,
-    JAX can automatically differentiate native Python and NumPy
-    functions. It can differentiate through loops, branches,
-    recursion, and closures, and it can take derivatives of
-    derivatives of derivatives. It supports reverse-mode
-    differentiation (a.k.a. backpropagation) via grad as well as
-    forward-mode differentiation, and the two can be composed
-    arbitrarily to any order."""
-
-    homepage = "https://github.com/google/jax"
-    pypi = "jax/jax-0.2.25.tar.gz"
-
-    # begin EBRAINS (added): bring upstream
-    version("0.4.13", sha256="03bfe6749dfe647f16f15f6616638adae6c4a7ca7167c75c21961ecfd3a3baaa")
-    # end EBRAINS
-    version("0.4.3", sha256="d43f08f940aa30eb339965cfb3d6bee2296537b0dc2f0c65ccae3009279529ae")
-    version("0.3.23", sha256="bff436e15552a82c0ebdef32737043b799e1e10124423c57a6ae6118c3a7b6cd")
-    version("0.2.25", sha256="822e8d1e06257eaa0fdc4c0a0686c4556e9f33647fa2a766755f984786ae7446")
-
-    # begin EBRAINS (modified): bring upstream
-    depends_on("python@3.7:", type=("build", "run"))
-    depends_on("python@3.8:", when="@0.4:", type=("build", "run"))
-    depends_on("python@3.9:", when="@0.4.14:", type=("build", "run"))
-    depends_on("py-setuptools", type="build")
-    depends_on("py-numpy@1.22:", when="@0.4.14:", type=("build", "run"))
-    depends_on("py-numpy@1.21:", when="@0.4.9:", type=("build", "run"))
-    depends_on("py-numpy@1.20:", when="@0.3:", type=("build", "run"))
-    depends_on("py-numpy@1.18:", type=("build", "run"))
-    depends_on("py-opt-einsum", type=("build", "run"))
-    depends_on("py-scipy@1.2.1:", type=("build", "run"))
-    depends_on("py-scipy@1.5:", when="@0.3:", type=("build", "run"))
-    depends_on("py-scipy@1.7:", when="@0.4.7:", type=("build", "run"))
-    depends_on("py-ml-dtypes@0.2.0:", when="@0.4.14:", type=("build", "run"))
-    depends_on("py-ml-dtypes@0.1.0:", when="@0.4.9:", type=("build", "run"))
-    depends_on("py-ml-dtypes@0.0.3:", when="@0.4.7:", type=("build", "run"))
-    depends_on("py-importlib-metadata@4.6:", when="@0.4.11: ^python@:3.9", type="run")
-    # end EBRAINS
-
-    # See _minimum_jaxlib_version in jax/version.py
-    # begin EBRAINS (modified): bring upstream
-    jax_to_jaxlib = {
-        "0.4.14": "0.4.14",
-        "0.4.13": "0.4.13",
-        "0.4.3": "0.4.2",
-        "0.3.23": "0.3.15",
-        "0.2.25": "0.1.69",
-    }
-    # end EBRAINS
-
-    for jax, jaxlib in jax_to_jaxlib.items():
-        # begin EBRAINS (modified): bring upstream
-        depends_on(f"py-jaxlib@{jaxlib}", when=f"@{jax}", type=("build", "run"))
-        # end EBRAINS
-
-    # Historical dependencies
-    depends_on("py-absl-py", when="@:0.3", type=("build", "run"))
-    depends_on("py-typing-extensions", when="@:0.3", type=("build", "run"))
-    # begin EBRAINS (deleted):
-    # depends_on("py-etils+epath", when="@0.3", type=("build", "run"))
-    # end EBRAINS
diff --git a/packages/py-jaxlib/package.py b/packages/py-jaxlib/package.py
deleted file mode 100644
index 20b2683c..00000000
--- a/packages/py-jaxlib/package.py
+++ /dev/null
@@ -1,125 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-import tempfile
-
-from spack.package import *
-
-
-class PyJaxlib(PythonPackage, CudaPackage):
-    """XLA library for Jax"""
-
-    homepage = "https://github.com/google/jax"
-    url = "https://github.com/google/jax/archive/refs/tags/jaxlib-v0.1.74.tar.gz"
-
-    tmp_path = ""
-    buildtmp = ""
-
-    # begin EBRAINS (added): bring upstream
-    version("0.4.13", sha256="45766238b57b992851763c64bc943858aebafe4cad7b3df6cde844690bc34293")
-    # end EBRAINS
-    version("0.4.3", sha256="2104735dc22be2b105e5517bd5bc6ae97f40e8e9e54928cac1585c6112a3d910")
-    version("0.3.22", sha256="680a6f5265ba26d5515617a95ae47244005366f879a5c321782fde60f34e6d0d")
-    version("0.1.74", sha256="bbc78c7a4927012dcb1b7cd135c7521f782d7dad516a2401b56d3190f81afe35")
-
-    # begin EBRAINS (deleted): Variant with default=False is provided by CudaPackage
-    # variant("cuda", default=True, description="Build with CUDA")
-    # end EBRAINS
-
-    # jaxlib/setup.py
-    # begin EBRAINS (modified): bring upstream
-    depends_on("python@3.9:", when="@0.4.14:", type=("build", "run"))
-    depends_on("python@3.8:", when="@0.4:", type=("build", "run"))
-    depends_on("python@3.7:", type=("build", "run"))
-    depends_on("py-setuptools", type="build")
-    depends_on("py-numpy@1.22:", when="@0.4.14:", type=("build", "run"))
-    depends_on("py-numpy@1.21:", when="@0.4.9:", type=("build", "run"))
-    depends_on("py-numpy@1.20:", when="@0.3:", type=("build", "run"))
-    depends_on("py-numpy@1.18:", type=("build", "run"))
-    depends_on("py-scipy@1.5:", type=("build", "run"))
-    depends_on("py-scipy@1.7:", when="@0.4.7:", type=("build", "run"))
-    depends_on("py-ml-dtypes@0.2.0:", when="@0.4.14:", type=("build", "run"))
-    depends_on("py-ml-dtypes@0.1.0:", when="@0.4.9:", type=("build", "run"))
-    depends_on("py-ml-dtypes@0.0.3:", when="@0.4.7:", type=("build", "run"))
-    # end EBRAINS
-
-    # .bazelversion
-    depends_on("bazel@5.1.1:5.9", when="@0.3:", type="build")
-    # https://github.com/google/jax/issues/8440
-    depends_on("bazel@4.1:4", when="@0.1", type="build")
-
-    # README.md
-    # begin EBRAINS (added): bring upstream
-    depends_on("cuda@11.8:", when="@0.4.8:+cuda")
-    # end EBRAINS
-    depends_on("cuda@11.4:", when="@0.4:+cuda")
-    depends_on("cuda@11.1:", when="@0.3+cuda")
-    # https://github.com/google/jax/issues/12614
-    depends_on("cuda@11.1:11.7.0", when="@0.1+cuda")
-    depends_on("cudnn@8.2:", when="@0.4:+cuda")
-    depends_on("cudnn@8.0.5:", when="+cuda")
-
-    # Historical dependencies
-    depends_on("py-absl-py", when="@:0.3", type=("build", "run"))
-    depends_on("py-flatbuffers@1.12:2", when="@0.1", type=("build", "run"))
-
-    conflicts(
-        "cuda_arch=none",
-        when="+cuda",
-        msg="Must specify CUDA compute capabilities of your GPU, see "
-        "https://developer.nvidia.com/cuda-gpus",
-    )
-
-    def patch(self):
-        self.tmp_path = tempfile.mkdtemp(prefix="spack")
-        self.buildtmp = tempfile.mkdtemp(prefix="spack")
-        filter_file(
-            "build --spawn_strategy=standalone",
-            f"""
-# Limit CPU workers to spack jobs instead of using all HOST_CPUS.
-build --spawn_strategy=standalone
-build --local_cpu_resources={make_jobs}
-""".strip(),
-            ".bazelrc",
-            string=True,
-        )
-        filter_file(
-            'f"--output_path={output_path}",',
-            'f"--output_path={output_path}",'
-            f' "--sources_path={self.tmp_path}",'
-            ' "--nohome_rc",'
-            ' "--nosystem_rc",'
-            f' "--jobs={make_jobs}",',
-            "build/build.py",
-            string=True,
-        )
-        filter_file(
-            "args = parser.parse_args()",
-            "args, junk = parser.parse_known_args()",
-            "build/build_wheel.py",
-            string=True,
-        )
-
-    def install(self, spec, prefix):
-        args = []
-        args.append("build/build.py")
-        if "+cuda" in spec:
-            args.append("--enable_cuda")
-            args.append("--cuda_path={0}".format(self.spec["cuda"].prefix))
-            args.append("--cudnn_path={0}".format(self.spec["cudnn"].prefix))
-            capabilities = ",".join(
-                "{0:.1f}".format(float(i) / 10.0) for i in spec.variants["cuda_arch"].value
-            )
-            args.append("--cuda_compute_capabilities={0}".format(capabilities))
-        args.append(
-            "--bazel_startup_options="
-            "--output_user_root={0}".format(self.wrapped_package_object.buildtmp)
-        )
-        python(*args)
-        with working_dir(self.wrapped_package_object.tmp_path):
-            args = std_pip_args + ["--prefix=" + self.prefix, "."]
-            pip(*args)
-        remove_linked_tree(self.wrapped_package_object.tmp_path)
-        remove_linked_tree(self.wrapped_package_object.buildtmp)
diff --git a/packages/py-numba/package.py b/packages/py-numba/package.py
index 6c0ee7b2..522abe31 100644
--- a/packages/py-numba/package.py
+++ b/packages/py-numba/package.py
@@ -13,6 +13,11 @@ class PyNumba(PythonPackage):
     pypi = "numba/numba-0.35.0.tar.gz"
     git = "https://github.com/numba/numba.git"
 
+    skip_modules = ["numba.core.rvsdg_frontend"]
+
+    license("BSD-2-Clause")
+
+    version("0.58.1", sha256="487ded0633efccd9ca3a46364b40006dbdaca0f95e99b8b83e778d1195ebcbaa")
     version("0.57.0", sha256="2af6d81067a5bdc13960c6d2519dbabbf4d5d597cf75d640c5aeaefd48c6420a")
     version("0.56.4", sha256="32d9fef412c81483d7efe0ceb6cf4d3310fde8b624a9cecca00f790573ac96ee")
     version("0.56.0", sha256="87a647dd4b8fce389869ff71f117732de9a519fe07663d9a02d75724eb8e244d")
@@ -22,34 +27,39 @@ class PyNumba(PythonPackage):
     version("0.51.1", sha256="1e765b1a41535684bf3b0465c1d0a24dcbbff6af325270c8f4dad924c0940160")
     version("0.50.1", sha256="89e81b51b880f9b18c82b7095beaccc6856fcf84ba29c4f0ced42e4e5748a3a7")
     version("0.48.0", sha256="9d21bc77e67006b5723052840c88cc59248e079a907cc68f1a1a264e1eaba017")
-    version("0.40.1", sha256="52d046c13bcf0de79dbfb936874b7228f141b9b8e3447cc35855e9ad3e12aa33")
 
-    depends_on("python@3.8:3.11", when="@0.57", type=("build", "run"))
+    depends_on("c", type="build")  # generated
+    depends_on("cxx", type="build")  # generated
+
+    variant("tbb", default=False, description="Build with Intel Threading Building Blocks")
+
+    depends_on("python@3.8:3.11", when="@0.57:", type=("build", "run"))
     depends_on("python@3.7:3.10", when="@0.55:0.56", type=("build", "run"))
     depends_on("python@3.7:3.9", when="@0.54", type=("build", "run"))
     depends_on("python@3.6:3.9", when="@0.53", type=("build", "run"))
     depends_on("python@3.6:3.8", when="@0.52", type=("build", "run"))
     depends_on("python@3.6:3.8", when="@0.48:0.51", type=("build", "run"))
-    depends_on("python@3.3:3.7", when="@0.40.1:0.47", type=("build", "run"))
-    depends_on("py-numpy@1.21:1.24", when="@0.57:", type=("build", "run"))
+    depends_on("py-numpy@1.22:1.26", when="@0.58.1:", type=("build", "run"))
+    depends_on("py-numpy@1.21:1.25", when="@0.58.0", type=("build", "run"))
+    depends_on("py-numpy@1.21:1.24", when="@0.57", type=("build", "run"))
     depends_on("py-numpy@1.18:1.23", when="@0.56.1:0.56.4", type=("build", "run"))
     depends_on("py-numpy@1.18:1.22", when="@0.55.2:0.56.0", type=("build", "run"))
     depends_on("py-numpy@1.18:1.21", when="@0.55.0:0.55.1", type=("build", "run"))
     depends_on("py-numpy@1.17:1.20", when="@0.54", type=("build", "run"))
     depends_on("py-numpy@1.15:1.20", when="@0.48:0.53", type=("build", "run"))
-    depends_on("py-numpy@1.10:1.20", when="@:0.47", type=("build", "run"))
     depends_on("py-setuptools", type=("build", "run"))
+    depends_on("py-llvmlite@0.41", when="@0.58", type=("build", "run"))
     depends_on("py-llvmlite@0.40", when="@0.57", type=("build", "run"))
     depends_on("py-llvmlite@0.39", when="@0.56", type=("build", "run"))
     depends_on("py-llvmlite@0.38", when="@0.55", type=("build", "run"))
     depends_on("py-llvmlite@0.37", when="@0.54.0", type=("build", "run"))
     depends_on("py-llvmlite@0.34", when="@0.51.1", type=("build", "run"))
     depends_on("py-llvmlite@0.33", when="@0.50.1", type=("build", "run"))
-    depends_on("py-llvmlite@0.31", when="@0.47,0.48", type=("build", "run"))
-    depends_on("py-llvmlite@0.25", when="@0.40", type=("build", "run"))
-    depends_on("py-llvmlite@0.20:0.25", when="@0.35.1", type=("build", "run"))
+    depends_on("py-llvmlite@0.31", when="@0.48", type=("build", "run"))
     depends_on("py-importlib-metadata", when="@0.56:^python@:3.8", type=("build", "run"))
 
+    depends_on("tbb", when="+tbb")
+    conflicts("~tbb", when="@:0.50")  # No way to disable TBB
     # Version 6.0.0 of llvm had a hidden symbol which breaks numba at runtime.
     # See https://reviews.llvm.org/D44140
     conflicts("^llvm@6.0.0")
@@ -57,3 +67,7 @@ class PyNumba(PythonPackage):
     # begin EBRAINS (added): numba>=0.57 requires at least version 14.0.0 of LLVM
     conflicts("llvm@:13", when="@0.57.0:")
     # end EBRAINS
+
+    def setup_build_environment(self, env):
+        if self.spec.satisfies("~tbb"):
+            env.set("NUMBA_DISABLE_TBB", "yes")
diff --git a/packages/py-optax/package.py b/packages/py-optax/package.py
deleted file mode 100644
index c5cf8840..00000000
--- a/packages/py-optax/package.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
-
-class PyOptax(PythonPackage):
-    """A gradient processing and optimization library in JAX."""
-
-    homepage = "https://github.com/deepmind/optax"
-    pypi = "optax/optax-0.1.4.tar.gz"
-
-    version("0.1.4", sha256="fb7a0550d57a6636164a3de25986a8a19be8ff6431fcdf1225b4e05175810f22")
-
-    depends_on("python@3.8:", type=("build", "run"))
-    depends_on("py-setuptools", type="build")
-
-    depends_on("py-absl-py@0.7.1:", type=("build", "run"))
-    depends_on("py-chex@0.1.5:", type=("build", "run"))
-    depends_on("py-jax@0.1.55:", type=("build", "run"))
-    depends_on("py-jaxlib@0.1.37:", type=("build", "run"))
-    depends_on("py-numpy@1.18:", type=("build", "run"))
diff --git a/packages/py-pycuda/package.py b/packages/py-pycuda/package.py
index 98691d68..3c3d4926 100644
--- a/packages/py-pycuda/package.py
+++ b/packages/py-pycuda/package.py
@@ -15,6 +15,8 @@ class PyPycuda(PythonPackage):
     homepage = "https://mathema.tician.de/software/pycuda/"
     pypi = "pycuda/pycuda-2019.1.2.tar.gz"
 
+    license("MIT")
+
     # begin EBRAINS (added): add version
     version("2023.1", sha256="175ff675f0cf10e38e9adc03ed5df3ed8d8abf7da5134c8dccec752e8a0a3e91")
     # end EBRAINS
@@ -23,6 +25,8 @@ class PyPycuda(PythonPackage):
     version("2019.1.2", sha256="ada56ce98a41f9f95fe18809f38afbae473a5c62d346cfa126a2d5477f24cc8a")
     version("2016.1.2", sha256="a7dbdac7e2f0c0d2ad98f5f281d5a9d29d6673b3c20210e261b96e9a2d0b6e37")
 
+    depends_on("cxx", type="build")  # generated
+
     @run_before("install")
     def configure(self):
         pyver = self.spec["python"].version.up_to(2).joined
diff --git a/packages/py-pyvista/package.py b/packages/py-pyvista/package.py
deleted file mode 100644
index 38054a2f..00000000
--- a/packages/py-pyvista/package.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class PyPyvista(PythonPackage):
-    """Easier Pythonic interface to VTK."""
-
-    homepage = "https://github.com/pyvista/pyvista"
-    pypi = "pyvista/pyvista-0.32.1.tar.gz"
-
-    # Requires optional trame dependency
-    skip_modules = ["pyvista.ext", "pyvista.jupyter", "pyvista.trame"]
-
-    maintainers("banesullivan")
-
-    license("MIT")
-
-    # begin EBRAINS (added): add version
-    version("0.43.0", sha256="0118060d56de7f9b583405723ddd8f77f20d7d8af601ad7c0b0521c6302069cf")
-    # end EBRAINS
-    version("0.42.3", sha256="00159cf0dea05c1ecfd1695c8c6ccfcfff71b0744c9997fc0276e661dc052351")
-    version("0.37.0", sha256="d36a2c6d5f53f473ab6a9241669693acee7a5179394dc97595da14cc1de23141")
-    version("0.32.1", sha256="585ac79524e351924730aff9b7207d6c5ac4175dbb5d33f7a9a2de22ae53dbf9")
-
-    depends_on("py-setuptools", type="build")
-    depends_on("py-matplotlib@3.0.1:", when="@0.39:", type=("build", "run"))
-    depends_on("py-numpy", type=("build", "run"))
-    depends_on("pil", type=("build", "run"))
-    depends_on("py-pooch", when="@0.37:", type=("build", "run"))
-    depends_on("py-scooby@0.5.1:", type=("build", "run"))
-    depends_on("vtk+python", type=("build", "run"))
-    depends_on("py-typing-extensions", when="^python@:3.7", type=("build", "run"))
-
-    # Historical dependencies
-    depends_on("py-appdirs", when="@:0.36", type=("build", "run"))
-    depends_on("py-imageio", when="@:0.38", type=("build", "run"))
-    depends_on("py-meshio@4.0.3:4", when="@:0.32", type=("build", "run"))
-
-    # '>=3.7.*' in python_requires: setuptools parser changed in v60 and errors.
-    depends_on("py-setuptools@:59", when="@:0.37", type="build")
diff --git a/packages/py-pyviz-comms/package.py b/packages/py-pyviz-comms/package.py
index 0e6d6c84..03ed4163 100644
--- a/packages/py-pyviz-comms/package.py
+++ b/packages/py-pyviz-comms/package.py
@@ -12,6 +12,8 @@ class PyPyvizComms(PythonPackage):
     homepage = "https://holoviz.org/"
     pypi = "pyviz_comms/pyviz_comms-2.2.1.tar.gz"
 
+    license("BSD-3-Clause")
+
     # begin EBRAINS (added): add version
     version("2.3.2", sha256="542a10fed8242d3a9d468ed0a14d6a2537e589c3f8a7986c79c374591254d6b4")
     # end EBRAINS
diff --git a/packages/py-ray/package.py b/packages/py-ray/package.py
index 6feab9f5..82ba34c4 100644
--- a/packages/py-ray/package.py
+++ b/packages/py-ray/package.py
@@ -3,6 +3,7 @@
 #
 # SPDX-License-Identifier: (Apache-2.0 OR MIT)
 
+
 from spack.package import *
 
 
@@ -12,12 +13,17 @@ class PyRay(PythonPackage):
     homepage = "https://github.com/ray-project/ray"
     url = "https://github.com/ray-project/ray/archive/ray-0.8.7.tar.gz"
 
+    license("Apache-2.0")
+
     # begin EBRAINS (added): ECM new node-js -> new react whatever -> new py-ray
     version("2.4.0", sha256="b0110a84630b2f6d10cd13e8ac955875c3658373eb6cabcc77cf316de3c28066")
     # end EBRAINS
     version("2.0.1", sha256="b8b2f0a99d2ac4c001ff11c78b4521b217e2a02df95fb6270fd621412143f28b")
     version("0.8.7", sha256="2df328f1bcd3eeb4fa33119142ea0d669396f4ab2a3e78db90178757aa61534b")
 
+    depends_on("c", type="build")  # generated
+    depends_on("cxx", type="build")  # generated
+
     variant("default", default=False, description="Install default extras", when="@2.0.1")
 
     # begin EBRAINS (added): ECM new node-js -> new react whatever -> new py-ray
diff --git a/packages/py-sympy/package.py b/packages/py-sympy/package.py
index b7f5b90e..ffdfe371 100644
--- a/packages/py-sympy/package.py
+++ b/packages/py-sympy/package.py
@@ -11,11 +11,15 @@ class PySympy(PythonPackage):
 
     pypi = "sympy/sympy-0.7.6.tar.gz"
 
+    license("BSD-3-Clause")
+
+    version("1.13.0", sha256="3b6af8f4d008b9a1a6a4268b335b984b23835f26d1d60b0526ebc71d48a25f57")
+    version("1.12", sha256="ebf595c8dac3e0fdc4152c51878b498396ec7f30e7a914d6071e674d49420fb8")
     version("1.11.1", sha256="e32380dce63cb7c0108ed525570092fd45168bdae2faa17e528221ef72e88658")
     # begin EBRAINS (added): add versions
     version("1.10.1", sha256="5939eeffdf9e152172601463626c022a2c27e75cf6278de8d401d50c9d58787b")
     version("1.9", sha256="c7a880e229df96759f955d4f3970d4cabce79f60f5b18830c08b90ce77cd5fdc")
-    # end EBRAINS
+    # end EBRAINS    
     version("1.8", sha256="1ca588a9f6ce6a323c5592f9635159c2093572826668a1022c75c75bdf0297cb")
     version("1.7.1", sha256="a3de9261e97535b83bb8607b0da2c7d03126650fafea2b2789657b229c246b2e")
     version("1.7", sha256="9104004669cda847f38cfd8cd16dd174952c537349dbae740fea5331d2b3a51b")
@@ -38,4 +42,5 @@ class PySympy(PythonPackage):
 
     # pip silently replaces distutils with setuptools
     depends_on("py-setuptools", type="build")
-    depends_on("py-mpmath@0.19:", when="@1.0:", type=("build", "run"))
+    depends_on("py-mpmath@0.19:", when="@1.0:1.12", type=("build", "run"))
+    depends_on("py-mpmath@1.1.0:1.3", when="@1.13.0:", type=("build", "run"))
diff --git a/packages/py-tree-math/package.py b/packages/py-tree-math/package.py
deleted file mode 100644
index 69ba02f5..00000000
--- a/packages/py-tree-math/package.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
-
-class PyTreeMath(PythonPackage):
-    """
-    tree-math makes it easy to implement numerical algorithms that work on
-    JAX pytrees, such as iterative methods for optimization and equation
-    solving. It does so by providing a wrapper class tree_math.Vector that
-    defines array operations such as infix arithmetic and dot-products on
-    pytrees as if they were vectors.
-    """
-
-    homepage = "https://github.com/google/tree-math"
-    pypi = "tree-math/tree-math-0.1.0.tar.gz"
-    git = "https://github.com/google/tree-math.git"
-
-    version('0.1.0.post', commit='0af9679125c13cc38dab5159bc8413ed79465344')
-    version('0.1.0', sha256='77eb8d6ba4d6cfdd2d986a6bc3fc2d1b16212f0172863a3ca509720babf75929')
-
-    depends_on('py-setuptools', type='build')
-    depends_on('py-jax', type=('build', 'run'))
diff --git a/packages/sbml/package.py b/packages/sbml/package.py
index e1bfdcef..f54fbb6b 100644
--- a/packages/sbml/package.py
+++ b/packages/sbml/package.py
@@ -14,6 +14,8 @@ class Sbml(CMakePackage):
     homepage = "https://sbml.org"
     maintainers("rblake-llnl")
 
+    license("LGPL-2.1-or-later")
+
     # begin EBRAINS (added): add version
     version("5.19.0", sha256="a7f0e18be78ff0e064e4cdb1cd86634d08bc33be5250db4a1878bd81eeb8b547")
     # end EBRAINS
@@ -28,6 +30,9 @@ class Sbml(CMakePackage):
     version("5.10.2", sha256="83f32a143cf657672b1050f5f79d3591c418fc59570d180fb1f39b103f4e5286")
     version("5.10.0", sha256="2cd8b37018ce8b1df869c8c182803addbce6d451512ae25a7f527b49981f0966")
 
+    depends_on("c", type="build")  # generated
+    depends_on("cxx", type="build")  # generated
+
     def url_for_version(self, version):
         url = "https://downloads.sourceforge.net/project/sbml/libsbml/{0}/stable/libSBML-{1}-core-plus-packages-src.tar.gz".format(
             version, version
diff --git a/packages/simpletraj/package.py b/packages/simpletraj/package.py
deleted file mode 100644
index be6fc871..00000000
--- a/packages/simpletraj/package.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
-class Simpletraj(PythonPackage):
-    """Lightweight coordinate-only trajectory reader based on code from GROMACS, MDAnalysis and VMD."""
-
-    # Homepage and download url
-    homepage = "https://github.com/arose/simpletraj"
-    git = 'https://github.com/arose/simpletraj.git'
-    url = 'https://github.com/arose/simpletraj/archive/refs/tags/v0.3.tar.gz'
-
-    # Set the gitlab accounts of this package maintainers
-    maintainers = ['dbeltran']
-
-    # Versions
-    version('master', branch='master')
-    version('0.3', sha256='9ee9b5f3e387f8f8eb74b11f5c5d60bab6f601d190b40e38a7b31afddc3574d0')
-
-    # Dependencies
-    depends_on('python@3.8:', type=('build', 'run'))
-    depends_on('py-setuptools')
-    depends_on('py-numpy')
-
-    # Test
-    @run_after('install')
-    @on_package_attributes(run_tests=True)
-    def check_install (self):
-        python("-c", 'import simpletraj')
diff --git a/packages/sleef/package.py b/packages/sleef/package.py
deleted file mode 100644
index 796219df..00000000
--- a/packages/sleef/package.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
-# Spack Project Developers. See the top-level COPYRIGHT file for details.
-#
-# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack.package import *
-
-
-class Sleef(CMakePackage):
-    """SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT."""
-
-    homepage = "https://sleef.org"
-    url = "https://github.com/shibatch/sleef/archive/3.2.tar.gz"
-    git = "https://github.com/shibatch/sleef.git"
-
-    version("master", branch="master")
-    version("3.5.1_2020-12-22", commit="e0a003ee838b75d11763aa9c3ef17bf71a725bff")  # py-torch@1.8:
-    version(
-        "3.5.1",
-        sha256="415ee9b1bcc5816989d3d4d92afd0cd3f9ee89cbd5a33eb008e69751e40438ab",
-        preferred=True,
-    )
-    version(
-        "3.4.0_2019-07-30", commit="7f523de651585fe25cade462efccca647dcc8d02"
-    )  # py-torch@1.3:1.7
-    version(
-        "3.4.0_2019-05-13",
-        commit="9b249c53a80343cc1a394ca961d7d5696ea76409",  # py-torch@1.2
-        git="https://github.com/zdevito/sleef.git",
-    )
-    version(
-        "3.3.1_2018-12-09",
-        commit="191f655caa25526ae226cf88dd2529265176014a",  # py-torch@1.1
-        git="https://github.com/zdevito/sleef.git",
-    )
-    version(
-        "3.2_2018-05-09", commit="6ff7a135a1e31979d1e1844a2e7171dfbd34f54f"
-    )  # py-torch@0.4.1:1.0
-    version("3.2", sha256="3130c5966e204e6d6a3ace81e543d12b5b21f60897f1c185bfa587c1bd77bee2")
-
-    # https://github.com/shibatch/sleef/issues/474
-    conflicts("%apple-clang@15:")
-
-    generator("ninja")
-    depends_on("cmake@3.4.3:", type="build")
-
-    # # https://github.com/shibatch/sleef/issues/475
-    # depends_on("fftw-api")
-    # depends_on("mpfr")
-    # depends_on("openssl")
-
-    # # https://github.com/shibatch/sleef/issues/458
-    # conflicts("^mpfr@4.2:")
-
-    # begin EBRAINS (modified): removed "disable shared lib build" to fix py-torch
-    #                           this was fixed upstream in 8c061e51.
-    def cmake_args(self):
-        # https://salsa.debian.org/science-team/sleef/-/blob/master/debian/rules
-        return [
-            self.define("BUILD_DFT", False),
-            self.define("BUILD_TESTS", False),
-        ]
-    # end EBRAINS
diff --git a/packages/wf-biobb/package.py b/packages/wf-biobb/package.py
index dbcd5b17..28ff7c41 100644
--- a/packages/wf-biobb/package.py
+++ b/packages/wf-biobb/package.py
@@ -16,5 +16,5 @@ class WfBiobb(BundlePackage):
     version("0.1")
 
     depends_on("py-plotly")
-    depends_on("nglview")
-    depends_on("simpletraj")
+    depends_on("py-nglview")
+    depends_on("py-simpletraj")
-- 
GitLab