Opened 3 years ago

Closed 14 months ago

#6770 closed defect (wontfix)

compilation fails when '--with-php' is passed to configure. Error: gdal_wrap.cpp:861:52: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2

Reported by: dreieck Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: 2.1.1
Severity: normal Keywords: build, compilation, php
Cc:

Description (last modified by dreieck)

When I compile gdal 2.1.1 on my arch linux system (64 bit) and I have the option --with-php passed to configure, at some point the build process fails with a lot of error messages. (Without that/ with --without-php it compiles fine.) Here I give the first and the last error messages; see the attached file makepkg.with-php.log.xz for complete:

gdal_wrap.cpp:861:52: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
       ZVAL_STRING(classname, (char*)type->name+3, 1);
                                                    ^
gdal_wrap.cpp:872:105: error: macro "zend_hash_update" passed 6 arguments, but takes just 3
       zend_hash_update(HASH_OF(z), (char*)"_cPtr", sizeof("_cPtr"), (void*)&resource, sizeof(zval), NULL);
                                                                                                         ^
gdal_wrap.cpp:2950:50: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
       ZVAL_STRING(return_value, (char *)result, 1);

[...]

/usr/include/php/Zend/zend_alloc.h:163:34: note: in definition of macro ‘efree’
 #define efree(ptr)       _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
                                  ^~~
gdal_wrap.cpp: In function ‘void _wrap_destroy_p_p_GDALRasterBandShadow(zend_resource*)’:
gdal_wrap.cpp:13149:9: error: ‘rsrc’ was not declared in this scope
   efree(rsrc->ptr);
         ^
/usr/include/php/Zend/zend_alloc.h:163:34: note: in definition of macro ‘efree’
 #define efree(ptr)       _efree((ptr) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
                                  ^~~
gdal_wrap.cpp: In function ‘int zm_startup_gdal(int, int)’:
gdal_wrap.cpp:13735:22: error: ‘MAKE_STD_ZVAL’ was not declared in this scope
   MAKE_STD_ZVAL(z_var);
                      ^
gdal_wrap.cpp:13742:48: error: cannot convert ‘char*’ to ‘zend_string* {aka _zend_string*}’ in assignment
   c.name = zend_strndup("GDALTermProgress", len);
                                                ^
gdal_wrap.cpp:13743:5: error: ‘zend_constant {aka struct _zend_constant}’ has no member named ‘name_len’; did you mean ‘name’?
   c.name_len = len+1;
     ^~~~~~~~
make[2]: *** [GNUmakefile:40: gdal_wrap.o] Error 1
make[2]: Leaving directory '/var/abs/local/own/gdal-custom/src/gdal-2.1.1/swig/php'
make[1]: *** [GNUmakefile:30: build] Error 2
make[1]: Leaving directory '/var/abs/local/own/gdal-custom/src/gdal-2.1.1/swig'
make: *** [GNUmakefile:104: swig-modules] Error 2

I use the following commands to build gdal (taken from the official Arch Linux PKGBUILD, and modified):

Error: Failed to load processor bash
No macro or processor named 'bash' found

I attach the following additional information as files:

  • The complete PKGBUILD to build the package in the way the error occurs,
  • the log of stdout and stderr (combined) when configuring and building the package that way,
  • the log of stdout and stderr (combined) when configuring and succesfully building the package with --without-php.

Attachments (3)

PKGBUILD.with-php (4.5 KB) - added by dreieck 3 years ago.
PKGBUILD with '--with-php'.
makepkg.with-php.log.xz (49.8 KB) - added by dreieck 3 years ago.
Compile log (stdout and stderr) with '--with-php'.
makepkg.without-php.log.xz (72.3 KB) - added by dreieck 3 years ago.
Compile log (stdout and stderr) with '--without-php'.

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by dreieck

Attachment: PKGBUILD.with-php added

PKGBUILD with '--with-php'.

Changed 3 years ago by dreieck

Attachment: makepkg.with-php.log.xz added

Compile log (stdout and stderr) with '--with-php'.

Changed 3 years ago by dreieck

Attachment: makepkg.without-php.log.xz added

Compile log (stdout and stderr) with '--without-php'.

comment:1 Changed 3 years ago by dreieck

Description: modified (diff)

comment:2 Changed 3 years ago by Even Rouault

There's no maintainer for the PHP bindings.

comment:3 Changed 14 months ago by Even Rouault

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub?. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.