|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70492 compile errors Solaris10/Studio12.1 (with fixes)
Submitted: 2015-09-14 14:23 UTC Modified: 2016-12-14 17:19 UTC
Avg. Score:4.3 ± 0.5
Reproduced:6 of 6 (100.0%)
Same Version:1 (16.7%)
Same OS:2 (33.3%)
From: hsk at imb-jena dot de Assigned:
Status: Re-Opened Package: Compile Failure
PHP Version: 7.0.1 OS: Solaris10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: hsk at imb-jena dot de
New email:
PHP Version: OS:


 [2015-09-14 14:23 UTC] hsk at imb-jena dot de
to get php-7.0.0RC2 compiled on solaris 10 using studio 12.1 compiler, i had to make the following changes (see attached pacth):
1) in ext/fileinfo/libmagic/apprentice.c file, offsetof is used, and compiler says "offsetof undefined".  for solaris10/studio12.1, offsetof is defined in stddef.h, so adding "#include <stddef.h>" to ext/fileinfo/libmagic/apprentice.c solved the compile error.
2) Zend/zend_alloc.[ch] conditionally declare and use _emalloc_8, _emalloc_16, ... and _efree_8, _efree_16, ..., but in Zend/zendalloc.h, these are #if'ed by "#if !ZEND_DEBUG && defined(HAVE_BUILTIN_CONSTANT_P)" while in Zend/zendalloc.c by "#if !ZEND_DEBUG && !defined(_WIN32".  the two #if's must be consistent, else compiling zend_alloc.c failed for me.  in my patch, i have and-ed all three conditions, but maybe one of the two #if-variants is what is wanted.
3) in sapi/phpdbg/phpdbg.c, when compiling function phpdbg_free_wrapper, compiler says "void function cannot return value".  in my patch, i just commented the "return", but that may not be the true solution...


php700rc2-solaris10studio121.patch (last revision 2015-09-14 14:25 UTC by hsk at imb-jena dot de)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-06 12:28 UTC] hsk at imb-jena dot de
-PHP Version: 7.0.0RC2 +PHP Version: 7.0.0RC4
 [2015-10-06 12:28 UTC] hsk at imb-jena dot de
above report is still valid with php-7.0.0RC4
 [2015-10-12 12:52 UTC]
phpdbg's function is not a void one, actually it returns void*.
 [2015-12-17 19:48 UTC] stadtkind2 at gmx dot de
PHP 7.0.1 compiles fine with your patch on Solaris 11.3 x86 + Solaris Studio 12.5 beta

 [2015-12-18 11:34 UTC] hsk at imb-jena dot de
-PHP Version: 7.0.0RC4 +PHP Version: 7.0.1
 [2015-12-18 11:34 UTC] hsk at imb-jena dot de
supplied patch still needed for 7.0.1 to get 7.0.1 compiled on solaris 10 (patched up-to-current) using solaris-studio 12.4
 [2016-02-09 12:07 UTC] alex dot collins at anglia dot ac dot uk
Building PhP 7.0.3 on Solaris 11.3 X86 with Studio 12.3
Patch is required and works. No Further issues experienced.
 [2016-12-14 17:12 UTC]
Automatic comment on behalf of nikic
Log: Partially fix bug #70492
 [2016-12-14 17:12 UTC]
-Status: Open +Status: Closed
 [2016-12-14 17:19 UTC]
-Status: Closed +Status: Re-Opened
 [2016-12-14 17:19 UTC]
I've applied the fixes for zend_alloc and phpdbg.

I haven't applied the libmagic change yet, because I'm not sure if this is the right place to do it. We explicitly patch out an stddef.h include from upstream. I assume that this is done because we already include stddef.h at an earlier point anyway. This include happens in behind a __GNUC__ guard, which is why it is skipped on Solaris. Seeing how includes stddef.h without any guards, we already assume this header is always available. As such, we should be able to just drop the __GNUC__ guard on the include in zend_operators.h.
 [2017-03-06 19:18 UTC] stadtkind2 at gmx dot de
@nikic I could test it on Solaris 11/SPARC with Developer Studio 12.5; just give me a patch :)
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat May 15 12:01:23 2021 UTC