https://trac.macports.org/ticket/49272 https://bugs.python.org/issue24844 Compiling python fails in Xcode 4 (clang < 3.3) where existence of 'atomic' is detected by configure, but it is not fully functional. --- configure.orig 2020-07-13 07:11:53.000000000 -0500 +++ configure 2020-07-15 10:20:09.000000000 -0500 @@ -16837,6 +16837,24 @@ volatile int val = 1; int main() { __atomic_load_n(&val, __ATOMIC_SEQ_CST); + + // https://bugs.python.org/issue24844 + #define VERSION_CHECK(cc_major, cc_minor, req_major, req_minor) \ + ((cc_major) > (req_major) || \ + (cc_major) == (req_major) && (cc_minor) >= (req_minor)) + #if defined(__clang__) + #if defined(__apple_build_version__) + // either one test or the other should work + // #if __apple_build_version__ < 5000000 + #if !VERSION_CHECK(__clang_major__, __clang_minor__, 5, 0) + #error + #endif + // not sure if this is 3.3 or 3.4 + #elif !VERSION_CHECK(__clang_major__, __clang_minor__, 3, 3) + #error + #endif + #endif + return 0; }