php mapscript build error with php 5.6.25 #5318

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@landryb
landryb commented Sep 2, 2016

5.6.23 builds fine, 5.6.25 fails with:

/usr/obj/ports/mapserver-7.0.1/mapserver-7.0.1/mapscript/php/error.c:71: error: called object 'zend_error' is not a function

pointing at https://github.com/mapserver/mapserver/blob/branch-7-0/mapscript/php/error.c#L71

this seems caused by this upstream change: http://git.php.net/?p=php-src.git;a=commitdiff;h=791a98eb1c66d2340b4e897ab60e4a6700435b5b

When unrolling the IF_GET_STRING macro, something blows.. tried with gcc 4.2.1 and clang 3.8.1, using libestdc++ 4.2.1 in both cases.

@landryb
landryb commented Sep 2, 2016

Adding

 #undef ZVAL_STRING
 #define ZVAL_STRING(z, s, duplicate) do {       \
                 const char *__s=(s);                            \
                 zval *__z = (z);                                        \
                 Z_STRLEN_P(__z) = strlen(__s);          \
                 Z_STRVAL_P(__z) = (duplicate?estrndup(__s, Z_STRLEN_P(__z)):(char*)__s);\
                 Z_TYPE_P(__z) = IS_STRING;                      \
         } while (0)

to the top of error.c after the #include work arounds the issue - the defined is copied from zend_API.h

@tbonfort tbonfort Fix build issue with php 5.6.25 (#5318)
aa3de84
@landryb
landryb commented Sep 2, 2016

Im not sure that's a correct fix but this macro maze is beyond every horror i saw so far.

@tbonfort
Member
tbonfort commented Sep 2, 2016

@landryb it fixes the broken tests we were having with 5.6.25 on travis CI, thanks!

@bluerise bluerise pushed a commit to bluerise/openbsd-ports that referenced this pull request Sep 3, 2016
@landryb landryb Fix build with php 5.6.25, from robert@.
Filed mapserver/mapserver#5318 upstream.
8175c05
@tbonfort
Member

This PR needs to be checked against php <=5.6.24 before merge

@jmckenna jmckenna modified the milestone: 7.0.2 Release, 7.2 Release Sep 15, 2016
@AlexanderGabriel AlexanderGabriel added a commit to AlexanderGabriel/mapserver that referenced this pull request Nov 8, 2016
@tbonfort @AlexanderGabriel tbonfort + AlexanderGabriel Fix build issue with php 5.6.25 (#5318) 6f4c4cc
@AlexanderGabriel AlexanderGabriel added a commit to AlexanderGabriel/mapserver that referenced this pull request Nov 8, 2016
@tbonfort @AlexanderGabriel tbonfort + AlexanderGabriel Fix build issue with php 5.6.25 (#5318) 7e8ff46
@tbonfort tbonfort needs fixup: only apply patch for versions >= 5.6.25
54561f0
@tbonfort tbonfort modified the milestone: 7.0.3 Release, 7.2 Release Dec 5, 2016
@tbonfort
Member
tbonfort commented Dec 5, 2016

applied to branch-7-0 in d5cc584

@tbonfort tbonfort closed this Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment