From 12442dc2a540224a1afe4919a0c2ebdd024d9824 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 17 Jul 2026 09:30:33 -0400 Subject: [PATCH] bzip2: use configured C compiler when editing Makefiles --- repos/spack_repo/builtin/packages/bzip2/package.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/repos/spack_repo/builtin/packages/bzip2/package.py b/repos/spack_repo/builtin/packages/bzip2/package.py index ff5695ffa16..34e060e5752 100644 --- a/repos/spack_repo/builtin/packages/bzip2/package.py +++ b/repos/spack_repo/builtin/packages/bzip2/package.py @@ -83,10 +83,12 @@ def patch(self): if self.spec.satisfies("platform=windows"): return - # bzip2 comes with two separate Makefiles for static and dynamic builds - # Tell both to use Spack's compiler wrapper instead of GCC - filter_file(r"^CC=gcc", "CC={0}".format(spack_cc), "Makefile") - filter_file(r"^CC=gcc", "CC={0}".format(spack_cc), "Makefile-libbz2_so") + # bzip2 comes with two separate Makefiles for static and dynamic builds. + # Tell both to use the configured C compiler instead of GCC. `spack_cc` + # is no longer injected as a package-module global during this phase. + cc = self.compiler.cc + filter_file(r"^CC=gcc", "CC={0}".format(cc), "Makefile") + filter_file(r"^CC=gcc", "CC={0}".format(cc), "Makefile-libbz2_so") # The Makefiles use GCC flags that are incompatible with PGI if self.spec.satisfies("%nvhpc@:20.11"):