Re: GCCMain not found & test suite errors fatal?

John Poole <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
On 1/3/2010 8:28 AM, Andrew Haley wrote:
> On 12/31/2009 05:17 PM, John Poole wrote:
>    
>> You wrote:
>>
>>      
>>>>   I suggest you grab ecj.jar and put it in install/share/java.  That
>>>>   should get you a fully working gcj.
>>>>          
>>
>> Thank you, Andrew, I had already tried to do so.
>>
>> Previously I learned the hard way about the ecj.jar issue, so I ran
>> the.../contrib/download_ecj script (which downloaded the ecj.jar from
>> the predefined site) to install the ecj.jar into the trunk directory, I
>> then ran the configuration again so the ecj.jar would be staged into my
>> target for "make ... install".
>>
>> In fact, I do have ecj.jar installed in my target tree: /usr/local/gcj.
>>
>> I even tried adding it to the include parameter and still get the same
>> result. Maybe I'm not using the correct parameter syntax??
>>
>> plug local # pwd
>> /usr/local/gcj/usr/local
>> plug local # find . -name '*ecj*.jar'
>> ./share/java/ecj.jar
>> plug local # export LD_LIBRARY_PATH=/usr/local/gcj/usr/local/lib
>> plug local #
>> plug local # ./bin/gcj  -I./lib/:./share/java/ecj.jar -c
>> /var/work/gcj/HelloWorld.java [B
>>      
> You don't want the -I part.
>
> I'd try stracing gcj to find out what's going on
>
>   $ strace -f -etrace=file gcj -c HelloWorld.java
>
> This will tell you where gcj is looking for its jarfiles.  Look for
> something like this:
>
> ...
> 547   execve("/home/aph/gcc/trunk/install/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/ecj1", ["/home/aph/gcc/trunk/install/libe"..., "Hello.java", "-g1", "-fbootclasspath=./:/home/aph/gcc"..., "-g1", "-fsource=1.5", "-ftarget=1.5", "-fzip-dependency", "/tmp/ccXyDB9d.zip", "-fzip-target", "/tmp/ccipPqBc.jar"], [/* 42 vars */]) = 0
> ...
> 547   stat("/home/aph/gcc/trunk/install/share/java/ecj.jar", {st_mode=S_IFREG|0644, st_size=1377431, ...}) = 0
> 547   open("/home/aph/gcc/trunk/install/share/java/ecj.jar", O_RDONLY) = 3
> ...
>
> Andrew.
>
>    
Perfect.

I followed your suggestion; installed strace and reran the revised 
command line.  The output can be referenced at http://pastebin.com/m7cb292d5

The definitive line is:

172.  [pid  6423] access("/usr/local/share/java/ecj.jar", F_OK) = -1 
ENOENT (No such file or directory)

See also lines 81,82 and 85.

Basically, the problem is that compiler was looking for ecj.jar under a 
fixed(?) /usr/local/share path instead of the path where I had custom 
installed: /usr/local/gcj;  moreover it should have been looking under 
the full path of /usr/local/gcj/usr/local/share/java.

To work-around the path problem, I copied the java directory and its 
contents (on my server, there was no java directory under /usr/share) as 
in the following:

   plug local # pwd
   /usr/local/gcj/usr/local
   plug local # ls share/java
   ecj.jar  libgcj-4.5.0.jar  libgcj-tools-4.5.0.jar
   plug local # cp share/java/* /usr/local/share/java
   plug local #
   plug local # strace -f -etrace=file bin/gcj -c 
/var/work/gcj/HelloWorld.java
   plug local #
   plug local # ls
   bin  HelloWorld.o  include  lib  libexec  share
   plug local #


My successful run is posted at http://pastebin.com/m74e42dc9
I have Bug 42409 pending and will update it with attachments and this 
conclusion.

Thank you, Andrew.

- John L. Poole
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.