php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7091 Failure to compile using --with-java and kaffe 1.0.6
Submitted: 2000-10-08 16:03 UTC Modified: 2001-01-30 03:59 UTC
From: mnerone at idworld dot net Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.0.2 OS: RedHat Linux 7.0
Private report: No CVE-ID: None
 [2000-10-08 16:03 UTC] mnerone at idworld dot net
Using --with-java and kaffe 1.0.6, as provided on disc 2 with RedHat 7.0, here are the last few lines of my failed compile:

=========================================================
make[2]: Entering directory `/home/mnerone/work/php-4.0.2/ext/java'
make[3]: Entering directory `/home/mnerone/work/php-4.0.2/ext/java'
/bin/sh /home/mnerone/work/php-4.0.2/libtool --silent --mode=compile gcc  -I. -I/home/mnerone/work/php-4.0.2/ext/java -I/home/mnerone/work/php-4.0.2 -I/home/mnerone/work/php-4.0.2/main -I/usr/local/apache/include -I/home/mnerone/work/php-4.0.2/Zend -I/home/mnerone/work/php-4.0.2 -I/usr/include/mysql -I/home/mnerone/work/php-4.0.2/ext/xml/expat/xmltok -I/home/mnerone/work/php-4.0.2/ext/xml/expat/xmlparse -I/usr/include/kaffe -DXML_BYTE_ORDER=12 -g -O2 -DKAFFE '-DJAVALIB="/libkaffevm.so"' -c java.c && touch java.slo
/home/mnerone/work/php-4.0.2/build/shtool mkdir -p net/php
javac net/php/reflect.java
/usr/bin/jar cf php_java.jar net/php/*.class net/php/*.properties
net/php/*.class: no such file or directory
make[3]: *** [php_java.jar] Error 2
make[3]: Leaving directory `/home/mnerone/work/php-4.0.2/ext/java'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/mnerone/work/php-4.0.2/ext/java'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mnerone/work/php-4.0.2/ext'
make: *** [all-recursive] Error 1
=======================================================

The compilation bug is easily rectified by editing ext/java/Makefile and removing the line that reads:

@test ! -f reflect.class || mv reflect.class net/php # bug in KJC javac

Apparently, this was a work around for a bug in kaffe, but the bug in kaffe (at least in RedHat 7.0's dist) seems to be gone, and the workaround, in fact, BREAKS the compilation. A version check for kaffe may be needed to determine whether the workaround needs to be applied or not.

Hope this helps. I love PHP (but also Perl and Python, to be honest - I pretty much a big fan of any language beginning with a "P" :D).

Mike Nerone

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-09 11:59 UTC] mnerone at idworld dot net
Ok, got an update for ya:

javac is still not working correctly. I don't have the time to explore whether it is a problem with kaffe itself or RedHat has introduced a bug in their dist, but here it is:

The *old* javac "bug" (which ext/java/Makefile was attempting to work around) seems like it was probably that it would ignore the directory path given in the argument (at least if it found a file of the same name in the CWD). Well, now it seems to put in the CWD *twice* in the output file. Specifically, "javac net/php/reflect.java" created "net/php/net/php/reflect.class". (Perhaps RH had a patch to fix the original problem, and then kaffe fixed it, but RH's patch is still applied to, thereby fixing the bug *twice* - I'm just guessing). It seems to me that the simplest reliable way now is to get rid of the path issue completely by making javac always work in the CWD. I.e. remove these two lines from ext/java/Makefile:

javac net/php/reflect.java
@test ! -f reflect.class || mv reflect.class net/php # bug in KJC javac

and replace them simply with:

(cd net/php; javac reflect.java)

I think this will work no matter what buggy or non-buggy javac is being used.
 [2000-12-18 10:41 UTC] sniper@php.net
Is this still happening with latest snapshot from http://snaps.php.net/ ??

--Jani
 [2001-01-30 03:59 UTC] sniper@php.net
If problem persists with latest CVS snapshot please 
reopen this bug report.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 09:01:29 2024 UTC