Bug #66013 [Opn->Asn]: Solaris build failure with 5.5

From: Date: Sun, 03 Nov 2013 11:40:12 +0000
Subject: Bug #66013 [Opn->Asn]: Solaris build failure with 5.5
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182568@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66013&edit=1

 ID:                 66013
 Updated by:         felipe@php.net
 Reported by:        Pete_Wall at symantec dot com
 Summary:            Solaris build failure with 5.5
-Status:             Open
+Status:             Assigned
 Type:               Bug
 Package:            Compile Failure
 Operating System:   Solaris 10 (x86 and SPARC)
 PHP Version:        5.5.5
-Assigned To:        
+Assigned To:        cataphract
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2013-11-03 11:32:36] phperror at kim dot net

This error occurs when compiling php 5.5.5 on Omnios which is
a continuation of OpenSolaris.

------------------------------------------------------------------------
[2013-10-31 18:49:50] Pete_Wall at symantec dot com

Both Solaris 10 x86 and Sparc:
CPPFLAGS=" -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"

./configure --disable-cgi --enable-cli --prefix="/path/to/php"
    --with-libxml-dir="/path/to/libxml" --with-openssl=shared,"/path/to/openssl"
    --with-zlib="/path/to/zlib" --with-curl=shared,"/path/to/curl"
    --with-config-file-path=/path/to/cfgfile --with-layout=GNU
    --with-regex=php --with-tsrm-pthreads --disable-rpath --disable-sysvsem --disable-sysvshm
    --disable-sysvmsg --disable-bcmath --disable-ctype --disable-exif --disable-spl --disable-ftp
    --disable-shmop --enable-tokenizer --disable-static --enable-posix=shared
--enable-session=shared
    --enable-sockets=shared --enable-xml=shared --enable-pcntl=shared --enable-dom --without-mm
    --without-gettext --without-iconv --without-sqlite --without-mime-magic --without-mysql
--without-sybase-ct
    --without-gdbm --without-db4 --without-cdb --without-pear --without-xsl --disable-debug
    --with-pcre-dir="/path/to/pcre" --with-pcre-regex


Solaris 10 x86:
CFLAGS=" -m64"
$ gcc -v
Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/specs
Configured with: /builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure --prefix=/usr/sfw
--with-as=/usr/sfw/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld --without-gnu-ld
--enable-languages=c,c++ --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)


Solaris 10 Sparc:
CFLAGS=""
$ gcc -v
Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared
--enable-languages=c,c++,f77
Thread model: posix
gcc version 3.4.6

------------------------------------------------------------------------
[2013-10-31 18:34:37] sixd@php.net

It would be helpful to list the 'configure' options and build environment (compilers etc)

------------------------------------------------------------------------
[2013-10-31 15:56:30] Pete_Wall at symantec dot com

Description:
------------
I am trying to build PHP 5.5.4 on Solaris 10 x86 and Solaris 10 SPARC and both are failing in the
same spot in ext/sockets/conversions.c.  That file references parameters in the system msghdr
structure that aren't defined by default.  If I add the compiler flags to define those
parameters, it causes other parts of PHP to fail.

Here's the build output:
/path/to//php-5.5.4/ext/sockets/conversions.c: In function `from_zval_write_control':
/path/to//php-5.5.4/ext/sockets/conversions.c:923: warning: cast to pointer from integer of
different size
/path/to//php-5.5.4/ext/sockets/conversions.c: In function `from_zval_write_control_array':
/path/to//php-5.5.4/ext/sockets/conversions.c:973: error: structure has no member named
`msg_control'
/path/to//php-5.5.4/ext/sockets/conversions.c:974: error: structure has no member named
`msg_controllen'
/path/to//php-5.5.4/ext/sockets/conversions.c: In function `to_zval_read_cmsg_data':
/path/to//php-5.5.4/ext/sockets/conversions.c:1003: warning: cast to pointer from integer of
different size
/path/to//php-5.5.4/ext/sockets/conversions.c: In function `to_zval_read_control_array':
/path/to//php-5.5.4/ext/sockets/conversions.c:1037: warning: assignment makes pointer from integer
without a cast
/path/to//php-5.5.4/ext/sockets/conversions.c:1039: warning: assignment makes pointer from integer
without a cast
/path/to//php-5.5.4/ext/sockets/conversions.c: In function `from_zval_write_controllen':
/path/to//php-5.5.4/ext/sockets/conversions.c:1146: error: structure has no member named
`msg_control'
/path/to//php-5.5.4/ext/sockets/conversions.c:1147: error: structure has no member named
`msg_controllen'
/path/to//php-5.5.4/ext/sockets/conversions.c: In function `to_zval_read_msghdr': 
/path/to//php-5.5.4/ext/sockets/conversions.c:1248: error: structure has no member named
`msg_flags'
/path/to//php-5.5.4/ext/sockets/conversions.c:1248: error: initializer element is not constant 
/path/to//php-5.5.4/ext/sockets/conversions.c:1248: error: (near initialization for
`descriptors[3].field_offset')
/path/to//php-5.5.4/ext/sockets/conversions.c:1248: error: initializer element is not constant
/path/to//php-5.5.4/ext/sockets/conversions.c:1248: error: (near initialization for
`descriptors[3]')
/path/to//php-5.5.4/ext/sockets/conversions.c:1249: error: initializer element is not constant
/path/to//php-5.5.4/ext/sockets/conversions.c:1249: error: (near initialization for
`descriptors[4]')
/path/to//php-5.5.4/ext/sockets/conversions.c: In function `to_zval_read_fd_array':
/path/to//php-5.5.4/ext/sockets/conversions.c:1428: warning: cast to pointer from integer of
different size
make: *** [ext/sockets/conversions.lo] Error 1

The ext/sockets/conversions.c code (which looks new to PHP 5.5) uses the msg_control,
msg_controllen, and other fields in the msghdr structure.  This structure is defined in
/usr/include/sys/socket.h:

/*
 * Message header for recvmsg and sendmsg calls.
 */
struct msghdr {
        void            *msg_name;              /* optional address */
        socklen_t       msg_namelen;            /* size of address */
        struct iovec    *msg_iov;               /* scatter/gather array */
        int             msg_iovlen;             /* # elements in msg_iov */

#if defined(_XPG4_2) || defined(_KERNEL)
        void            *msg_control;           /* ancillary data */
        socklen_t       msg_controllen;         /* ancillary data buffer len */
        int             msg_flags;              /* flags on received message */
#else
        caddr_t         msg_accrights;  /* access rights sent/received */
        int             msg_accrightslen;
#endif  /* defined(_XPG4_2) || defined(_KERNEL) */
};


So those parameters only exist on Solaris if the _XPG4_2 or _KERNEL parameters exist.  I can get
those defined if I add these to CFLAGS: -D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1

However, when I do that, the typedef's of unchar, ushort, uint, and ulong don't get
defined (because __XOPEN_OR_POSIX gets defined).  From /usr/include/sys/types.h:
#if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)

/* BEGIN CSTYLED */
typedef unsigned char   unchar;
typedef unsigned short  ushort;
typedef unsigned int    uint;
typedef unsigned long   ulong;
/* END CSTYLED */

With those typedefs missing, Lots of code in the Zend directory fails because ulong is not defined.

So, I'm in a situation if I make one section work, another section fails.  Has anybody else ran
into this problem?  I am in the process of upgrading the PHP version from 5.2 to 5.5, so the config
options did work in the past.



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=66013&edit=1


Thread (18 messages)

« previous php.bugs (#182568) next »