php.net |  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
Votes:5
Avg. Score:4.2 ± 0.4
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:1 (20.0%)
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hsk at imb-jena dot de
New email:
PHP Version: OS:

 

 [2015-09-14 14:23 UTC] hsk at imb-jena dot de
Description:
------------
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...


Patches

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

History

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] felipe@php.net
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

Thanks!
 [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] nikic@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f99bf7036033f4dd95b8f56c8697af7f8963ab9f
Log: Partially fix bug #70492
 [2016-12-14 17:12 UTC] nikic@php.net
-Status: Open +Status: Closed
 [2016-12-14 17:19 UTC] nikic@php.net
-Status: Closed +Status: Re-Opened
 [2016-12-14 17:19 UTC] nikic@php.net
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 https://github.com/php/php-src/blob/452dcf12ae3376a3cdb47490c51aadb0651a2a73/Zend/zend_operators.h#L30 behind a __GNUC__ guard, which is why it is skipped on Solaris. Seeing how https://github.com/php/php-src/blob/452dcf12ae3376a3cdb47490c51aadb0651a2a73/Zend/zend_strtod_int.h#L26 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-2018 The PHP Group
All rights reserved.
Last updated: Sat Oct 20 10:01:25 2018 UTC