When I try to emerge mod_php-4.3.1-r1 I get the following error during the configure step: configure: error: can not run test program while cross compiling !!! ERROR: dev-php/mod_php-4.3.1-r1 failed. !!! Function src_compile, Line 169, Exitcode 1 !!! bad ./configure It looks like this is detected earlier in the configure script: checking whether the C compiler (gcc -march=pentium3 -O3 -pipe -mmmx -msse ) is a cross-compiler... yes I've been trying a few things and I think it has something to do with my USE variable. When I uncomment the USE variable from make.conf it builds. Portage 2.0.47-r10 (default-x86-1.4, gcc-3.2.1, glibc-2.3.1-r2) ================================================================= System uname: 2.4.20-gentoo-r1 i686 Celeron (Coppermine) GENTOO_MIRRORS="ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo/" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" PORTDIR="/usr/portage" DISTDIR="/usr/portage/distfiles" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR_OVERLAY="" USE="x86 3dnow apm kde mmx xv zlib berkdb arts tcltk X gpm pam qt motif cdr apache2 -esd -gnome -nls python -perl -postgres dvd aalib mpeg sse cups dga gtk gtk2 opengl bonobo -evo gtkhtml imlib ncurses readline sdl svga gif jpeg png tiff avi quicktime alsa -mikmod -nas -oss xmms oggvorbis flash encode ipv6 ssl crypt imap ldap tcpd mozilla -mozctl -mozaccess-builtin moznomail moznocompose moznoirc mozxmlterm spell truetype xml xml2 pdflib -tetex -guile -java -ruby -slang libwww libg++ mysql -odbc gd gdbm -samba -mad" COMPILER="gcc3" CHOST="i686-pc-linux-gnu" CFLAGS="-march=pentium3 -O3 -pipe -mmmx -msse" CXXFLAGS="-march=pentium3 -O3 -pipe -mmmx -msse" ACCEPT_KEYWORDS="x86 ~x86" MAKEOPTS="" AUTOCLEAN="yes" SYNC="rsync.nl.gentoo.org" FEATURES="sandbox ccache" Reproducible: Always Steps to Reproduce: 1. emerge mod_php 2. 3.
Oh, and changing the CFLAGS / CHOST didn't work.
I get something similar. checking for c++... g++ checking whether the C++ compiler (g++ -march=athlon-tbird -O3 -pipe -Wl,-rpath,/usr/X11R6/lib -L/usr/X11R6/lib -Wl,-rpath,/opt/blackdown-jdk-1.3.1/jre/lib/i386/classic -L/opt/blackdown-jdk-1.3.1/jre/lib/i386/classic -Wl,-rpath,/opt/blackdown-jdk-1.3.1/jre/lib/i386/server -L/opt/blackdown-jdk-1.3.1/jre/lib/i386/server -Wl,-rpath,/opt/blackdown-jdk-1.3.1/jre/lib/i386/native_threads -L/opt/blackdown-jdk-1.3.1/jre/lib/i386/native_threads -Wl,-rpath,/opt/blackdown-jdk-1.3.1/jre/lib/i386 -L/opt/blackdown-jdk-1.3.1/jre/lib/i386 -Wl,-rpath,/usr/qt/3/lib -L/usr/qt/3/lib) works... no configure: error: installation or configuration problem: C++ compiler cannot create executables. !!! ERROR: dev-php/mod_php-4.3.1 failed. !!! Function src_compile, Line 216, Exitcode 1 !!! bad ./configure
I got the same, a '#USE="-java" emerge mod_php' do make it compile although that is not a prefarable fix. Obviously the error seam to be related to the 'blackdown-jdk' package in some way. Not sure how though as the compiler is pointed out as the bad guy!
Disabling 'ccache' here fixed the problem.
Disregard, it's back.
'USE="-java" emerge mod_php' did not help. Disabeling ccache did not help either. I have 4.3.1-r1 installed already, but want to reinstall due to mysql-update.
Maybe 4.3.2RC1 would fix this?
Like I mentioned, it dissapeared when I put the USE variable back to default. So I guess it has something to do with the USE variable, which could point to one of the configure options. If the configure is broken, it might get fixed in 4.3.2, but that's not the point. It might be a specific gentoo problem which could still be there in the next release.
Fails to build here as well with -java in use flags. As a side note, I ran a few tests just configuring it from it it's original source archive and it configures fine with the flags that get set from USE as well as the flags that are added in the ebuild. The ebuild is failing after 'fopencookie' when it checks 'struct tm' does this have any significance to you? checking for fopencookie... yes [ normally dies before or during next check ] checking whether struct tm is in sys/time.h or time.h... time.h
I'm having the same problem, even with _all_ USE flags off. I think this might have something to do with it. It's from the compile script: rm -f conftest* if test "$have_cookie_io_functions_t" = "yes" ; then cookie_io_functions_t=cookie_io_functions_t have_fopen_cookie=yes if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Configure seems to see gcc as a cross compiler (no matter what CFLAGS are set) so it fails every time. At least I think that's what's happening. I'm rather new to this stuff.
After many attempts I was able to get mod_php to build although not by using emerge. Oddly enough I edited the ebuild file so that it would echo the value of myconf and the configure command line. Then I simply exported the myconf value and issued the configure and make commands. This compiled producing a suitable libphp4.so file. Using emerge still always results in the "configure: error: can not run test program while cross compiling" error. I guess this suggests some sort of environment issue but then again I don't know what I'm talking about. One more note. I always seem to get the following error when compiling with SSL, Flash or IMAP support. "the use of `tmpnam' is dangerous, better use `mkstemp'"
Did the same here. This is a definate environment issue. If it builds the old fashioned way, it should build with ebuild. In the meantime I need to restore 2 web servers that wont come back because of the last set up updates. Could this have anything to do with the latest base-layout? Off to work and hoping for a fix. -P
#2 Tyler Kemp That's - seemingly - not a JAVA problem - setting USE='-qt ...' fixed the problem in both 4.3.1 and 4.3.1-r1 for me.
I've had -qt in my make.comf from the start (this /is/ a server). Might I see your use flags and compare to mine so that we might be able to nip this in the bud? -P
One thing I've noticed is at the top of the output: checking whether the C compiler (gcc -march=pentium3 -O3 -pipe ) is a cross-compiler... yes That's odd...hmm...
OK, so this traces backto libwww which wants mysql 3. The ebuild specifies it. When php is running it's checks, it uses libxmlparse.so which is linked to the previous mysql installation: [ from config.log ] /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/../../../../i686-pc-linux-gnu/bin/ld: warning: libmysqlclient.so.10, needed by /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/../../../libxmlparse.so, not found (try using -rpath or -rpath-link) [ end ] I did not rebuild libwww since it wanted to install mysql 3. Changing the libwww ebuild to utilize mysql4 and re-building it appears to solve the problem. [ line 21 of libwww ebuild ] original: mysql? ( >=dev-db/mysql-3.23.26 ) new: mysql? ( >=dev-db/mysql-4.0.12 ) [ end ] Next, re-starting the ebuild for mod_php. All goes smooth. This is a libwww issue. You can either change the ebuild as I did or add -libwww to your use flags (not tested). -P
re-emerging libwww did help indeed. But you don't need to change the libwww-ebuild since "mysql? ( >=dev-db/mysql-3.23.26 )" includes mysql 4.x - it's >= 3, not <4!
alright so this isn't a php bug, its a libwww bug...and it isn't REALLY a libwww bug, its a consequence of the mysql bump... i think bumping libwww will likely fix this...make sure nothing else wnats to install mysql 3
> But you don't need to change the libwww-ebuild since "mysql? ( > >=dev-db/mysql-3.23.26 > " includes mysql 4.x - it's >= 3, not <4! At the time (before the sync) it was needed. Good to see this problem out of the way. Thanks for all the help. -P
Ok, great to see this solved. Thanks for your time everyone.
On a final note: re-emerging libwww solved the bug for me.
I'm having the same problem. I'm a little confused about all the steps you need to fix this as suggested in the thread. I tried: emerge sync emerge libwww emerge mysql emerge apache mod_php and this didn't work for me. Can someone detail all the steps you need to take? Thanks.
Micheal: please do these in THIS order: 1. emerge mysql this should get you up to mysql v4. DO follow the ewarn message at the end to see what on your system needs to be rebuilt, i'm 99.9% certain libwww will be on the list. Could you please post up the results that the rebuilder scripts shows you as well? so rebuild all the stuff on that list I recommend looking at the list yourself and ordering it better for depencanies (eg libwww needs to be done early). then you should be able to build PHP. sethbc: is the version bump on libwww still warranted ? either way I think this bug is mostly resolved now.
Nope. I took the following steps and this did not solve the problem. emerge rsync emerge --update world emerge mysql (also tried) emerge /usr/portage/dev-db/mysql/mysql-4.0.12.ebuild ( no warnings were reported at the end ) ( I did try /usr/portage/dev-db/mysql/files/rebuild.sh) emerge libwww emerge apache mod_php -- this and various combinations of the above failed to solve the issue.
what was the output of /usr/portage/dev-db/mysql/files/rebuild.sh ? if you know how, could you manually use ebuild to unpack the mod_php, and edit the configure script. Put in a 'printenv' command with a redirect to a file. then use ebuild to compile that so it dumps the output we want. then send me both those sets of output.
rebuild.sh seems to perform no useful work. I only get the following error msg repeated over and over: ./rebuilder.sh: line 20: qpkg: command not found There are no ebuilds for qpkg. I have no idea what it is/does. Here is a dump of my env after mysql compilation, I'm not sure if this is what you asked for but here it goes anyway: MANPATH=/usr/share/man:/usr/local/share/man:/usr/share/gcc-data/i686-pc-linux-gnu/3.2/man:/usr/X11R6/man:/opt/blackdown-jdk-1.3.1/man INFODIR=/usr/share/info:/usr/X11R6/info KDE_MULTIHEAD=false HOSTNAME=localhost TERM=xterm SHELL=/bin/bash XDM_MANAGED=/var/run/xdmctl/xdmctl-:0,maysd,mayfn,sched GTK_RC_FILES=/etc/gtk/gtkrc:/root/.gtkrc:/root/.gtkrc-kde GS_LIB=/root/.kde/share/fonts QTDIR=/usr/qt/3 OLDPWD=/usr/portage/dev-db/mysql USER=root KDEDIR=/usr/kde/3.1 SESSION_MANAGER=local/localhost:/tmp/.ICE-unix/5839 PAGER=/usr/bin/less XINITRC=/etc/X11/xinit/xinitrc KONSOLE_DCOP=DCOPRef(konsole-5857,konsole) PATH=/usr/kde/3.1/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.2:/usr/X11R6/bin:/opt/blackdown-jdk-1.3.1/bin:/opt/blackdown-jdk-1.3.1/jre/bin:/usr/qt/3/bin:/usr/kde/3.1/sbin:/usr/kde/3.1/bin KONSOLE_DCOP_SESSION=DCOPRef(konsole-5857,session-1) PWD=/usr/portage/dev-db/mysql/files INPUTRC=/etc/inputrc JAVA_HOME=/opt/blackdown-jdk-1.3.1 EDITOR=/bin/nano JAVAC=/opt/blackdown-jdk-1.3.1/bin/javac QMAKESPEC=linux-g++ KDEDIRS=/usr PS1=\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\] CXX=g++ HOME=/root SHLVL=3 JDK_HOME=/opt/blackdown-jdk-1.3.1 LOGNAME=root CVS_RSH=ssh CLASSPATH=/opt/blackdown-jdk-1.3.1/jre/lib/rt.jar:. LESSOPEN=|lesspipe.sh %s INFOPATH=/usr/share/info:/usr/share/gcc-data/i686-pc-linux-gnu/3.2/info DISPLAY=:0 CC=gcc XSESSION=kde-3.1.1 CONFIG_PROTECT=/var/bind:/usr/X11R6/lib/X11/xkb:/usr/kde/3.1/share/config:/usr/share/config COLORTERM=
hmm thanks for that note about qpkg qpkg is in app-admin/gentoolkit I'm going to fix the rebuilder script. Ok, here are some more detailed instructions for you: P=mod_php-4.3.1-r1 E=/usr/portage/dev-php/mod_php/$P.ebuild ebuild $E unpack cd /var/tmp/portage/$P/work/php-4.3.1 now open the configure file on the second line (it should be blank) add in: printenv >env.out echo "$*" >opt.out save the file, then run: ebuild $E compile it should stop again at the same place as before, and now in your current directory (/var/tmp/portage/$P/work/php-4.3.1), please get env.out and opt.out, and post them up as attachments here. Could you please also include your 'emerge info' output?
Created attachment 10355 [details] Results from failed emerge contains emerge.info env.out opt.out from failed mod_php emerge
The files are included my last post. file name is: results.tar.gz Let me know if everything is ko.
I ended up fixing this problem by: adding: -qt -java removing: mysql libwww from USE="" in /etc/make.conf
Hmm, I can't see why that fixed the problem. Could you play with those 4 flags and see if you can narrow it down? in particular, try it with these three?: -qt java mysql libwww qt java mysql -libwww qt -java mysql libwww
Which version(s) of MySQL are installed on the system? When I had to update libwww the ebuild wanted version 3 when version 4 was installed. After I changed the ebuild for libwww it built without building MySQL 3. I'm not seeing ACCEPT_KEYWORDS in the output of 'emerge info' could this be the problem? Maybe there are mixed libs. Try finding out which version(s) of MySQL are installed: /usr/lib/portage/bin/pkglist | grep -i mysql If there are more than 1 maybe that is causing grief. Try removing version 3 if it is there (if you ran the rebuild script after upgrading to 4 the system should be OK). php is trying to run libwww-config and libwww-config is linked against MySQL 3. It dies. Try running libwww-config from your command line and see if it errors complaining about libmysql. If it does, then libwww is not built against MySQL 4. Confused? Sorry, exploring the options.
There is also the config.log file in /var/tmp/portage/mod_php-4.3.1-r1/ cd /var/tmp/portage/mod_php-4.3.1-r1/ find . -iname *.log This is were I was able to figure out what was failing.
I've been struggling with this problem too. I did an "emerge --emptytree gallery" (gallery depends on mod_php, but that didn't help. Then I added apache2 to my use variables, re-emerged apache, and was able to emerge mod_php & gallery. -- Stephen Here's my info: # emerge --info Portage 2.0.47-r10 (default-x86-1.4, gcc-3.2.2, glibc-2.3.2-r1) ================================================================= System uname: 2.4.20 i686 Pentium III (Coppermine) GENTOO_MIRRORS="http://gentoo.oregonstate.edu/ http://distro.ibiblio.org/pub/Linux/distributions/gentoo" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" PORTDIR="/usr/portage" DISTDIR="/usr/portage/distfiles" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR_OVERLAY="/usr/local/portage" USE="x86 oss 3dnow encode libg++ mikmod nls xml2 xmms xv berkdb X sdl libwww gphoto2 alsa apache2 apm arts atlas avi cdr crypt cups doc -esd gd gdbm ggi gif -gnome gpm -gtk -gtk2 -gtkhtml imlib java jpeg kde maildir mmx motif mozilla mpeg mysql ncurses oav odbc oggvorbis opengl pam pda pdflib perl plotutils png python qt quicktime readline samba slang spell sse ssl svga tcltk tcpd tetex tiff truetype zeo zlib" COMPILER="gcc3" CHOST="i686-pc-linux-gnu" CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer" CXXFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer" ACCEPT_KEYWORDS="x86 ~x86" MAKEOPTS="-j2" AUTOCLEAN="yes" SYNC="rsync://rsync.gentoo.org/gentoo-portage" FEATURES="sandbox distcc ccache"
Ok, I've figured this out roughly. In some cases, the PHP configure script builds a list of options for GCC that cause it to throw an error. The configure script doesn't detect this properly, and only catches it when it's doing the cross-compiler check. Could somebody that still has the problem please post a note here so I can contact them to test the theory?
I tried to emerge libwww as suggested. The emerge failed (see bug #18470). So, following that, I unmerged 9libs. Then libwww merge succeeded. Then mod_php built without any message. I don't understand why 9libs is playing with /usr/include/libc.h. (According to the comment in bug #18470, this is causing a problem. It seems like it could be causing a problem to me, too, but I'm new to this.) Is this making configure think this is a cross-compile? (Just a WAG. I'm just starting to learn about all the interrelationships in the build process.)
Re: My first comment #36: I wrote too soon. After following the steps in #36, I got past the crosscompiler error. However, I then got the error in comment #2 ("cannot create executables"). Then I prepended USE="-java -qt" and the emerge went all the way through. Now I have to see if it will run!
Fixed in new PHP eclass to be released very soon. When it is, please test it ASAP.
*** Bug 24608 has been marked as a duplicate of this bug. ***
closing old bugs.
I ran into this bug today. I had to emerge the latest libwww to get the mod_php ebuild to realize I wasn't cross-compiling.