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

Error compiling on PHP 7.2.7 #381

Closed
komapa opened this Issue Jul 12, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@komapa
Copy link

commented Jul 12, 2018

Trying to compile version 2.1.0 which claims compatibility with PHP 7.2

+ make
mkdir -p shared/common
mkdir -p shared/zend
g++ -Wall -c -std=c++11 -fvisibility=hidden -DBUILDING_PHPCPP -Wno-write-strings -MD -g -fpic -o shared/common/streambuf.o common/streambuf.cpp
g++ -Wall -c -std=c++11 -fvisibility=hidden -DBUILDING_PHPCPP -Wno-write-strings -MD -g -fpic -o shared/common/modifiers.o common/modifiers.cpp
g++ -Wall -c -std=c++11 -fvisibility=hidden -DBUILDING_PHPCPP -Wno-write-strings -MD -g `php-config --includes` -fpic -o shared/zend/inivalue.o zend/inivalue.cpp
In file included from /usr/include/php/Zend/zend_types.h:27:0,
                 from /usr/include/php/Zend/zend.h:29,
                 from /usr/include/php/main/php.h:35,
                 from zend/includes.h:40,
                 from zend/inivalue.cpp:8:
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_increment_function(zval*)':
/usr/include/php/Zend/zend_operators.h:446:68: error: '__builtin_saddl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
                                                                    ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_decrement_function(zval*)':
/usr/include/php/Zend/zend_operators.h:500:68: error: '__builtin_ssubl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), 1, &lresult))) {
                                                                    ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_add_function(zval*, zval*, zval*)':
/usr/include/php/Zend/zend_operators.h:554:80: error: '__builtin_saddl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_saddl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
                                                                                ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
                                                    ^
/usr/include/php/Zend/zend_operators.h: In function 'void fast_long_sub_function(zval*, zval*, zval*)':
/usr/include/php/Zend/zend_operators.h:657:80: error: '__builtin_ssubl_overflow' was not declared in this scope
  if (UNEXPECTED(__builtin_ssubl_overflow(Z_LVAL_P(op1), Z_LVAL_P(op2), &lresult))) {
                                                                                ^
/usr/include/php/Zend/zend_portability.h:312:52: note: in definition of macro 'UNEXPECTED'
 # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)

gcc is version 4.9.2

Let me know what other information I can provide. Thanks!

@sjinks

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2018

__builtin_saddl_overflow was introduced in GCC 5. It looks like you will need at least GCC 5 to compile PHP 7.2

@sjinks

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2018

As a workaround, you can open /usr/include/php/main/php_config.h and comment out

#define PHP_HAVE_BUILTIN_SADDL_OVERFLOW 1
#define PHP_HAVE_BUILTIN_SSUBL_OVERFLOW 1

etc, as it looks like in your system PHP was compiled by a newer compiler than you are using to build php-cpp.

@mvdwerve

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2018

Yeah, that has to do with your PHP installation. 4.9 can definitely compile PHP-CPP under PHP 7.2.7. Closing this issue.

@mvdwerve mvdwerve closed this Jul 13, 2018

@komapa

This comment has been minimized.

Copy link
Author

commented Jul 13, 2018

Thank you. This gives me enough direction to resolve it on my end. Appreaciate the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.