ice / framework

Source code of Ice framework
https://www.iceframework.org
BSD 3-Clause "New" or "Revised" License
341 stars 45 forks source link

fix build with recent GCC #266

Closed remicollet closed 4 years ago

remicollet commented 4 years ago

Trying to build with GCC 10

/usr/bin/ld: kernel/.libs/main.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defi
ned here
/usr/bin/ld: kernel/.libs/memory.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first de
fined here
/usr/bin/ld: kernel/.libs/exception.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first
 defined here
/usr/bin/ld: kernel/.libs/debug.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first def
ined here
/usr/bin/ld: kernel/.libs/object.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
/usr/bin/ld: kernel/.libs/array.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
/usr/bin/ld: kernel/.libs/string.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
/usr/bin/ld: kernel/.libs/fcall.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
/usr/bin/ld: kernel/.libs/require.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
/usr/bin/ld: kernel/.libs/file.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
/usr/bin/ld: kernel/.libs/operators.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defined here
/usr/bin/ld: kernel/.libs/math.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/./php_ice.h:56: multiple definition of `tsrm_ls'; .libs/ice.o:/builddir/build/BUILD/php-pecl-ice-1.6.0/ZTS/php_ice.h:56: first defi
...

Use PHP 7 ZEND_TSRMLS_CACHE way instead (tsrm_ls is no more needed)

remicollet commented 4 years ago

I also think it will be better to use the ZEND_MODULE_GLOBALS_ACCESSOR macro instead of duplicating the global pointer.

mruz commented 4 years ago

Thanks @remicollet. It's need to be fixed in https://github.com/phalcon/zephir, as the files will be overridden when we generate a new build. https://github.com/phalcon/zephir/blob/659390814d919d07c78aeefe3da8e98936735b53/templates/ZendEngine3/project.c#L83

sergeyklay commented 4 years ago

Fixed in Zephir's development branch.