Bug #66013 [NEW]: Solaris build failure with 5.5
| From: | Pete_Wall at symantec dot com | Date: | Thu, 31 Oct 2013 15:56:31 +0000 |
| Subject: | Bug #66013 [NEW]: Solaris build failure with 5.5 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-182520@lists.php.net to get a copy of this message | ||
From: Pete_Wall at symantec dot com
Operating system: Solaris 10 (x86 and SPARC)
PHP version: 5.5.5
Package: Compile Failure
Bug Type: Bug
Bug description:Solaris build failure with 5.5
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 bug report at https://bugs.php.net/bug.php?id=66013&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66013&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66013&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66013&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66013&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66013&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66013&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66013&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66013&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66013&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66013&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66013&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66013&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66013&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66013&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66013&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66013&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66013&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66013&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66013&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66013&r=mysqlcfg