Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.6.0-beta1 fails to build (error: unknown type name 'siginfo_t) #6015

Closed
sebastic opened this issue Mar 23, 2020 · 1 comment
Closed

7.6.0-beta1 fails to build (error: unknown type name 'siginfo_t) #6015

sebastic opened this issue Mar 23, 2020 · 1 comment
Milestone

Comments

@sebastic
Copy link
Contributor

sebastic commented Mar 23, 2020

The Debian package build for MapServer 7.6.0-beta1 fails to build due to an issue with PHP MapScript NG:

[ 79%] Building C object mapscript/phpng/CMakeFiles/php_mapscriptng.dir/CMakeFiles/php_mapscriptng.dir/mapscriptPHP7_wrap.c.o
cd "/build/mapserver-7.6.0~beta1/obj-x86_64-linux-gnu/mapscript/phpng" && /usr/bin/cc -DPROJ_VERSION_MAJOR=7 -Dphp_mapscriptng_EXPORTS -I"/build/mapserver-7.6.0~beta1/obj-x86_64-linux-gnu/mapscript/phpng"  -I"/build/mapserver-7.6.0~beta1
/obj-x86_64-linux-gnu" -I"/build/mapserver-7.6.0~beta1/renderers/agg/include" -I"/build/mapserver-7.6.0~beta1/mapscript/v8" -I/usr/include/freetype2 -I"/build/mapserver-7.6.0~beta1/obj-x86_64-linux-gnu/renderers/mvt" -I/usr/include/fribi
di -I/usr/include/harfbuzz -I/usr/include/cairo -I/usr/include/postgresql -I/usr/include/gdal -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64
-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/libpng16 -I/usr/include/libxml2 -I/usr/include/php/20190902 -I/usr/include/php/20190902/main -I/usr/include/php/20190902/TSRM -I/usr/include/php/20190
902/Zend -I/usr/include/php/20190902/ext -I/usr/include/php/20190902/ext/date/lib -I"/build/mapserver-7.6.0~beta1/mapscript/swiginc" -I"/build/mapserver-7.6.0~beta1/mapscript" -I"/build/mapserver-7.6.0~beta1/mapscript/phpng" -I"/build/ma
pserver-7.6.0~beta1/obj-x86_64-linux-gnu/mapscript/phpng"  -g -O2 -fdebug-prefix-map=/build/mapserver-7.6.0~beta1=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now -Wdate-
time -D_FORTIFY_SOURCE=2 -Wall -Werror=format-security -O2 -g -DNDEBUG -fPIC   -Wno-unused-label -std=c99 -o CMakeFiles/php_mapscriptng.dir/CMakeFiles/php_mapscriptng.dir/mapscriptPHP7_wrap.c.o   -c "/build/mapserver-7.6.0~beta1/obj-x86_
64-linux-gnu/mapscript/phpng/CMakeFiles/php_mapscriptng.dir/mapscriptPHP7_wrap.c"
In file included from /usr/include/php/20190902/Zend/zend.h:41,
                 from /build/mapserver-7.6.0~beta1/obj-x86_64-linux-gnu/mapscript/phpng/CMakeFiles/php_mapscriptng.dir/mapscriptPHP7_wrap.c:747:
/usr/include/php/20190902/Zend/zend_signal.h:44:2: error: unknown type name 'siginfo_t'
   44 |  siginfo_t *siginfo;
      |  ^~~~~~~~~
In file included from /usr/include/php/20190902/Zend/zend.h:41,
                 from /build/mapserver-7.6.0~beta1/obj-x86_64-linux-gnu/mapscript/phpng/CMakeFiles/php_mapscriptng.dir/mapscriptPHP7_wrap.c:747:
/usr/include/php/20190902/Zend/zend_signal.h:95:53: warning: 'struct sigaction' declared inside parameter list will not be visible outside of this definition or declaration
   95 | ZEND_API int zend_sigaction(int signo, const struct sigaction *act, struct sigaction *oldact);
      |                                                     ^~~~~~~~~
/build/mapserver-7.6.0~beta1/obj-x86_64-linux-gnu/mapscript/phpng/CMakeFiles/php_mapscriptng.dir/mapscriptPHP7_wrap.c: In function '_intarrayTo_int':
/build/mapserver-7.6.0~beta1/obj-x86_64-linux-gnu/mapscript/phpng/CMakeFiles/php_mapscriptng.dir/mapscriptPHP7_wrap.c:4214:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 4214 |     return (void *)((int)  ((intarray) x));
      |                             ^
/build/mapserver-7.6.0~beta1/obj-x86_64-linux-gnu/mapscript/phpng/CMakeFiles/php_mapscriptng.dir/mapscriptPHP7_wrap.c:4214:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 4214 |     return (void *)((int)  ((intarray) x));
      |            ^

Full buildlog

Note that MapServer 7.4.4 built successfully with the same PHP version (which used -D_GNU_SOURCE).

This looks suspicious:

+# Set C++ version
+# Make CMAKE_CXX_STANDARD available as cache option overridable by user
+set(CMAKE_CXX_STANDARD 11
+  CACHE STRING "C++ standard version to use (default is 11)")
+message(STATUS "Requiring C++${CMAKE_CXX_STANDARD}")
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+message(STATUS "Requiring C++${CMAKE_CXX_STANDARD} - done")
+
+# Set C99 version
+# Make CMAKE_C_STANDARD available as cache option overridable by user
+set(CMAKE_C_STANDARD 99
+  CACHE STRING "C standard version to use (default is 99)")
+message(STATUS "Requiring C${CMAKE_C_STANDARD}")
+set(CMAKE_C_STANDARD_REQUIRED ON)
+set(CMAKE_C_EXTENSIONS OFF)
+message(STATUS "Requiring C${CMAKE_C_STANDARD} - done")

-D_POSIX_C_SOURCE=199309L is required for siginfo_t, that's likely one of the disabled extensions.

Adding -D_GNU_SOURCE resolves the issue.

@jmckenna
Copy link
Member

jmckenna commented Mar 23, 2020

PR #6018 fixes issue on xenial (SWIG 4.0.1, PHP 7.2.29)

jmckenna added a commit that referenced this issue Mar 24, 2020
handle gnu_source definition for SWIG mapscript (issue #6015)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants