Need help building mips3 PHP 5.1.5

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
dkedrowitsch
Posts: 280
Joined: Fri Mar 31, 2006 6:11 pm
Location: Macungie, PA USA

Need help building mips3 PHP 5.1.5

Unread postby dkedrowitsch » Thu Dec 28, 2006 4:00 pm

Perhaps somebody can help?

I'm trying to build PHP 5.1.5 (also tried 5.2.0 with same result) and the configure is bombing on the MySQL stuff.

I have MySQL 4 built exactly like the mips4 neko package.

Here's all the info.

The MySQL sock is in the proper location, as is MySQL itself (/usr/nekoware/mysql4). Maybe someone can explain the problem?

Environment variables I'm using:

Code: Select all

export CC=c99
export CFLAGS='-O3 -mips3 -I/usr/nekoware/include -OPT:Olimit=0:roundoff=3'
export CXXFLAGS=$CFLAGS
export CPPFLAGS='-I/usr/nekoware/include'
export CXX=CC
export F77=f77
export LDFLAGS='-L/usr/nekoware/lib -rpath /usr/nekoware/lib'
export PKG_CONFIG=/usr/nekoware/bin/pkg-config
export PKG_CONFIG_PATH='/usr/nekoware/lib/pkgconfig'
export PKG_CONFIG_LIBDIR='/usr/nekoware/lib'
export LD_LIBRARY_PATH='/usr/nekoware/lib'
export LD_LIBRARYN32_PATH='/usr/nekoware/lib'
export LD_LIBRARY64_PATH='/usr/nekoware/lib64'
export GNOME2_DIR='/usr/nekoware'
export GNUMAKE='/usr/nekoware/bin/make'
export PATH=/usr/nekoware/bin:$PATH
export PYTHONHOME=/usr/nekoware
export PYTHONPATH=/usr/nekoware/lib/python2.4
export PERL=/usr/nekoware/bin/perl     
export QTDIR=/usr/nekoware/qt4


Configure flags:

Code: Select all

--prefix=/usr/nekoware/php5 \
--with-apxs2=/usr/nekoware/apache2/bin/apxs \
--disable-cgi \
--enable-tokenizer \
--enable-dio \
--enable-aggregate \
--enable-memory-limit \
--enable-dba=shared \
--enable-dbx \
--with-inifile \
--with-flatfile \
--enable-calendar \
--enable-bcmath \
--enable-shmop \
--enable-sysvshm=yes \
--enable-sysvsem=yes \
--enable-track-vars=yes \
--enable-url-includes \
--enable-memory-limit \
--enable-wddx \
--enable-soap=shared \
--with-config-file-path=/usr/nekoware/etc/php5 \
--with-libxml-dir=/usr/nekoware \
--with-expat-dir=/usr/nekoware \
--with-png-dir=/usr/nekoware \
--with-jpeg-dir=/usr/nekoware \
--with-freetype-dir=/usr/nekoware \
--with-zlib-dir=/usr/nekoware \
--with-zlib \
--with-curlwrappers \
--with-curl=shared,/usr/nekoware \
--with-openssl=shared,/usr/nekoware \
--with-mysql=shared,/usr/nekoware/mysql4 \
--with-mysql-sock=/usr/nekoware/var/run/mysql4 \
--enable-embedded-mysqli=shared \
--with-mysqli=shared,/usr/nekoware/mysql4/bin/mysql_config \
--with-pdo-mysql=shared,/usr/nekoware/mysql4 \
--with-bz2=shared,/usr/nekoware \
--with-iconv-dir=/usr/nekoware \
--enable-ftp=shared \
--enable-sockets=shared \
--with-gd=shared \
--enable-sqlite-utf8 \
--with-sqlite=shared \
--enable-exif=shared \
--enable-dbase=shared \
--enable-pcntl=shared \
--enable-mbstring=shared \
--with-gmp=shared,/usr/nekoware \
--with-db4=/usr/nekoware \
--with-gettext=shared,/usr/nekoware \
--with-ncurses=shared,/usr/nekoware \
--disable-xmlreader \
--disable-xmlwriter \
--with-xsl=shared,/usr/nekoware \
--enable-sigchild


The relevent configure output:

Code: Select all

checking for MySQL support... yes, shared
checking for specified location of the MySQL UNIX socket... /usr/nekoware/var/run/mysql4
checking for MySQL UNIX socket location... /usr/nekoware/var/run/mysql4
checking for mysql_close in -lmysqlclient... no
checking for mysql_error in -lmysqlclient... no
configure: error: mysql configure failed. Please check config.log for more information.


The error in the configure.log:

Code: Select all

configure:57767: checking for specified location of the MySQL UNIX socket
configure:57824: checking for MySQL UNIX socket location
configure:58014: checking for mysql_close in -lmysqlclient
configure:58033: c99 -o conftest -I/usr/include -O3 -mips3 -I/usr/nekoware/include -OPT:Olimit=0:roundoff=3 -I/usr/nekoware/include -D_XPG_IV -Wl,-rpath,/usr/nekoware/mysql4/lib/mysql -L/usr/nekoware/mysql4/lib/mysql -L/usr/lib -L/usr/nekoware/lib -L/usr/nekoware/lib -rpath /usr/nekoware/lib -Wl,-rpath,/usr/nekoware/lib -L/usr/nekoware/lib conftest.c -lmysqlclient  -ldb-4.3 -lz -lm  -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm 1>&5
ld32: FATAL   12 : Expecting n32 objects: /usr/lib/crt1.o is o32.
configure: failed program was:
#line 58022 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_close();

int main() {
mysql_close()
; return 0; }
configure:58254: checking for mysql_error in -lmysqlclient
configure:58273: c99 -o conftest -I/usr/include -O3 -mips3 -I/usr/nekoware/include -OPT:Olimit=0:roundoff=3 -I/usr/nekoware/include -D_XPG_IV -Wl,-rpath,/usr/nekoware/mysql4/lib/mysql -L/usr/nekoware/mysql4/lib/mysql -Wl,-rpath,/usr/nekoware/lib -L/usr/nekoware/lib -L/usr/lib -L/usr/nekoware/lib -L/usr/nekoware/lib -rpath /usr/nekoware/lib -Wl,-rpath,/usr/nekoware/lib -L/usr/nekoware/lib conftest.c -lmysqlclient  -ldb-4.3 -lz -lm  -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm 1>&5
ld32: FATAL   12 : Expecting n32 objects: /usr/lib/crt1.o is o32.
configure: failed program was:
#line 58262 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char mysql_error();

int main() {
mysql_error()
; return 0; }

User avatar
nekonoko
Site Admin
Site Admin
Posts: 8015
Joined: Thu Jan 23, 2003 2:31 am
Location: Pleasanton, California
Contact:

Unread postby nekonoko » Thu Dec 28, 2006 4:10 pm

Yep, I've run into this before:

Code: Select all

ld32: FATAL   12 : Expecting n32 objects: /usr/lib/crt1.o is o32


Here is my fix:

Edit configure.in; find the following:

*mips*)
CPPFLAGS="$CPPFLAGS -D_XPG_IV";;

Change to:

*mips*)
CPPFLAGS="$CPPFLAGS -D_XPG_IV -L/usr/lib32";;

Afterward, rebuild 'configure' with 'buildconf --force'. You may need to edit the buildconf script to change the 'make' references to 'gmake' depending on how your paths are set up.
Twitter: @neko_no_ko
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.

User avatar
joerg
Posts: 2223
Joined: Thu Jan 08, 2004 7:57 am
Location: In an origin rack - Germany
Contact:

Unread postby joerg » Thu Dec 28, 2006 4:21 pm

nekonoko wrote:Yep, I've run into this before:
...

Afterward, rebuild 'configure' with 'buildconf --force'. You may need to edit the buildconf script to change the 'make' references to 'gmake' depending on how your paths are set up.


Rebuilding the configure only works when you already have the right versions auf autoconf/automake/bison/flex available. It also takes some time..... on our old machines.

I always edit the configure in thoses cases. The config log shows the exact line where the configure check was executed. I replace the line with a modified hardcoded string :)

regards
Joerg

User avatar
dkedrowitsch
Posts: 280
Joined: Fri Mar 31, 2006 6:11 pm
Location: Macungie, PA USA

Unread postby dkedrowitsch » Thu Dec 28, 2006 5:10 pm

Well, I have autoconf and bison installed already, but following nekonoko's advice yeilds this error:

Code: Select all

root@INDIGO:/usr/people/dieter/php-5.2.0# ./buildconf --force
Forcing buildconf
using default Zend directory
buildconf: checking installation...
buildconf: autoconf version 2.59 (ok)
buildconf: Your version of autoconf likely contains buggy cache code.
           Running cvsclean for you.
           To avoid this, install autoconf-2.13.
make: file `build/build2.mk' line 32: Must be a separator (: or ::) for rules (bu39)
make: file `build/build2.mk' line 32: Syntax error
*** Error code 1 (bu21)


Perhaps I should follow joerg's advice and just edit the configure script?

User avatar
nekonoko
Site Admin
Site Admin
Posts: 8015
Joined: Thu Jan 23, 2003 2:31 am
Location: Pleasanton, California
Contact:

Unread postby nekonoko » Thu Dec 28, 2006 5:13 pm

dkedrowitsch wrote:

Code: Select all

make: file `build/build2.mk' line 32: Syntax error
*** Error code 1 (bu21)


Perhaps I should follow joerg's advice and just edit the configure script?


Yep, as I said, you may need to change 'make' to 'gmake' in the buildconf script. It's calling the system supplied 'make' which won't work.
Twitter: @neko_no_ko
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.

User avatar
joerg
Posts: 2223
Joined: Thu Jan 08, 2004 7:57 am
Location: In an origin rack - Germany
Contact:

Unread postby joerg » Thu Dec 28, 2006 5:17 pm

dkedrowitsch wrote:Well, I have autoconf and bison installed already, but following nekonoko's advice yeilds this error:


Be sure that you put /usr/nekoware/bin at first place in your $PATH when building stuff and as already say'd...you need the right ones[tm].

Same was true when try to build MYSQL from the bitkeeper.

regards
Joerg

User avatar
dkedrowitsch
Posts: 280
Joined: Fri Mar 31, 2006 6:11 pm
Location: Macungie, PA USA

Unread postby dkedrowitsch » Thu Dec 28, 2006 5:29 pm

Right, duh, I had to modify the buildconf script to use gmake. :)

Buildconf seems to be doing it's thing as we speek. Hopefully it doesn't bomb. 8)

As for putting nekoware first in my path, it's been done (see my environment variables at the top of the thread). I just copied them right from the relnotes (yours, joerg, if I recall correctly). But unless I rename gmake to make, it won't help I don't think. Or could I simply do alias make=gmake?

It also takes some time..... on our old machines.


What are you saying, my 200MHz R4400 is slow? Maybe I just need some 8mm plug wires and a piece of plastic in the fan as a noise maker. Oh and a Type 'R' sticker. :twisted:

User avatar
joerg
Posts: 2223
Joined: Thu Jan 08, 2004 7:57 am
Location: In an origin rack - Germany
Contact:

Unread postby joerg » Thu Dec 28, 2006 5:39 pm

dkedrowitsch wrote:Right, duh, I had to modify the buildconf script to use gmake. :)

Buildconf seems to be doing it's thing as we speek. Hopefully it doesn't bomb. 8)

As for putting nekoware first in my path, it's been done (see my environment variables at the top of the thread). I just copied them right from the relnotes (yours, joerg, if I recall correctly). But unless I rename gmake to make, it won't help I don't think. Or could I simply do alias make=gmake?


Hmmm... and how can it be happens that buildconf uses the wrong make? Ah... i remember :)

Code: Select all

[o2k]:~ $ ll /usr/nekoware/bin/make
lrwxr-xr-x    1 root     sys           23 Juni 29  2005 /usr/nekoware/bin/make -> /usr/nekoware/bin/gmake



Our neko_make only comes with a gmake binary and i have created a symlink to it. This in combination with usr/nekoware/bin first in your $PATH will fix those problems.

regards
Joerg

User avatar
foetz
Posts: 5516
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Unread postby foetz » Thu Dec 28, 2006 7:24 pm

gnumake should always be named gmake.
r-a-c.de

User avatar
squeen
Moderator
Moderator
Posts: 2931
Joined: Fri May 09, 2003 6:10 am
Location: Maryland, USA

Unread postby squeen » Thu Dec 28, 2006 7:29 pm

foetz wrote:gnumake should always be named gmake.


On all platform! :D

User avatar
foetz
Posts: 5516
Joined: Mon Apr 14, 2003 4:34 am
Contact:

Unread postby foetz » Thu Dec 28, 2006 7:44 pm

squeen wrote:
foetz wrote:gnumake should always be named gmake.


On all platform! :D


and especially on those having a native, proprietary make already.
r-a-c.de

User avatar
dkedrowitsch
Posts: 280
Joined: Fri Mar 31, 2006 6:11 pm
Location: Macungie, PA USA

Unread postby dkedrowitsch » Thu Dec 28, 2006 7:49 pm

Ok, configure finishes now and finds MySQL correctly.

New problem. :)

gmake runs for a while then rapidly chews up all my RAM (Indigo2 R4400 maxed out to 384 megs) and bombs.

Does it really need more RAM to compile or is something wrong? If it requires more RAM I'm screwed because these boxes won't take more then 384 megs.

Code: Select all

/bin/sh /usr/people/dieter/php-5.2.0/libtool --silent --preserve-dup-deps --mode=compile c99 -Iext/date/lib -Iext/date/ -I/usr/people/dieter/php-5.2.0/ext/date/ -DPHP_ATOM_INC -I/usr/people/dieter/php-5.2.0/include -I/usr/people/dieter/php-5.2.0/main -I/usr/people/dieter/php-5.2.0 -I/usr/nekoware/include/libxml2 -I/usr/nekoware/include -I/usr/people/dieter/php-5.2.0/ext/date/lib -I/usr/nekoware/include/freetype2 -I/usr/people/dieter/php-5.2.0/ext/mbstring/oniguruma -I/usr/people/dieter/php-5.2.0/ext/mbstring/libmbfl -I/usr/people/dieter/php-5.2.0/ext/mbstring/libmbfl/mbfl -I/usr/nekoware/mysql4/include/mysql -I/usr/nekoware/include/ncurses -I/usr/people/dieter/php-5.2.0/TSRM -I/usr/people/dieter/php-5.2.0/Zend  -I/usr/nekoware/include -D_XPG_IV -L/usr/lib32  -I/usr/include -O3 -mips3 -I/usr/nekoware/include -OPT:Olimit=0:roundoff=3   -c /usr/people/dieter/php-5.2.0/ext/date/lib/parse_date.c -o ext/date/lib/parse_date.lo
### Compiler Error in file /usr/people/dieter/php-5.2.0/ext/date/lib/parse_date.c (user routine 'scan') during Global Optimization -- Dead Code Elimination phase:
### Out of memory in Allocate_Block
c99 INTERNAL ERROR:  /usr/lib32/cmplrs/be returned non-zero status 1
gmake: *** [ext/date/lib/parse_date.lo] Error 1

User avatar
nekonoko
Site Admin
Site Admin
Posts: 8015
Joined: Thu Jan 23, 2003 2:31 am
Location: Pleasanton, California
Contact:

Unread postby nekonoko » Thu Dec 28, 2006 8:15 pm

dkedrowitsch wrote:Ok, configure finishes now and finds MySQL correctly.

New problem. :)

gmake runs for a while then rapidly chews up all my RAM (Indigo2 R4400 maxed out to 384 megs) and bombs.

Does it really need more RAM to compile or is something wrong? If it requires more RAM I'm screwed because these boxes won't take more


You could try dropping the optimization down a bit (remove -OPT:Olimit=0:roundoff=3 from CFLAGS). That level of optimization can be very memory intensive.
Twitter: @neko_no_ko
IRIX Release 4.0.5 IP12 Version 06151813 System V
Copyright 1987-1992 Silicon Graphics, Inc.
All Rights Reserved.

User avatar
dkedrowitsch
Posts: 280
Joined: Fri Mar 31, 2006 6:11 pm
Location: Macungie, PA USA

Unread postby dkedrowitsch » Thu Dec 28, 2006 9:41 pm

Ok, I switched to -02 and removed -OPT:Olimit=0:roundoff=3.

Bummer, now I get:

Code: Select all

"/usr/people/dieter/php-5.2.0/ext/date/lib/parse_date.c": Warning: Olimit was exceeded on function scan; will not optimize.
        To optimize use -OPT:Olimit=0 (off) or -OPT:Olimit=33353

### Assertion failure at line 1951 of ../../be/cg/cgemit.cxx:
### Compiler Error in file /usr/people/dieter/php-5.2.0/ext/date/lib/parse_date.c during Assembly phase:
### branch offset 134784 doesn't fit; try recompiling with -CG:longbranch_limit=[try values smaller than 124000]
c99 INTERNAL ERROR:  /usr/lib32/cmplrs/be returned non-zero status 1
gmake: *** [ext/date/lib/parse_date.lo] Error 1


Isn't 02 supposed to use less RAM then 03? Maybe I can get away with 02 -OPT:Olimit=0?

User avatar
dkedrowitsch
Posts: 280
Joined: Fri Mar 31, 2006 6:11 pm
Location: Macungie, PA USA

Unread postby dkedrowitsch » Thu Dec 28, 2006 11:03 pm

--> UPDATE: <--

It's seems to be compiling fine with -O2 -OPT:Olimit=0. It didn't use nearly as much RAM (about 100 megs less) at the same spot where it would run out of memory before, and seems to be chugging along fine now. I'll check on it in the morning to see how it did (assuming it finishes by then).

How much of a performance hit, if any, should I expect when using -O2 rather then -O3?


Return to “SGI: Development”

Who is online

Users browsing this forum: Google [Bot] and 2 guests