From 40940c1ebd824d36f578c88b6cb3aab9b04dc682 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 27 Feb 2025 13:48:03 -0600 Subject: [PATCH] Populate CXX during builds to avoid calling the system toolchain --- cpython-unix/build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cpython-unix/build.py b/cpython-unix/build.py index da66ba4e..97ceaebb 100755 --- a/cpython-unix/build.py +++ b/cpython-unix/build.py @@ -101,6 +101,9 @@ def add_target_env(env, build_platform, target_triple, build_env): env["HOST_CC"] = settings["host_cc"] env["HOST_CXX"] = settings["host_cxx"] env["CC"] = settings["target_cc"] + # We always set CXX, otherwise a build could bypass our toolchain + # accidentally, e.g., on macOS where `g++` links to the system clang. + env["CXX"] = settings.get("target_cxx", settings.get("host_cxx")) if settings.get("bolt_capable"): env["BOLT_CAPABLE"] = "1"