php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33569 Compile fails with /usr/include/sys/socket.h:202: net/if_dl.h: No such file or
Submitted: 2005-07-04 22:40 UTC Modified: 2005-07-06 01:03 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: jccann at gmail dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5CVS-2005-07-04 OS: Solaris
Private report: No CVE-ID: None
 [2005-07-04 22:40 UTC] jccann at gmail dot com
Description:
------------
I am trying to compile php 5.0.4 with NSAPI support.  The configuration script runs to success, but the compilation fails.

Reproduce code:
---------------
Solaris 8  [SunOS spapp7 5.8 Generic_117350-24 sun4u sparc SUNW,Sun-Fire]

gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/specs
gcc version 2.95.3 20010315 (release)


Tried both Sun ONE Web Server 6.1 SP4 and Sun ONE Web Server 6.0 SP5.

Here's my configure options:

$ ./configure --with-mysql=/usr/local/mysql --enable-libgcc
--with-nsapi=/opt/SUNWwbsvr --with-libxml-dir=/opt/csw/

I've also tried with the --enable-sockets option with the same result.

Here's the output from config.log - but configure ran to success.

configure:16691: gcc -c -g -O2 -pthreads  -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT conftest.c 1>&5
In file included from configure:16684:
/usr/include/sys/socket.h:202: net/if_dl.h: No such file or directory
configure: failed program was:
#line 16681 "configure"
#include "confdefs.h"

#include <sys/types.h>
#include <sys/socket.h>

int main() {
static struct sockaddr sa; int n = (int) sa.sa_len; return n
; return 0; }




Expected result:
----------------
I expect that since the configure script could not detect the if_dl.h file, the compiler was set to an invalid compilation path.  

Based on information in below (actual result), I expected configure script to 'figure out' that it needs to set a different compilation preprocessor flag (!defined(_XPG4_2) || defined(__EXTENSIONS__)

At a minimum, since configure detected the error, shouldn't it stop with an error since the compile won't work?

Finally, I'm not sure how to set this or what other php configure flag to turn on XPG4_2 compliance.  Could you suggest a work around?



Actual result:
--------------
After configuration, the compile fails with:

/mysql/php_mysql.o  && echo > ext/mysql/php_mysql.lo
In file included from /usr/include/netdb.h:98,
                from /usr/local/php-5.0.4/ext/mysql/php_mysql.c:53:
/usr/include/sys/socket.h:202: net/if_dl.h: No such file or directory
make: *** [ext/mysql/php_mysql.lo] Error 1


Here's the relevant lines from /usr/include/netdb.h :

    90 #ifndef _NETDB_H
    91 #define _NETDB_H
    92
    93 #pragma ident   "@(#)netdb.h    1.25    01/05/08 SMI"
    94
    95 #include <sys/types.h>
    96 #include <netinet/in.h>
    97 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
    98 #include <sys/socket.h>
    99 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
   100 #include <sys/feature_tests.h>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-04 22:44 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-07-05 07:25 UTC] jccann at gmail dot com
Hi,

With today's snapshot [php5-200507050430], it still fails in the same way as in php 5.0.4 - configure runs to success.  But, when I check the config.log for the net/if_dl.h test, it fails:

configure:9795: checking for NSAPI support
configure:9815: checking for NSAPI include files
configure:9868: checking for /apps/SUNWwbsvr/plugins/include/nsapi.h
configure:9878: gcc -E  -D_POSIX_PTHREAD_SEMANTICS conftest.c >/dev/null 2>conftest.out
In file included from /apps/SUNWwbsvr/plugins/include/nsapi.h:278,
                 from configure:9874:
/usr/include/sys/socket.h:202: net/if_dl.h: No such file or directory
configure: failed program was:
#line 9873 "configure"
#include "confdefs.h"
#include </apps/SUNWwbsvr/plugins/include/nsapi.h>


Here's the compilation failure.

/bin/sh /usr/local/php/php5-200507050430/libtool --silent --preserve-dup-deps --mode=compile /usr/local/php/php5-200507050430/meta_ccld  -Iext/mysql/ -I/usr/local/php/php5-200507050430/ext/mysql/ -DPHP_ATOM_INC -I/usr/local/php/php5-200507050430/include -I/usr/local/php/php5-200507050430/main -I/usr/local/php/php5-200507050430 -I/apps/SUNWwbsvr/plugins/include -I/opt/csw/include/libxml2 -I/usr/local/mysql/include -I/usr/local/php/php5-200507050430/TSRM -I/usr/local/php/php5-200507050430/Zend  -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT  -g -O2 -pthreads -DZTS   -c /usr/local/php/php5-200507050430/ext/mysql/php_mysql.c -o ext/mysql/php_mysql.lo
In file included from /usr/include/netdb.h:98,
                 from /usr/local/php/php5-200507050430/ext/mysql/php_mysql.c:53:
/usr/include/sys/socket.h:202: net/if_dl.h: No such file or directory
make: *** [ext/mysql/php_mysql.lo] Error 1
 [2005-07-05 08:05 UTC] jccann at gmail dot com
Just to clarify my post on the snapshot test.  The configure script runs to success, but the compilation continues to fail.

Is it possible that there is a simple workaround such as an extra compilation flag to avoid using the sys/socket.h include file?

    97 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
    98 #include <sys/socket.h>
    99 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
 [2005-07-05 10:08 UTC] sniper@php.net
Does this work:

# rm config.cache 
# ./configure --disable-all --disable-cgi --enable-sockets
# make clean && make


 [2005-07-05 21:42 UTC] jccann at gmail dot com
Hi - Thanks for the suggestion.

I tried the following commands with both php 5.0.4 and snapshot php5-200507050430

# rm config.cache 
# ./configure --disable-all --disable-cgi --enable-sockets
# make clean && make

Although both do not fail in the same location, the same issue appears : net/if_dl.h: No such file or directory.  

[full output below]

I'm guessing by your suggestion that this is not an NSAPI problem per se, but perhaps caused by something else in my environment?  Is it a solaris 8 issue?  gcc version?  Am I missing some solaris package that should be installed.  Maybe my LD_LIBRARY_PATH or PATH are incorrect?

I'm willing to continue to try various suggestions.  I would like to help resolve this problem.

Thanks,
Jeff

Here's the output.

------------- php 5.0.4 --------------------
 make clean && make
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f 
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp5.la sapi/cli/php  modules/* libs/*
gcc  -Iext/sockets/ -I/usr/local/php/php-5.0.4/ext/sockets/ -DPHP_ATOM_INC -I/usr/local/php/php-5.0.4/include -I/usr/local/php/php-5.0.4/main -I/usr/local/php/php-5.0.4 -I/usr/local/php/php-5.0.4/TSRM -I/usr/local/php/php-5.0.4/Zend  -D_POSIX_PTHREAD_SEMANTICS  -g -O2  -c /usr/local/php/php-5.0.4/ext/sockets/sockets.c -o ext/sockets/sockets.o  && echo > ext/sockets/sockets.lo
In file included from /usr/local/php/php-5.0.4/ext/sockets/sockets.c:39:
/usr/include/sys/socket.h:202: net/if_dl.h: No such file or directory
make: *** [ext/sockets/sockets.lo] Error 1




------------ output for php5-200507050430 ----------

$ make clean && make                                      
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f 
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp5.la sapi/cli/php  modules/* libs/*
/bin/sh /usr/local/php/php5-200507050430/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/usr/local/php/php5-200507050430/ext/date/ -DPHP_ATOM_INC -I/usr/local/php/php5-200507050430/include -I/usr/local/php/php5-200507050430/main -I/usr/local/php/php5-200507050430 -I/usr/local/php/php5-200507050430/TSRM -I/usr/local/php/php5-200507050430/Zend  -D_POSIX_PTHREAD_SEMANTICS  -g -O2  -c /usr/local/php/php5-200507050430/ext/date/php_date.c -o ext/date/php_date.lo 
/bin/sh /usr/local/php/php5-200507050430/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/usr/local/php/php5-200507050430/ext/date/ -DPHP_ATOM_INC -I/usr/local/php/php5-200507050430/include -I/usr/local/php/php5-200507050430/main -I/usr/local/php/php5-200507050430 -I/usr/local/php/php5-200507050430/TSRM -I/usr/local/php/php5-200507050430/Zend  -D_POSIX_PTHREAD_SEMANTICS  -g -O2  -c /usr/local/php/php5-200507050430/ext/date/lib/dow.c -o ext/date/lib/dow.lo 
/bin/sh /usr/local/php/php5-200507050430/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/usr/local/php/php5-200507050430/ext/date/ -DPHP_ATOM_INC -I/usr/local/php/php5-200507050430/include -I/usr/local/php/php5-200507050430/main -I/usr/local/php/php5-200507050430 -I/usr/local/php/php5-200507050430/TSRM -I/usr/local/php/php5-200507050430/Zend  -D_POSIX_PTHREAD_SEMANTICS  -g -O2  -c /usr/local/php/php5-200507050430/ext/date/lib/parse_date.c -o ext/date/lib/parse_date.lo 
/bin/sh /usr/local/php/php5-200507050430/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/usr/local/php/php5-200507050430/ext/date/ -DPHP_ATOM_INC -I/usr/local/php/php5-200507050430/include -I/usr/local/php/php5-200507050430/main -I/usr/local/php/php5-200507050430 -I/usr/local/php/php5-200507050430/TSRM -I/usr/local/php/php5-200507050430/Zend  -D_POSIX_PTHREAD_SEMANTICS  -g -O2  -c /usr/local/php/php5-200507050430/ext/date/lib/parse_tz.c -o ext/date/lib/parse_tz.lo 
/bin/sh /usr/local/php/php5-200507050430/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/usr/local/php/php5-200507050430/ext/date/ -DPHP_ATOM_INC -I/usr/local/php/php5-200507050430/include -I/usr/local/php/php5-200507050430/main -I/usr/local/php/php5-200507050430 -I/usr/local/php/php5-200507050430/TSRM -I/usr/local/php/php5-200507050430/Zend  -D_POSIX_PTHREAD_SEMANTICS  -g -O2  -c /usr/local/php/php5-200507050430/ext/date/lib/timelib.c -o ext/date/lib/timelib.lo 
/bin/sh /usr/local/php/php5-200507050430/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/usr/local/php/php5-200507050430/ext/date/ -DPHP_ATOM_INC -I/usr/local/php/php5-200507050430/include -I/usr/local/php/php5-200507050430/main -I/usr/local/php/php5-200507050430 -I/usr/local/php/php5-200507050430/TSRM -I/usr/local/php/php5-200507050430/Zend  -D_POSIX_PTHREAD_SEMANTICS  -g -O2  -c /usr/local/php/php5-200507050430/ext/date/lib/tm2unixtime.c -o ext/date/lib/tm2unixtime.lo 
/bin/sh /usr/local/php/php5-200507050430/libtool --silent --preserve-dup-deps --mode=compile gcc -Iext/date/lib -Iext/date/ -I/usr/local/php/php5-200507050430/ext/date/ -DPHP_ATOM_INC -I/usr/local/php/php5-200507050430/include -I/usr/local/php/php5-200507050430/main -I/usr/local/php/php5-200507050430 -I/usr/local/php/php5-200507050430/TSRM -I/usr/local/php/php5-200507050430/Zend  -D_POSIX_PTHREAD_SEMANTICS  -g -O2  -c /usr/local/php/php5-200507050430/ext/date/lib/unixtime2tm.c -o ext/date/lib/unixtime2tm.lo 
/bin/sh /usr/local/php/php5-200507050430/libtool --silent --preserve-dup-deps --mode=compile gcc  -Iext/sockets/ -I/usr/local/php/php5-200507050430/ext/sockets/ -DPHP_ATOM_INC -I/usr/local/php/php5-200507050430/include -I/usr/local/php/php5-200507050430/main -I/usr/local/php/php5-200507050430 -I/usr/local/php/php5-200507050430/TSRM -I/usr/local/php/php5-200507050430/Zend  -D_POSIX_PTHREAD_SEMANTICS  -g -O2  -c /usr/local/php/php5-200507050430/ext/sockets/sockets.c -o ext/sockets/sockets.lo 
In file included from /usr/local/php/php5-200507050430/ext/sockets/sockets.c:39:
/usr/include/sys/socket.h:202: net/if_dl.h: No such file or directory
make: *** [ext/sockets/sockets.lo] Error 1
 [2005-07-05 22:57 UTC] sniper@php.net
This is really a problem in your system installation.
Something is either been deleted accidently or not installed at all. (that same configure line works just fine on properly configured/installed Solaris 8)
 [2005-07-06 00:33 UTC] jccann at gmail dot com
I understand that you may think it's an operating system environment problem.  But, I checked three other Solaris 8 installations and none of them have the net/if_dl.h file.

Are you testing this on a solaris 8 box?  Can you post the uname -a information, please?

Thanks
 [2005-07-06 01:03 UTC] sniper@php.net
We do NOT include net/if_dl.h anywhere in our sources.
We only include socket.h and THAT tries to include the non-existing file -> not our problem. 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 14:01:32 2024 UTC