Bug #66013 [Opn->Fbk]: Solaris build failure with 5.5
| From: | sixd@php.net | Date: | Thu, 31 Oct 2013 18:34:38 +0000 |
| Subject: | Bug #66013 [Opn->Fbk]: Solaris build failure with 5.5 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-182530@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: sixd@php.net
Reported by: Pete_Wall at symantec dot com
Summary: Solaris build failure with 5.5
-Status: Open
+Status: Feedback
Type: Bug
Package: Compile Failure
Operating System: Solaris 10 (x86 and SPARC)
PHP Version: 5.5.5
Block user comment: N
Private report: N
New Comment:
It would be helpful to list the 'configure' options and build environment (compilers etc)
Previous Comments:
------------------------------------------------------------------------
[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