Skip to content

Build error on macOS ARM no GIL #857

@jaraco

Description

@jaraco

Attempting to build on Python 3.14t on macOS on ARM, I get the following failure:

      building '_sodium' extension
      creating build/temp.macosx-15.1-arm64-cpython-314t/build/temp.macosx-15.1-arm64-cpython-314t
      gcc -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -I/opt/python/include/python3.14t -Ibuild/temp.macosx-15.1-arm64-cpython-314t/include -c build/temp.macosx-15.1-arm64-cpython-314t/_sodium.c -o build/temp.macosx-15.1-arm64-cpython-314t/build/temp.macosx-15.1-arm64-cpython-314t/_sodium.o
      In file included from build/temp.macosx-15.1-arm64-cpython-314t/_sodium.c:57:
      /opt/python/include/python3.14t/Python.h:51:4: error: "The limited API is not currently supported in the free-threaded build"
         51 | #  error "The limited API is not currently supported in the free-threaded build"
            |    ^
      In file included from build/temp.macosx-15.1-arm64-cpython-314t/_sodium.c:57:
      In file included from /opt/python/include/python3.14t/Python.h:72:
      /opt/python/include/python3.14t/object.h:146:5: error: unknown type name 'PyMutex'
        146 |     PyMutex ob_mutex;           // per-object lock
            |     ^
      /opt/python/include/python3.14t/object.h:299:5: error: call to undeclared function '_Py_atomic_store_ssize_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        299 |     _Py_atomic_store_ssize_relaxed(&ob->ob_size, size);
            |     ^
      In file included from build/temp.macosx-15.1-arm64-cpython-314t/_sodium.c:57:
      In file included from /opt/python/include/python3.14t/Python.h:73:
      /opt/python/include/python3.14t/refcount.h:97:26: error: call to undeclared function '_Py_atomic_load_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
         97 |         uint32_t local = _Py_atomic_load_uint32_relaxed(&ob->ob_ref_local);
            |                          ^
      /opt/python/include/python3.14t/refcount.h:101:29: error: call to undeclared function '_Py_atomic_load_ssize_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        101 |         Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&ob->ob_ref_shared);
            |                             ^
      /opt/python/include/python3.14t/refcount.h:115:13: error: call to undeclared function '_Py_atomic_load_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        115 |     return (_Py_atomic_load_uint32_relaxed(&op->ob_ref_local) ==
            |             ^
      /opt/python/include/python3.14t/refcount.h:115:63: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
        115 |     return (_Py_atomic_load_uint32_relaxed(&op->ob_ref_local) ==
            |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
        116 |             _Py_IMMORTAL_REFCNT_LOCAL);
            |             ~~~~~~~~~~~~~~~~~~~~~~~~~
      /opt/python/include/python3.14t/refcount.h:146:9: error: call to undeclared function '_Py_IsOwnedByCurrentThread'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        146 |     if (_Py_IsOwnedByCurrentThread(ob)) {
            |         ^
      /opt/python/include/python3.14t/refcount.h:241:22: error: call to undeclared function '_Py_atomic_load_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        241 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&op->ob_ref_local);
            |                      ^
      /opt/python/include/python3.14t/refcount.h:248:9: error: call to undeclared function '_Py_IsOwnedByCurrentThread'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        248 |     if (_Py_IsOwnedByCurrentThread(op)) {
            |         ^
      /opt/python/include/python3.14t/refcount.h:249:9: error: call to undeclared function '_Py_atomic_store_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        249 |         _Py_atomic_store_uint32_relaxed(&op->ob_ref_local, new_local);
            |         ^
      /opt/python/include/python3.14t/refcount.h:252:9: error: call to undeclared function '_Py_atomic_add_ssize'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        252 |         _Py_atomic_add_ssize(&op->ob_ref_shared, (1 << _Py_REF_SHARED_SHIFT));
            |         ^
      /opt/python/include/python3.14t/refcount.h:335:22: error: call to undeclared function '_Py_atomic_load_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        335 |     uint32_t local = _Py_atomic_load_uint32_relaxed(&op->ob_ref_local);
            |                      ^
      /opt/python/include/python3.14t/refcount.h:341:9: error: call to undeclared function '_Py_IsOwnedByCurrentThread'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        341 |     if (_Py_IsOwnedByCurrentThread(op)) {
            |         ^
      /opt/python/include/python3.14t/refcount.h:343:9: error: call to undeclared function '_Py_atomic_store_uint32_relaxed'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        343 |         _Py_atomic_store_uint32_relaxed(&op->ob_ref_local, local);
            |         ^
      /opt/python/include/python3.14t/refcount.h:345:13: error: call to undeclared function '_Py_MergeZeroLocalRefcount'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        345 |             _Py_MergeZeroLocalRefcount(op);
            |             ^
      /opt/python/include/python3.14t/refcount.h:349:9: error: call to undeclared function '_Py_DecRefShared'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        349 |         _Py_DecRefShared(op);
            |         ^
      1 warning and 16 errors generated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error orig

This may or may not be related to #834.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions