From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32113 invoked by alias); 11 Jul 2003 02:06:34 -0000 Mailing-List: contact rhug-rhats-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: rhug-rhats-owner@sources.redhat.com Received: (qmail 32103 invoked from network); 11 Jul 2003 02:06:33 -0000 Received: from unknown (HELO gash2.peakpeak.com) (207.174.178.17) by sources.redhat.com with SMTP; 11 Jul 2003 02:06:33 -0000 Received: from fleche.redhat.com (tf0005.peakpeak.com [204.144.239.5]) by gash2.peakpeak.com (8.9.3/8.9.3.1) with ESMTP id UAA09676; Thu, 10 Jul 2003 20:06:31 -0600 Received: by fleche.redhat.com (Postfix, from userid 1000) id E62DC4F8353; Thu, 10 Jul 2003 19:57:29 -0600 (MDT) To: paul taney Cc: rhug-rhats@sources.redhat.com Subject: Re: compiling antlr with gcj References: <20030711010043.21059.qmail@web80603.mail.yahoo.com> From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom X-Zippy: I feel like I'm in a Toilet Bowl with a thumbtack in my forehead!! Date: Fri, 11 Jul 2003 02:06:00 -0000 In-Reply-To: <20030711010043.21059.qmail@web80603.mail.yahoo.com> Message-ID: <87fzldakqe.fsf@fleche.redhat.com> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-07/txt/msg00002.txt.bz2 >>>>> "paul" == paul taney writes: paul> Now the $CLASSPATH is paul> /usr/local/gcc/gcc-3.3/libjava:\ paul> /usr/local/gcc/gcc-3.3/build/i686-pc-linux-gnu/libjava:\ paul> /usr/local/gcc/gcc-3.3/libjava/java/lang:\ paul> /usr/local/java/j2sdk1.4.2:\ paul> /usr/local/java/j2sdk1.4.2/bin:\ paul> /usr/local/jython-2.1:. Let's talk about this a bit. Why do you have all these things in CLASSPATH? In general, don't put the JDK stuff in the class path. Second, you shouldn't need to tell gcj where to find the default classes -- it should find them by itself. If you really need to do something like this, point gcj at the installed libgcj-.jar file. It is in /share/java, where depends on how you configured gcc. paul> gcj --classpath $CLASSPATHGNU -o antlr.o --main=Tool \ paul> antlr/*.java \ paul> antlr/actions/cpp/*.java \ paul> antlr/actions/csharp/*.java \ paul> antlr/actions/java/*.java \ paul> antlr/build/*.java \ paul> antlr/collections/*.java \ paul> antlr/collections/impl/*.java \ paul> antlr/debug/*.java \ paul> antlr/preprocessor/*.java I recommend naming the output file "antlr" instead of "antlr.o". This shouldn't matter, but it is weird and a little confusing. Finally, gcj links with the libgcj.so library. Make sure you are linking against the right one. This is probably your problem. My guess is that, since you installed gcc in a non-standard location, the linker is finding the wrong libgcj. Link with "gcj -v" to see what is going on. I usually link like this: gcj -o foo ... -Wl,-rpath,/lib This is an ugly hack to make the resulting executable find the resulting libgcj.so at runtime. The gcc project made a decision not to have the compiler do this automatically; I don't remember why. Tom