[uClibc]Apache-1.3.24 with uclibc-0.9.11 successful but adding php-4.2.1 have error messages !

phamhuyvu-tlnet phamhuyvu at tlnet.com.vn
Fri Jul 5 10:30:38 UTC 2002


----- Original Message -----
From: "Erik Andersen"
To: "phamhuyvu-tlnet"
Cc: <>
Sent: Wednesday, July 03, 2002 2:30 PM
Subject: Re: [uClibc]Apache-1.3.24 with uclibc-0.9.11 error message !


> On Thu Jul 04, 2002 at 03:31:05AM -0700, phamhuyvu-tlnet wrote:
> > Hi all,
> > I use uclibc-0.9.11 to make Apache-1.3.24.And having this error message.
> > While building httpd have errors when link to libmain.a (in http_main.o:
> > undefined reference to `_sys_siglist')
> > although  libmain.a is made successful
>
> Currently we are only providing 'sys_siglist', not
> '_sys_siglist'.  Its easy enough to add a weak alias
> so either name will work.   Try again with the latest
> from CVS?
>
>  -Erik
>
> --
> Erik B. Andersen
> --This message was written using 73% post-consumer electrons--
>

Hi Erik,
I have successfully made apache+xml using uclibc-0.9.11 by defining
SYS_SIGLIST  to another value.
But when I made php-4.2.1 have some errors because uClibc don't support
libnsl.a and libsocket.a ...
Error messages are below.
Does anyone help me answer 2 questions:
1) Do I need making libnsl.a again ( ofcourse by uclibc) to solve Error A ?
   Do I overcome Error 1 by setting SIZEOF[CHAR,INT,LONG,LONG_LONG] manually
in
 "php-4.2.1/main/php_config.h" file is true way ?
2) I think that Error B  appear because php use REENTRANCE
 ( source in "php-4.2.1/main/reentrancy.c file)
 stand by TSRM ( Thread Safe Resource Manager) using POSIX.
 Is it ok ? Can I use LinuxThread in uClibc ( ofcourse support TSRM)?

Please give me a hand !
Thanks.
--------
Error A:
--------
Making all in main
make[1]: Entering directory
`/home/users/huyvu/projects/source/php-4.2.1/main'
make[2]: Entering directory
`/home/users/huyvu/projects/source/php-4.2.1/main'
gcc -I. -I/home/users/huyvu/projects/source/php/main \
-I/home/users/huyvu/projects/source/php/main \
-I/home/users/huyvu/projects/source/php \
-I/home/users/huyvu/projects/source/apache/src/include \
-I/home/users/huyvu/projects/source/apache/src/os/unix \
-I/home/users/huyvu/projects/source/php/Zend \
-I/home/users/huyvu/projects/source/php/ext/mysql/libmysql \
-I/home/users/huyvu/projects/source/php/ext/xml/expat  \
-I/home/users/huyvu/projects/source/php/TSRM \
-g -O2  -c main.c && touch main.lo

In file included from
/home/users/huyvu/projects/source/php/ext/standard/php_standard.h:21,
                 from main.c:52:
/home/users/huyvu/projects/source/php/ext/standard/basic_functions.h:121:2:
#error Need type which holds 32 bits
make[2]: *** [main.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

-------------------------------------------------------
Explaining:
-----------
In "basic_functions.h" file
...
#if SIZEOF_INT == 4
/* Most 32-bit and 64-bit systems have 32-bit ints */
typedef unsigned int php_uint32;
typedef signed int php_int32;
#elif SIZEOF_LONG == 4
/* 16-bit systems? */
typedef unsigned long php_uint32;
typedef signed int php_int32;
#else
#error Need type which holds 32 bits
#endif
...

----------
Oh my God, my processor is Althon 32 bits.
----------

In "configure" file
......
echo $ac_n "checking size of long""... $ac_c" 1>&6
echo "configure:7269: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_long=8
else
  cat > conftest.$ac_ext <<EOF
#line 7277 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long));
  exit(0);
}
EOF
if { (eval echo configure:7288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_long=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_long=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_long" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_LONG $ac_cv_sizeof_long
EOF


echo $ac_n "checking size of int""... $ac_c" 1>&6
echo "configure:7308: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6
else
  if test "$cross_compiling" = yes; then
  ac_cv_sizeof_int=4
else
  cat > conftest.$ac_ext <<EOF
#line 7316 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(int));
  exit(0);
}
EOF
if { (eval echo configure:7327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }
&& test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
  ac_cv_sizeof_int=`cat conftestval`
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -fr conftest*
  ac_cv_sizeof_int=0
fi
rm -fr conftest*
fi

fi
echo "$ac_t""$ac_cv_sizeof_int" 1>&6
cat >> confdefs.h <<EOF
#define SIZEOF_INT $ac_cv_sizeof_int
EOF
......

---------

In "config.log" file
.....
configure:7269: checking size of long
configure:7288: gcc -o conftest -g -O2   conftest.c -lresolv -lm -ldl -lnsl
1>&5
/usr/bin/ld: warning: libc.so.6, needed by
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libnsl.so, may conflict
with libc.so.0
configure: failed program was:
#line 7277 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(long));
  exit(0);
}
configure:7308: checking size of int
configure:7327: gcc -o conftest -g -O2   conftest.c -lresolv -lm -ldl -lnsl
1>&5
/usr/bin/ld: warning: libc.so.6, needed by
/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libnsl.so, may conflict
with libc.so.0
configure: failed program was:
#line 7316 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
{
  FILE *f=fopen("conftestval", "w");
  if (!f) exit(1);
  fprintf(f, "%d\n", sizeof(int));
  exit(0);
}
.....

----------
But:
----------
In "Zend/Changelog" file
....
1999-04-19  stig  <stig at pb1.pair.com>

    * acconfig.h
      config.h.in
      configure.in: removed -lnsl and -lsocket checks from zend
....

-------------------------------------------------------
I think that uClibc don't support libnsl.a ( nameservice library).
When checking php source code I discover it is not need anymore but
it make "configure" set SIZEOF_CHAR;INT;LONG;LONG_LONG = 0 in
main/php_config.h.
After that, I set SIZEOF_CHAR,INT,LONG,LONG_LONG manually.
And modify "configure.in" at two lines
AC_CHECK_LIB(nsl,gethostbyname...) => AC_CHECK_LIB(gethostbyname,nsl,...)
AC_CHECK_LIB(nsl,gethostbyaddr...) => AC_CHECK_LIB(gethostbyaddr,nsl,...)
----------
make again ---> pass Error A, appear Error B

-------------------------------------------------------
Error B:
--------
gcc -I. -I/home/users/huyvu/projects/source/php/main -I/home/users/huyvu/pro
jects/source/php/main -I/home/users/huyvu/projects/source/php -I/home/users/
huyvu/projects/source/apache/src/include -I/home/users/huyvu/projects/source
/apache/src/os/unix -I/home/users/huyvu/projects/source/php/Zend -I/home/use
rs/huyvu/projects/source/php/ext/mysql/libmysql -I/home/users/huyvu/projects
/source/php/ext/xml/expat  -I/home/users/huyvu/projects/source/php/TSRM -g -
O2  -c reentrancy.c && touch reentrancy.lo
reentrancy.c: In function `php_readdir_r':
reentrancy.c:130: too few arguments to function `readdir_r'
make[2]: *** [reentrancy.lo] Error 1
make[2]: Leaving directory
`/home/users/huyvu/projects/source/php-4.2.1/main'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/users/huyvu/projects/source/php-4.2.1/main'
make: *** [all-recursive] Error 1
-------------------------------------------------------





More information about the uClibc mailing list