Skip to content

Fix mingw build re atomic functions - #198

Merged
mattip merged 1 commit into
python-cffi:mainfrom
lazka:fix-mingw-build
Sep 11, 2025
Merged

Fix mingw build re atomic functions#198
mattip merged 1 commit into
python-cffi:mainfrom
lazka:fix-mingw-build

Conversation

@lazka

@lazka lazka commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

Multiple issues making the build fail:

Just use the builtin compiler intrinsics everywhere for GCC/Clang when targeting Windows. Same as is already done in misc_thread_posix.h

See #159

Multiple issues making the build fail:

* _InterlockedExchange8 is missing in mingw-w64, filed in
  mingw-w64/mingw-w64#118
* cffi_atomic_store_ssize is missing casts, leading to errors
* __ldar8/__ldar64 are not supported in gcc/clang

Just use the builtin compiler intrinsics everywhere for GCC/Clang
when targeting Windows. Same as is already done in misc_thread_posix.h

See python-cffi#159
@mattip

mattip commented Sep 10, 2025

Copy link
Copy Markdown
Contributor

Pending #137 to make the windows CI runs faster, maybe we should add a mingw CI run for a single python version. On the other hand, what is the priority for this compiler? I would expect many mingw users can pip install cffi, use the binary wheel we provide, and not have to compile from source.

@lazka

lazka commented Sep 10, 2025

Copy link
Copy Markdown
Contributor Author

There is no priority for me at least, I patched it downstream in MSYS2 already. I just had the patch anyway, and saw the issue, so proposed it.

There are no compatible binary wheels, so pip always builds from source (and as a result it's not easy/error prone)

@mattip
mattip merged commit bd69b85 into python-cffi:main Sep 11, 2025
32 checks passed
@mattip

mattip commented Sep 11, 2025

Copy link
Copy Markdown
Contributor

Thanks @lazka

@lazka

lazka commented Sep 12, 2025

Copy link
Copy Markdown
Contributor Author

Thanks!

@lazka

lazka commented Mar 4, 2026

Copy link
Copy Markdown
Contributor Author

Just wondering, is there a release planned which includes this?

I would appreciate it :)

@mattip

mattip commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

@nitzmahone any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants