Edit report at https://bugs.php.net/bug.php?id=64197&edit=1
ID: 64197 Updated by: ardbiesheu...@php.net Reported by: mats at exmandato dot se Summary: _Offsetof() macro used but not defined on ARM/Clang -Status: Verified +Status: Closed Type: Bug Package: Compile Failure Operating System: FreeBSD10 / ARM PHP Version: 5.4.11 Block user comment: N Private report: N New Comment: Automatic comment on behalf of ard.biesheu...@linaro.org Revision: http://git.php.net/?p=php-src.git;a=commit;h=050aae2860e1c202e2e9db715beaa97d0a4c9c33 Log: Fixed bug #64197 (_Offsetof() macro used but not defined on ARM/Clang) Previous Comments: ------------------------------------------------------------------------ [2013-02-13 12:18:52] mats at exmandato dot se > Could you set the the following #define *before* the > #ifndef XtOffsetOf in Zend/zend_ini,h:30 > #define XtOffsetOf __builtin_offsetof Adding #define XtOffsetOf __builtin_offsetof in the file Zend/zend_ini.h solved the problem. > Note that rooting out these kinds of bugs is typical for porting to a new > architecture, so filing bugs against a stable version is not really > appropriate. I'm sorry, I didn't know that ------------------------------------------------------------------------ [2013-02-13 11:32:18] ardbiesheu...@php.net The preprocessor conditionals in Zend/zend_ini.h test for '__arm' to decide whether _Offsetof() is defined. The assumption is that this define is only set by ARMCC, the proprietary ARM compiler, and not by others (like GCC). However, as Clang does set this define as well (in addition to '__arm__'), the generated code ends up using a macro that is not defined, resulting in the output as reported. Note that rooting out these kinds of bugs is typical for porting to a new architecture, so filing bugs against a stable version is not really appropriate. ------------------------------------------------------------------------ [2013-02-13 07:29:22] ardbiesheu...@php.net It appears that this code is performing some tests to decide whether the CRAY or ARM proprietary compilers are being used, and this is giving bad results on FreeBSD/ARM. Could you set the the following #define *before* the #ifndef XtOffsetOf in Zend/zend_ini,h:30 #define XtOffsetOf __builtin_offsetof and try again? ------------------------------------------------------------------------ [2013-02-12 19:35:24] ardbiesheu...@php.net This has nothing to do with ARM. Looking at the log, it appears that LLVM/Clang does not understand _Offsetof, and treats it as an implicit function declaration and not a macro. Passing type names to functions is not supported in C so it complains that it expects an expression instead. ------------------------------------------------------------------------ [2013-02-12 17:53:55] s...@php.net It could be interesting to try a snapshot of trunk from http://snaps.php.net/, since some ARM fixes have recently been merged there, ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=64197 -- Edit this bug report at https://bugs.php.net/bug.php?id=64197&edit=1