Opened 7 years ago

Last modified 5 years ago

#6770 closed defect

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 — at Initial Version

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

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 building the package that way,
  • the log of stdout and stderr (combined) when succesfully building the package with --without-php.

Change History (3)

by dreieck, 7 years ago

Attachment: PKGBUILD.with-php added

PKGBUILD with '--with-php'.

by dreieck, 7 years ago

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

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

by dreieck, 7 years ago

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

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

Note: See TracTickets for help on using tickets.