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

[gcc version 7.3.1] error: '__builtin_saddl_overflow' was not declared in this scope #2119

Closed
smithzhang010 opened this issue Nov 13, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@smithzhang010
Copy link

commented Nov 13, 2018

/bin/sh /root/swoole-src/libtool --mode=compile g++ -I. -I/root/swoole-src -DPHP_ATOM_INC -I/root/swoole-src/include -I/root/swoole-src/main -I/root/swoole-src -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/thirdparty/hiredis -I/root/swoole-src -I/root/swoole-src/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /root/swoole-src/swoole_async.cc -o swoole_async.lo
libtool: compile: g++ -I. -I/root/swoole-src -DPHP_ATOM_INC -I/root/swoole-src/include -I/root/swoole-src/main -I/root/swoole-src -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/thirdparty/hiredis -I/root/swoole-src -I/root/swoole-src/include -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /root/swoole-src/swoole_async.cc -fPIC -DPIC -o .libs/swoole_async.o
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 /root/swoole-src/php_swoole.h:25,
from /root/swoole-src/swoole_async.cc:17:
/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)

                                                ^

make: *** [swoole_async.lo] Error 1

============ gcc 目前版本 =========
[root@xxxxxxswoole-src]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-7/root/usr --mandir=/opt/rh/devtoolset-7/root/usr/share/man --infodir=/opt/rh/devtoolset-7/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-plugin --with-linker-hash-style=gnu --enable-initfini-array --with-default-libstdcxx-abi=gcc4-compatible --with-isl=/builddir/build/BUILD/gcc-7.3.1-20180303/obj-x86_64-redhat-linux/isl-install --enable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)

@twose

This comment has been minimized.

Copy link
Member

commented Nov 13, 2018

Ping @petk , I really don't know too much about it, can you take a look? thanks.

@twose twose added the installation label Nov 13, 2018

@baiyou520

This comment has been minimized.

Copy link

commented Nov 17, 2018

同样的错误,gcc 从4.8.5升级到5.4再到8.2,还是这个问题。 不知是否和php版本有关,php:7.2.12, centos7.4,swoole 4.2.7

@petk

This comment has been minimized.

Copy link
Contributor

commented Nov 17, 2018

Hello, I unfortunately don't have much idea what this issue is about. Care to explain how this can be reproduced? Any particular steps how this happens?

@baiyou520

This comment has been minimized.

Copy link

commented Nov 17, 2018

hi @petk , bellow is the detail steps:
os:centos7.4 php:7.2.12 (install by yum)
steps for install swoole:
1.git clone https://github.com/swoole/swoole-src.git
2.cd swoole-src
3.sudo phpize
4.sudo ./configure
5.sudo make && make install

i have upgrade gcc from 4.8.5 to 5.4.0 to 8.2.0, still have this issue

thanks,
billy

@twose

This comment has been minimized.

@baiyou520

This comment has been minimized.

Copy link

commented Nov 18, 2018

@twose yes i found another similar solution :microsoft/msphpsql#726
now it works. thanks.

@twose

This comment has been minimized.

Copy link
Member

commented Nov 18, 2018

it seems like the same solution
I will record it, thanks everyone for trying.

sudo yum install centos-release-scl
sudo yum install devtoolset-7
scl enable devtoolset-7 bash
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.