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