blob: 4e4dc0d5fac0a770026e71fba85eb261b5a82ae0 [file] [log] [blame]
Don't override the provided CC variable when probing for a C toolchain
inside of `ctypes.util`. Without this fix pypy3's build is broken as it uses
this probing logic and therefore will invoke unprefixed `gcc`, which is
forbidden in the CrOS SDK.
diff --git a/Python-2.7.15/Lib/ctypes/util.py b/Python-2.7.15/Lib/ctypes/util.py
index ab10ec5..e53667d 100644
--- a/Python-2.7.15/Lib/ctypes/util.py
+++ b/Python-2.7.15/Lib/ctypes/util.py
@@ -93,7 +93,7 @@ elif os.name == "posix":
# haven't supplied a proper program with main(), but that does not
# matter.
expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
- cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; elif type cc >/dev/null 2>&1; then CC=cc;else exit; fi;' \
+ cmd = 'if type gcc >/dev/null 2>&1; then : ${CC:=gcc}; elif type cc >/dev/null 2>&1; then : ${CC:=cc}; fi;' \
'LANG=C LC_ALL=C $CC -Wl,-t -o "$2" 2>&1 -l"$1"'
temp = tempfile.NamedTemporaryFile()