From:             clicky at erebot dot net
Operating system: Debian Squeeze
PHP version:      5.5.0RC1
Package:          Compile Failure
Bug Type:         Bug
Bug description:ext/sockets/sendrecvmsg.c related compilation errors

Description:
------------
While trying to build PHP 5.5.0RC1 under Debian Squeeze, the following
compilation errors were triggered.

I think this may be related to this commit that introduced support for
SCM_CREDENTIALS and other goodies in the sockets extension recently:
http://git.php.net/?p=php-src.git;a=commitdiff;h=a85d7f28f69fbc522ed90aee1926d3733be7620d

Also, please note that the manpage for UNIX sockets states that "struct
ucred" (which is used in the code) is only defined when the _GNU_SOURCE
macro is defined since glibc 2.8 [1]. This may also be the reason why the
build fails (Debian Squeeze uses libc6-2.13 [2]).

Other projects have been impacted by this issue too [3].

[1] http://manpages.ubuntu.com/manpages/karmic/en/man7/unix.7.html
[2] http://packages.debian.org/wheezy/libc6
[3] http://sourceforge.net/p/wide-dhcpv6/bugs/29/ (also contains link to a
glibc commit that changed some of the structs like in6_pktinfo to be
macro-guarded).

Test script:
---------------
'./configure' \
'--enable-debug' \
'--disable-all' \
'--disable-short-tags' \
'--disable-sigchild' \
'--with-layout=GNU' \
'--with-regex' \
'--with-openssl=shared' \
'--with-zlib=shared' \
'--enable-bcmath=shared' \
'--with-bz2=shared' \
'--enable-calendar=shared' \
'--with-gettext=shared' \
'--enable-mbstring=shared' \
'--enable-pcntl=shared' \
'--enable-sockets=shared' \
'--with-pdo-sqlite' \
'--enable-sysvmsg=shared' \
'--enable-sysvsem=shared' \
'--enable-sysvshm=shared' \
'--with-xsl=shared' \
'--with-iconv=shared' \
'--enable-zip=shared' \
'--enable-posix=shared' \
'--enable-libxml=shared' \
'--enable-dom=shared' \
'--enable-xml=shared' \
'--enable-xmlreader=shared' \
'--enable-xmlwriter=shared' \
'--enable-tokenizer=shared' \
'--enable-pdo' \
'--enable-ctype=shared' \
'--enable-json=shared' \
'--enable-session=shared' \
'--enable-soap=shared' \
'--enable-simplexml=shared' \
'--enable-hash' \
'--enable-intl=shared' \
'--enable-phar=shared' \
'--with-sqlite3' \
'--with-mysql=shared,mysqlnd' \
'--with-mysqli=shared,mysqlnd' \
'--with-pdo-mysql=shared,mysqlnd' \
'--prefix=/home/qa/phpfarm/inst/php-5.5.0RC1-debug' \
'--exec-prefix=/home/qa/phpfarm/inst/php-5.5.0RC1-debug' \
'--without-pear' \
'--enable-cgi' \
'--enable-cli' \
'--enable-fpm' \
"$@"

(but could probably be reduced to just ./configure --disable-all
--enable-sockets=shared)

Expected result:
----------------
PHP should build without any compilation error.

Actual result:
--------------
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c: In
function ‘init_ancillary_registry’:
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c:109:2:
error: invalid application of ‘sizeof’ to incomplete type ‘struct
in6_pktinfo’
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c:124:2:
error: invalid application of ‘sizeof’ to incomplete type ‘struct
ucred’
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c:124:2:
error: ‘SCM_CREDENTIALS’ undeclared (first use in this function)
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c:124:2:
note: each undeclared identifier is reported only once for each function it
appears in
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c: In
function ‘php_do_setsockopt_ipv6_rfc3542’:
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c:339:12:
error: invalid application of ‘sizeof’ to incomplete type ‘struct
in6_pktinfo’
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c:345:19:
error: invalid application of ‘sizeof’ to incomplete type ‘struct
in6_pktinfo’
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c: In
function ‘php_do_getsockopt_ipv6_rfc3542’:
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c:377:17:
error: invalid application of ‘sizeof’ to incomplete type ‘struct
in6_pktinfo’
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c: In
function ‘php_socket_sendrecvmsg_init’:
/home/qa/phpfarm/src/php-5.5.0RC1-debug/ext/sockets/sendrecvmsg.c:436:2:
error: ‘SCM_CREDENTIALS’ undeclared (first use in this function)
make: *** [ext/sockets/sendrecvmsg.lo] Error 1


-- 
Edit bug report at https://bugs.php.net/bug.php?id=64833&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64833&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64833&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64833&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64833&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64833&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64833&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64833&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64833&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64833&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64833&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64833&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64833&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64833&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64833&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64833&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64833&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64833&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64833&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64833&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64833&r=mysqlcfg

Reply via email to