lsapi + Sun Studio 10 Compilers

#1
Hello,

Compiling the Litespeed API (PHP 5.1.0RC1) on Solaris Express: Community Release b23 using the Sun Studio 10 compilers, it complains very loudly about functions not declared as static using variables that are declared as static:

"/home/jailbird/php-5.1.0RC1/sapi/litespeed/lsapilib.c", line 128: reference to static identifier "g_running" in extern inline
function
"/home/jailbird/php-5.1.0RC1/sapi/litespeed/lsapilib.c", line 432: reference to static identifier "ack" in extern inline function
cc: acomp failed for /home/jailbird/php-5.1.0RC1/sapi/litespeed/lsapilib.c

Here is a quick patch to fix it:

--- litespeed/lsapilib.c 2005-09-25 10:51:32.000000000 -0500
+++ litespeed.new/lsapilib.c 2005-10-03 16:07:55.260000000 -0500
@@ -119,7 +119,7 @@
}
}

-inline int lsapi_read( int fd, void * pBuf, int len )
+static inline int lsapi_read( int fd, void * pBuf, int len )
{
int ret;
while( 1 )
@@ -427,7 +427,7 @@

static struct lsapi_packet_header ack = {'L', 'S',
LSAPI_REQ_RECEIVED, LSAPI_ENDIAN, {LSAPI_PACKET_HEADER_LEN} };
-inline int notify_req_received( LSAPI_Request * pReq )
+static inline int notify_req_received( LSAPI_Request * pReq )
{
if ( write( pReq->m_fd, &ack, LSAPI_PACKET_HEADER_LEN )
< LSAPI_PACKET_HEADER_LEN )
 
#2
Okay... now it bombed out in linking:

Undefined first referenced
symbol in file
swapIntEndian /tmp/postoBAAZkayPr
isPipe /tmp/postoBAAZkayPr
allocateBuf /tmp/postoBAAZkayPr
verifyHeader /tmp/postoBAAZkayPr
fixEndian /tmp/postoBAAZkayPr
ld: fatal: Symbol referencing errors. No output written to sapi/litespeed/php

Second patch:

--- litespeed/lsapilib.c 2005-09-25 10:51:32.000000000 -0500
+++ litespeed.new/lsapilib.c 2005-10-03 16:30:08.090000000 -0500
@@ -198,7 +198,7 @@
//}


-inline int allocateBuf( LSAPI_Request * pReq, int size )
+static inline int allocateBuf( LSAPI_Request * pReq, int size )
{
char * pBuf = (char *)realloc( pReq->m_pReqBuf, size );
if ( pBuf )
@@ -225,7 +225,7 @@
return 0;
}

-inline int verifyHeader( struct lsapi_packet_header * pHeader, char pktType )
+static inline int verifyHeader( struct lsapi_packet_header * pHeader, char pktType )
{
if (( LSAPI_VERSION_B0 != pHeader->m_versionB0 )||
( LSAPI_VERSION_B1 != pHeader->m_versionB1 )||
@@ -265,7 +265,7 @@

}

-inline int isPipe( int fd )
+static inline int isPipe( int fd )
{
char achPeer[128];
int len = 128;
@@ -312,7 +312,7 @@
return 0;
}

-inline void swapIntEndian( int * pInteger )
+static inline void swapIntEndian( int * pInteger )
{
char * p = (char *)pInteger;
register char b;
@@ -325,7 +325,7 @@

}

-inline void fixEndian( LSAPI_Request * pReq )
+static inline void fixEndian( LSAPI_Request * pReq )
{
struct lsapi_req_header *p= pReq->m_pHeader;
swapIntEndian( &p->m_httpHeaderLen );
 

mistwang

LiteSpeed Staff
#3
Thank you for bug report and patches. :)

We had made all inline functions static in the 1.4 release with other bug fixes. Please use the new code base.
 
Top