php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65427 php fails to build on Solaris with --enable-sockets
Submitted: 2013-08-09 11:56 UTC Modified: 2021-06-20 04:22 UTC
Votes:10
Avg. Score:4.5 ± 0.7
Reproduced:10 of 10 (100.0%)
Same Version:2 (20.0%)
Same OS:9 (90.0%)
From: eugene at zhegan dot in Assigned: cmb (profile)
Status: No Feedback Package: Compile Failure
PHP Version: 5.5.1 OS: Solaris
Private report: No CVE-ID: None
 [2013-08-09 11:56 UTC] eugene at zhegan dot in
Description:
------------
php fails to build on Solaris (10 and 11) with --enable-sockets:

[...]
/bin/sh /home/emz/src/php-5.5.1/libtool --silent --preserve-dup-deps --
mode=compile gcc  -Iext/sockets/ -I/home/emz/src/php-5.5.1/ext/sockets/ -
DPHP_ATOM_INC -I/home/emz/src/php-5.5.1/include -I/home/emz/src/php-5.5.1/main -
I/home/emz/src/php-5.5.1 -I/home/emz/src/php-5.5.1/ext/date/lib -
I/home/emz/src/php-5.5.1/ext/ereg/regex -I/usr/include/libxml2 -
I/usr/local/openssl/include -I/usr/local/curl/include -
I/usr/local/libpng/include -I/usr/include/freetype2 -I/usr/local/c-
client/include -I/home/emz/src/php-5.5.1/ext/mbstring/oniguruma -
I/home/emz/src/php-5.5.1/ext/mbstring/libmbfl -I/home/emz/src/php-
5.5.1/ext/mbstring/libmbfl/mbfl -I/usr/local/libmcrypt/include -
I/usr/local/mysql/include -I/opt/oracle/orahome/rdbms/public -
I/opt/oracle/orahome/rdbms/demo -I/home/emz/src/php-5.5.1/ext/sqlite3/libsqlite 
-I/home/emz/src/php-5.5.1/TSRM -I/home/emz/src/php-5.5.1/Zend  -
D_POSIX_PTHREAD_SEMANTICS  -I/usr/include -m64 -O -I/usr/local/mysql/include -
I/usr/local/openssl/include -I/usr/local/curl/include -I/usr/local/c-
client/include -I/usr/local/libpng/include -fvisibility=hidden  -c 
/home/emz/src/php-5.5.1/ext/sockets/conversions.c -o ext/sockets/conversions.lo 
/home/emz/src/php-5.5.1/ext/sockets/conversions.c: In function 
‘from_zval_write_control’:
/home/emz/src/php-5.5.1/ext/sockets/conversions.c:923:35: warning: cast to 
pointer from integer of different size
/home/emz/src/php-5.5.1/ext/sockets/conversions.c: In function 
‘from_zval_write_control_array’:
/home/emz/src/php-5.5.1/ext/sockets/conversions.c:973:8: error: ‘struct msghdr’ 
has no member named ‘msg_control’
/home/emz/src/php-5.5.1/ext/sockets/conversions.c:974:8: error: ‘struct msghdr’ 
has no member named ‘msg_controllen’
/home/emz/src/php-5.5.1/ext/sockets/conversions.c: In function 
‘to_zval_read_cmsg_data’:
/home/emz/src/php-5.5.1/ext/sockets/conversions.c:1003:18: warning: cast to 
pointer from integer of different size
/home/emz/src/php-5.5.1/ext/sockets/conversions.c: In function 
‘to_zval_read_control_array’:
/home/emz/src/php-5.5.1/ext/sockets/conversions.c:1037:12: warning: assignment 
makes pointer from integer without a cast
/home/emz/src/php-5.5.1/ext/sockets/conversions.c:1039:9: warning: assignment 
makes pointer from integer without a cast
/home/emz/src/php-5.5.1/ext/sockets/conversions.c: In function 
‘from_zval_write_controllen’:
/home/emz/src/php-5.5.1/ext/sockets/conversions.c:1146:8: error: ‘struct msghdr’ 
has no member named ‘msg_control’
/home/emz/src/php-5.5.1/ext/sockets/conversions.c:1147:8: error: ‘struct msghdr’ 
has no member named ‘msg_controllen’
/home/emz/src/php-5.5.1/ext/sockets/conversions.c: In function 
‘to_zval_read_msghdr’:
/home/emz/src/php-5.5.1/ext/sockets/conversions.c:1248:34: error: ‘struct 
msghdr’ has no member named ‘msg_flags’
/home/emz/src/php-5.5.1/ext/sockets/conversions.c: In function 
‘to_zval_read_fd_array’:
/home/emz/src/php-5.5.1/ext/sockets/conversions.c:1427:16: warning: cast to 
pointer from integer of different size
gmake: *** [ext/sockets/conversions.lo] Error 1

This is caused by the lack of CFLAGS.
This can be easily fixed by the following actions:

- after running configure Makefile should be modified in the followong way:
-- this line should be added in Makefile: 

CFLAGS_SOCKETS = -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED

-- the lines mentioning ext/sockets should be modified as follows (the variable 
above should be added into the compilation directive):

ext/sockets/sockets.lo: /home/emz/src/php-5.5.1/ext/sockets/sockets.c
        $(LIBTOOL) --mode=compile $(CC)  -Iext/sockets/ -I/home/emz/src/php-
5.5.1/ext/sockets/ $(COMMON_FLAGS) $(CFLAGS_SOCKETS) $(CFLAGS_CLEAN) 
$(EXTRA_CFLAGS) -c /home/emz/src/php-5.5.1/ext/sockets/sockets.c -o 
ext/sockets/sockets.lo
ext/sockets/multicast.lo: /home/emz/src/php-5.5.1/ext/sockets/multicast.c
        $(LIBTOOL) --mode=compile $(CC)  -Iext/sockets/ -I/home/emz/src/php-
5.5.1/ext/sockets/ $(COMMON_FLAGS) $(CFLAGS_SOCKETS) $(CFLAGS_CLEAN) 
$(EXTRA_CFLAGS) -c /home/emz/src/php-5.5.1/ext/sockets/multicast.c -o 
ext/sockets/multicast.lo
ext/sockets/conversions.lo: /home/emz/src/php-5.5.1/ext/sockets/conversions.c
        $(LIBTOOL) --mode=compile $(CC)  -Iext/sockets/ -I/home/emz/src/php-
5.5.1/ext/sockets/ $(COMMON_FLAGS) $(CFLAGS_SOCKETS) $(CFLAGS_CLEAN) 
$(EXTRA_CFLAGS) -c /home/emz/src/php-5.5.1/ext/sockets/conversions.c -o 
ext/sockets/conversions.lo
ext/sockets/sockaddr_conv.lo: /home/emz/src/php-
5.5.1/ext/sockets/sockaddr_conv.c
        $(LIBTOOL) --mode=compile $(CC)  -Iext/sockets/ -I/home/emz/src/php-
5.5.1/ext/sockets/ $(COMMON_FLAGS) $(CFLAGS_SOCKETS) $(CFLAGS_CLEAN) 
$(EXTRA_CFLAGS) -c /home/emz/src/php5.5.1/ext/sockets/sockaddr_conv.c -o 
ext/sockets/sockaddr_conv.lo
ext/sockets/sendrecvmsg.lo: /home/emz/src/php-5.5.1/ext/sockets/sendrecvmsg.c
        $(LIBTOOL) --mode=compile $(CC)  -Iext/sockets/ -I/home/emz/src/php-
5.5.1/ext/sockets/ $(COMMON_FLAGS) $(CFLAGS_SOCKETS) $(CFLAGS_CLEAN) 
$(EXTRA_CFLAGS) -c /home/emz/src/php-5.5.1/ext/sockets/sendrecvmsg.c -o 
ext/sockets/sendrecvmsg.lo

With these alterations done, php can be built on Solaris (10 and 11) with --
enable sockets.

Adding new flags globally doesn't help, it's even making it worse, because with 
these CFLAGS being declared globally the compilation process fails around 
ext/hash/hash_ripemd.c (at least).


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-14 19:14 UTC] lsdejones at gmail dot com
Trying to build php 5.5.11 on Solaris 10.
Build fails with --enable-sockets here too. 


Configure:
==========
./configure --prefix=/usr/local/php-5.5.11 --with-config-file-path=/usr/local/php-5.5.11/lib --enable-libxml --with-libxml-dir=/usr/local --with-zlib=/usr/local  --with-apxs2=/usr/local/httpd-2.4.9/bin/apxs --without-pgsql  --with-zlib-dir=/usr/local/lib  --enable-mbstring --enable-exif --enable-sockets --enable-soap --with-png-dir=/usr/local/lib --with-curl=/usr/local --with-ldap=/usr/local --with-openssl=/usr/local/openssl-1.0.1g --with-gettext --with-pcre-dir=/usr/local/pcre --with-freetype-dir=/usr/local --enable-gd-native-ttf --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir=/usr/local --with-xsl --with-gd --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib


Added to Makefile:
==================
CFLAGS_SOCKETS = -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED


Modified in the make file: added $(CFLAGS_SOCKETS) to all ext/socket lines
==================================================
ext/sockets/sockets.lo: /usr/share/src/php-5.5.11/ext/sockets/sockets.c
	$(LIBTOOL) --mode=compile $(CC)  -Iext/sockets/ -I/usr/share/src/php-5.5.11/ext/sockets/ $(COMMON_FLAGS) $(CFLAGS_SOCKETS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c /usr/share/src/php-5.5.11/ext/sockets/sockets.c -o ext/sockets/sockets.lo 
ext/sockets/multicast.lo: /usr/share/src/php-5.5.11/ext/sockets/multicast.c
	$(LIBTOOL) --mode=compile $(CC)  -Iext/sockets/ -I/usr/share/src/php-5.5.11/ext/sockets/ $(COMMON_FLAGS) $(CFLAGS_SOCKETS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c /usr/share/src/php-5.5.11/ext/sockets/multicast.c -o ext/sockets/multicast.lo 
ext/sockets/conversions.lo: /usr/share/src/php-5.5.11/ext/sockets/conversions.c
	$(LIBTOOL) --mode=compile $(CC)  -Iext/sockets/ -I/usr/share/src/php-5.5.11/ext/sockets/ $(COMMON_FLAGS) $(CFLAGS_SOCKETS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c /usr/share/src/php-5.5.11/ext/sockets/conversions.c -o ext/sockets/conversions.lo 
ext/sockets/sockaddr_conv.lo: /usr/share/src/php-5.5.11/ext/sockets/sockaddr_conv.c
	$(LIBTOOL) --mode=compile $(CC)  -Iext/sockets/ -I/usr/share/src/php-5.5.11/ext/sockets/ $(COMMON_FLAGS) $(CFLAGS_SOCKETS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c /usr/share/src/php-5.5.11/ext/sockets/sockaddr_conv.c -o ext/sockets/sockaddr_conv.lo 
ext/sockets/sendrecvmsg.lo: /usr/share/src/php-5.5.11/ext/sockets/sendrecvmsg.c
	$(LIBTOOL) --mode=compile $(CC)  -Iext/sockets/ -I/usr/share/src/php-5.5.11/ext/sockets/ $(COMMON_FLAGS) $(CFLAGS_SOCKETS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c /usr/share/src/php-5.5.11/ext/sockets/sendrecvmsg.c -o ext/sockets/sendrecvmsg.lo 


It still fails, but in a different place. Here is what it poops out :
=====================================================================
/bin/bash /usr/share/src/php-5.5.11/libtool --silent --preserve-dup-deps --mode=compile gcc -std=gnu99  -Iext/sockets/ -I/usr/share/src/php-5.5.11/ext/sockets/ -DPHP_ATOM_INC -I/usr/share/src/php-5.5.11/include -I/usr/share/src/php-5.5.11/main -I/usr/share/src/php-5.5.11 -I/usr/share/src/php-5.5.11/ext/date/lib -I/usr/share/src/php-5.5.11/ext/ereg/regex -I/usr/local/include/libxml2 -I/usr/local/openssl-1.0.1g/include -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/share/src/php-5.5.11/ext/mbstring/oniguruma -I/usr/share/src/php-5.5.11/ext/mbstring/libmbfl -I/usr/share/src/php-5.5.11/ext/mbstring/libmbfl/mbfl -I/usr/share/src/php-5.5.11/ext/sqlite3/libsqlite -I/usr/include/libxml2 -I/usr/share/src/php-5.5.11/TSRM -I/usr/share/src/php-5.5.11/Zend  -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT  -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -I/usr/local/include -g -O2 -DZTS  -c /usr/share/src/php-5.5.11/ext/sockets/sockets.c -o ext/sockets/sockets.lo
In file included from /usr/include/iso/stdlib_iso.h:30,
                 from /usr/include/stdlib.h:18,
                 from /usr/share/src/php-5.5.11/include/../main/php_config.h:2414,
                 from /usr/share/src/php-5.5.11/Zend/zend_config.h:1,
                 from /usr/share/src/php-5.5.11/Zend/zend.h:51,
                 from /usr/share/src/php-5.5.11/main/php.h:34,
                 from /usr/share/src/php-5.5.11/ext/sockets/sockets.c:29:
/usr/include/sys/feature_tests.h:332:2: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications         and pre-2001 POSIX applications"
In file included from /usr/share/src/php-5.5.11/Zend/zend_compile.h:719,
                 from /usr/share/src/php-5.5.11/Zend/zend_modules.h:26,
                 from /usr/share/src/php-5.5.11/Zend/zend_API.h:26,
                 from /usr/share/src/php-5.5.11/main/php.h:38,
                 from /usr/share/src/php-5.5.11/ext/sockets/sockets.c:29:
/usr/share/src/php-5.5.11/Zend/zend_vm_opcodes.h:173:7: warning: no newline at end of file
make: *** [ext/sockets/sockets.lo] Error 1

I am at a loss :(
 [2015-01-16 11:53 UTC] its at dartford dot gov dot uk
Has anyone got PHP to compile under Solaris 10 with the --enable-sockets flag.
I have tried to compile PHP versions 5.5.20, 5.5.9 .5.6.4 all fail at the same point, I have made the amendments to the Makefile as suggested in this post but this just moves the issue on with the following error:

Undefined                       first referenced
 symbol                             in file
CMSG_SPACE                          ext/sockets/.libs/sendrecvmsg.o
ld: fatal: symbol referencing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


PLEASE HELP
 [2021-06-10 12:54 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-06-10 12:54 UTC] cmb@php.net
Is that still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-06-20 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC