Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP tests fails with GCC 14.0.1 #2765

Closed
jplesnik opened this issue Jan 19, 2024 · 2 comments
Closed

PHP tests fails with GCC 14.0.1 #2765

jplesnik opened this issue Jan 19, 2024 · 2 comments
Labels

Comments

@jplesnik
Copy link
Contributor

PHP tests are failing with new GCC 14.0.1 in Fedora Rawhide.

/usr/include/php/Zend/zend_atomic.h: In function ‘zend_atomic_bool_exchange_ex’:
/usr/include/php/Zend/zend_atomic.h:88:16: error: implicit declaration of function ‘__c11_atomic_exchange’; did you mean ‘__atomic_exchange’? [-Wimplicit-function-declaration]
   88 |         return __c11_atomic_exchange(&obj->value, desired, __ATOMIC_SEQ_CST);
      |                ^~~~~~~~~~~~~~~~~~~~~
      |                __atomic_exchange
/usr/include/php/Zend/zend_atomic.h: In function ‘zend_atomic_bool_load_ex’:
/usr/include/php/Zend/zend_atomic.h:92:16: error: implicit declaration of function ‘__c11_atomic_load’; did you mean ‘__atomic_load’? [-Wimplicit-function-declaration]
   92 |         return __c11_atomic_load(&obj->value, __ATOMIC_SEQ_CST);
      |                ^~~~~~~~~~~~~~~~~
      |                __atomic_load
/usr/include/php/Zend/zend_atomic.h: In function ‘zend_atomic_bool_store_ex’:
/usr/include/php/Zend/zend_atomic.h:96:9: error: implicit declaration of function ‘__c11_atomic_store’; did you mean ‘__atomic_store’? [-Wimplicit-function-declaration]
   96 |         __c11_atomic_store(&obj->value, desired, __ATOMIC_SEQ_CST);
      |         ^~~~~~~~~~~~~~~~~~
      |         __atomic_store

The tests fail for SWIG 4.1.0, more detail about dependency changes are on
https://koschei.fedoraproject.org/build/17075088

The tests fail also for the latest commit 521d43d
https://copr.fedorainfracloud.org/coprs/jplesnik/swig-rebuild/build/6917038/

@ojwb
Copy link
Member

ojwb commented Jan 19, 2024

The error is in code in the PHP API headers, so this doesn't look like SWIG's fault to me.

@ojwb ojwb added the PHP label Jan 19, 2024
@ojwb
Copy link
Member

ojwb commented Jan 19, 2024

The missing functions seem to be clang-specific: https://releases.llvm.org/15.0.0/tools/clang/docs/LanguageExtensions.html#c11-atomic-builtins

PHP's zend_atomic.h tests #if __has_feature(c_atomic) but assumes that's only true for clang, but it's now true for GCC as well but GCC doesn't provide these functions with the non-standard names.

A simple fix would probably be to change that conditional in PHP to:

#if __has_feature(c_atomic) && defined __clang__

Not a SWIG bug so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants