Chris McDonald | 9b1ed16 | 2020-10-19 17:33:59 -0600 | [diff] [blame^] | 1 | Don't override the provided CC variable when probing for a C toolchain |
| 2 | inside of `ctypes.util`. Without this fix pypy3's build is broken as it uses |
| 3 | this probing logic and therefore will invoke unprefixed `gcc`, which is |
| 4 | forbidden in the CrOS SDK. |
| 5 | |
| 6 | diff --git a/Python-2.7.15/Lib/ctypes/util.py b/Python-2.7.15/Lib/ctypes/util.py |
| 7 | index 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() |