ID: 50496 Updated by: srina...@php.net Reported By: alexander at skwar dot name Status: Assigned Bug Type: Compile Failure Operating System: Solaris 10, Sparc PHP Version: 5.3SVN-2009-12-16 (snap) Assigned To: srinatar New Comment:
Sun Studio compiler does not by default enable ANSIC C99 standard and its extensions and need to be explicitly enabled. ! this patch addresses this patch by enabling ANSIC99 standard. [srir...@chilidev]'PHP_5_3'>svn diff acinclude.m4 Index: acinclude.m4 =================================================================== --- acinclude.m4 (revision 292219) +++ acinclude.m4 (working copy) @@ -2780,7 +2780,7 @@ AC_MSG_RESULT([no]), SUNCC="yes" GCC="no" - test -n "$auto_cflags" && CFLAGS="-O -xs -xstrconst -zlazyload" + test -n "$auto_cflags" && CFLAGS="-O -xc99=all -xs -xstrconst - zlazyload" GCC="" AC_MSG_RESULT([yes]) ) if no one has any objections, i will commit this patch here is the complete patch Index: trunk/acinclude.m4 =================================================================== --- trunk/acinclude.m4 (revision 292220) +++ trunk/acinclude.m4 (working copy) @@ -2780,7 +2780,7 @@ AC_MSG_RESULT([no]), SUNCC="yes" GCC="no" - test -n "$auto_cflags" && CFLAGS="-O -xs -xstrconst -zlazyload" + test -n "$auto_cflags" && CFLAGS="-O -xc99=all -xs -xstrconst - zlazyload" GCC="" AC_MSG_RESULT([yes]) ) Index: branches/PHP_5_3/acinclude.m4 =================================================================== --- branches/PHP_5_3/acinclude.m4 (revision 292219) +++ branches/PHP_5_3/acinclude.m4 (working copy) @@ -2780,7 +2780,7 @@ AC_MSG_RESULT([no]), SUNCC="yes" GCC="no" - test -n "$auto_cflags" && CFLAGS="-O -xs -xstrconst -zlazyload" + test -n "$auto_cflags" && CFLAGS="-O -xc99=all -xs -xstrconst - zlazyload" GCC="" AC_MSG_RESULT([yes]) ) Index: branches/PHP_5_3/NEWS =================================================================== --- branches/PHP_5_3/NEWS (revision 292219) +++ branches/PHP_5_3/NEWS (working copy) @@ -9,6 +9,8 @@ - Changed "post_max_size" php.ini directive to allow unlimited post size by setting it to 0. (Rasmus) +- Fixed bug #50496 (Use of <stdbool.h> is valid only in a c99 compilation + environment. (Sriram) - Added support for SHA-256 and SHA-512 to php's crypt. (Pierre) - Added realpath_cache_size() and realpath_cache_get() functions. (Stas) - Added FILTER_FLAG_STRIP_BACKTICK option to the filter extension. (Ilia) I will enable xc99=all option in php 5.2 branch after 5.2.12 is released. Previous Comments: ------------------------------------------------------------------------ [2009-12-16 18:25:36] srina...@php.net yup, will look into this today. ------------------------------------------------------------------------ [2009-12-16 18:09:30] paj...@php.net That code is new in 5.3.1, it adds (or restore when SHA-512/256 was available on the system) features to crypt. Ah, that could be the problem. I tested using OpenSolaris on a t2000 box. I have no solaris to test. @srinatar, can you take a look at this issue please? That would be very helpful :) ------------------------------------------------------------------------ [2009-12-16 17:30:09] alexander at skwar dot name Hm. That's strange. It shouldn't be depending on the version of Solaris. In /usr/include/stdbool.h, there is: #else /* _STDC_C99 */ #error "Use of <stdbool.h> is valid only in a c99 compilation environment." #endif /* _STDC_C99 */ So, for some reason or the other, you had _STDC_C99 defined. This should only be defined if compiling in C99 mode. I'm right now downloading Solaris 10 U8 to install it in a Virtual Box together with Sun Studio 12.1. I expect it to error out. Out of curiosity: Which version of Solaris 10 are you using? U8? I'm *NOT* using OpenSolaris, BTW. And I find it quite curious that php-5.3.0 compiles and php-5.3.1+ does not. The only difference is the source code of PHP. This kinda leads me to think, that the problem is related to PHP. ------------------------------------------------------------------------ [2009-12-16 15:47:50] paj...@php.net It builds just fine on the test solaris system provided by Sun. If you have a patch fixing this issue on your platform without breaking other then please post a link to it here. ------------------------------------------------------------------------ [2009-12-16 15:24:19] alexander at skwar dot name I added -xc99=all to the beginning of my CFLAGS (see http://bash.pastebin.com/pastebin.php?diff=f14d9a4ab) and this allowed me to compile (it's still compiling but I'm past that step which error out earlier). ------------------------------------------------------------------------ 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 http://bugs.php.net/50496 -- Edit this bug report at http://bugs.php.net/?id=50496&edit=1