This is the mail archive of the rhug-rhats@sources.redhat.com mailing list for the RHUG project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

compiling antlr with gcj


rhug-arhats,

This discussion is taking place on the antlr-interest
list.  A senior developer of antlr and I are engaged
in trying to compile antlr with gcj.  We have gotten
it to compile but are having link problems on
 
    Throwable.java

Could you please comment on the error we're getting?

We would appreciate it so much.  If you don't know,
antlr is an advanced parser generator at

    http://antlr.org

Sincerely,
paul

---<what follows is from antlr-interest@yahoo.com> ---

Loring,

I have put the --classpath back into the script
and added this to that path:

    /usr/local/gcc/gcc-3.3/libjava/java/lang

because that's were gcc's Throwable lives.  And 
added ".o" to the -o arg (because it complained 
that antlr was a dir).

Now the $CLASSPATH is
/usr/local/gcc/gcc-3.3/libjava:\
/usr/local/gcc/gcc-3.3/build/i686-pc-linux-gnu/libjava:\
/usr/local/gcc/gcc-3.3/libjava/java/lang:\
/usr/local/java/j2sdk1.4.2:\
/usr/local/java/j2sdk1.4.2/bin:\
/usr/local/jython-2.1:.

and the compile script is:

gcj --classpath $CLASSPATHGNU -o antlr.o --main=Tool \
         antlr/*.java \
         antlr/actions/cpp/*.java \
         antlr/actions/csharp/*.java \
         antlr/actions/java/*.java \
         antlr/build/*.java \
         antlr/collections/*.java \
         antlr/collections/impl/*.java \
         antlr/debug/*.java \
         antlr/preprocessor/*.java


Still we have:

/tmp/ccfeKrb0.o: In function
`antlr::ANTLRError::ANTLRError(void)':
/usr/local/antlr/antlr-2.7.2/antlr/ANTLRError.java(.data+0x44):
undefined reference to
`java::lang::Throwable::getCause(void)'
/usr/local/antlr/antlr-2.7.2/antlr/ANTLRError.java(.data+0x48):
undefined reference to
`java::lang::Throwable::initCause(java::lang::Throwable
*)'
/usr/local/antlr/antlr-2.7.2/antlr/ANTLRError.java(.data+0x5c):
undefined reference to
`java::lang::Throwable::getStackTrace(void)'
/usr/local/antlr/antlr-2.7.2/antlr/ANTLRError.java(.data+0x60):
undefined reference to
`java::lang::Throwable::setStackTrace(JArray<java::lang::StackTraceElement
*> *)'
<snip>

$ grep getCause $PATH/Throwable.java
  public Throwable getCause()
   * Then if <code>getCause()</code> doesn't return
null it adds a line
    Throwable cause = getCause();
        cause = cause.getCause();


Anybody have a clue?

paul


--- lgcraymer <lgc@mail1.jpl.nasa.gov> wrote:
> All--
> 
> Since Paul and I took this discussion offline (my
> role has been 
> mostly to interpret the compiler error messages
> while he does all the 
> real work), he has made some impressive progress. 
> After adding a few 
> type casts to the ANTLR source, all of ANTLR
> compiles and we appear to 
> be down to one link error--java.lang.Throwable
> methods cannot be 
> found.
> 
> At this point, our best guess is that this is fixed
> in the version of 
> gcj used by RHUG
> (<http://sources.redhat.com/rhug/>--they call for a 
> recent development snapshot) to get all of their
> Java projects to 
> compile (some of which are more demanding than
> ANTLR).  Unfortunately, 
> Paul is stuck with a slow connection and has a
> family emergency to 
> attend to, and I'm spending my spare time trying to
> prepare for this 
> weekend's discussions.  We won't be able to take the
> last small steps 
> for several days.  If anyone out there wants to
> produce an executable 
> sooner, you have our blessings.  I'll post his diffs
> and compilation 
> script (neither of us have yet looked into gcj
> makefiles) below.
> 
> --Loring
> 

<snip>



__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]