diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2020-11-08 09:05:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-08 09:05:27 (GMT) |
commit | 41761933c1c30bb6003b65eef1ba23a83db4eae4 (patch) | |
tree | 0a8fa35d890b61bc2c688bb966773f7aa026f3b1 /Mac/Tools | |
parent | fd6f6fa403789c8877b1099cc6fcc437d2e54634 (diff) | |
download | cpython-41761933c1c30bb6003b65eef1ba23a83db4eae4.zip cpython-41761933c1c30bb6003b65eef1ba23a83db4eae4.tar.gz cpython-41761933c1c30bb6003b65eef1ba23a83db4eae4.tar.bz2 |
bpo-41100: Support macOS 11 and Apple Silicon (GH-22855)
Co-authored-by: Lawrence D’Anna <lawrence_danna@apple.com>
* Add support for macOS 11 and Apple Silicon (aka arm64)
As a side effect of this work use the system copy of libffi on macOS, and remove the vendored copy
* Support building on recent versions of macOS while deploying to older versions
This allows building installers on macOS 11 while still supporting macOS 10.9.
Diffstat (limited to 'Mac/Tools')
-rw-r--r-- | Mac/Tools/pythonw.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Mac/Tools/pythonw.c b/Mac/Tools/pythonw.c index c8bd3ba..78813e8 100644 --- a/Mac/Tools/pythonw.c +++ b/Mac/Tools/pythonw.c @@ -95,9 +95,6 @@ setup_spawnattr(posix_spawnattr_t* spawnattr) size_t count; cpu_type_t cpu_types[1]; short flags = 0; -#ifdef __LP64__ - int ch; -#endif if ((errno = posix_spawnattr_init(spawnattr)) != 0) { err(2, "posix_spawnattr_int"); @@ -119,10 +116,16 @@ setup_spawnattr(posix_spawnattr_t* spawnattr) #elif defined(__ppc__) cpu_types[0] = CPU_TYPE_POWERPC; + #elif defined(__i386__) cpu_types[0] = CPU_TYPE_X86; + +#elif defined(__arm64__) + cpu_types[0] = CPU_TYPE_ARM64; + #else # error "Unknown CPU" + #endif if (posix_spawnattr_setbinpref_np(spawnattr, count, @@ -220,7 +223,8 @@ main(int argc, char **argv) { /* We're weak-linking to posix-spawnv to ensure that * an executable build on 10.5 can work on 10.4. */ - if (posix_spawn != NULL) { + + if (&posix_spawn != NULL) { posix_spawnattr_t spawnattr = NULL; setup_spawnattr(&spawnattr); |