From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6998 invoked by alias); 12 Nov 2009 17:12:14 -0000 Received: (qmail 6985 invoked by uid 22791); 12 Nov 2009 17:12:11 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Nov 2009 17:12:03 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nACHC0c7031364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 12 Nov 2009 12:12:00 -0500 Received: from zebedee.pink (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nACHBwjg024417; Thu, 12 Nov 2009 12:11:59 -0500 Message-ID: <4AFC41DD.9030601@redhat.com> Date: Thu, 12 Nov 2009 17:12:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: Jack Howarth CC: java@gcc.gnu.org Subject: Re: building gcc against eclipse? References: <20091110010553.GA32119@bromo.med.uc.edu> <4AF939BD.3040301@redhat.com> <20091112165329.GA7454@bromo.med.uc.edu> In-Reply-To: <20091112165329.GA7454@bromo.med.uc.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00025.txt.bz2 Jack Howarth wrote: > On Tue, Nov 10, 2009 at 10:00:29AM +0000, Andrew Haley wrote: >> Jack Howarth wrote: >>> In fink, we have been building the gcj ecj1 support by >>> copying the ecj-latest.jar file from ftp://sourceware.org/pub/java >>> into the top level of the gcc source directory. I would like to try >>> building gcc on darwin with the eclipse compiler instead. We have >>> a fink ecj package which provides... >>> >>> /. >>> /sw >>> /sw/bin >>> /sw/bin/ecj >>> /sw/share >>> /sw/share/doc >>> /sw/share/doc/ecj >>> /sw/share/doc/ecj/about.html >>> /sw/share/java >>> /sw/share/java/ecj >>> /sw/share/java/ecj/ecj.jar >>> >>> How exactly does one build the gcj against this ecj compiler? Would >>> creating a symlink in the toplevel gcc directory to >>> /sw/share/java/ecj/ecj.jar be sufficient to cause the installed >>> eclipse compiler to be used for ecj1? >> We configure for Fedora with --with-ecj-jar=/usr/share/java/eclipse-ecj.jar >> You don't have to copy that jar into the toplev of srcdir. > Would there be any possible differences in the code execution of gcj when built > with the stock ftp://sourceware.org/pub/java/ecj-latest.jar compared to the ecj.jar > from eclipse? My initial attempts at building a usable gcj with eclipse's ecj.jar > failed due to undefined symbols for org.eclipse.jdt.internal.compiler.batch.GCCMain > at runtime for ecj1. You mean the class org.eclipse.jdt.internal.compiler.batch.GCCMain is missing, I guess? > I noticed that the fedora 12 gcc specfile at... > > http://cvs.fedoraproject.org/viewvc/rpms/gcc/F-12/gcc.spec?revision=1.90&view=markup > > has a section... > > %if %{build_java} > %if !%{bootstrap_java} > # If we don't have gjavah in $PATH, try to build it with the old gij > mkdir java_hacks > cd java_hacks > cp -a ../../libjava/classpath/tools/external external > mkdir -p gnu/classpath/tools > cp -a ../../libjava/classpath/tools/gnu/classpath/tools/{common,javah,getopt} gnu/classpath/tools/ > cp -a ../../libjava/classpath/tools/resource/gnu/classpath/tools/common/Messages.properties gnu/classpath/tools/common > cp -a ../../libjava/classpath/tools/resource/gnu/classpath/tools/getopt/Messages.properties gnu/classpath/tools/getopt > cd external/asm; for i in `find . -name \*.java`; do gcj --encoding ISO-8859-1 -C $i -I.; done; cd ../.. > for i in `find gnu -name \*.java`; do gcj -C $i -I. -Iexternal/asm/; done > gcj -findirect-dispatch -O2 -fmain=gnu.classpath.tools.javah.Main -I. -Iexternal/asm/ `find . -name \*.class` -o gjavah.r > eal > cat > gjavah < #!/bin/sh > export CLASSPATH=`pwd`${CLASSPATH:+:$CLASSPATH} > exec `pwd`/gjavah.real "\$@" > EOF > chmod +x `pwd`/gjavah > cat > ecj1 < #!/bin/sh > exec gij -cp /usr/share/java/eclipse-ecj.jar org.eclipse.jdt.internal.compiler.batch.GCCMain "\$@" > EOF > chmod +x `pwd`/ecj1 > export PATH=`pwd`${PATH:+:$PATH} > cd .. > %endif > %endif > > This would be difficult to implement in fink for darwin since we don't have legacy gij/gcj compiler to > leverage from the system compilers. Is there another way to get around the issue of the undefined > org.eclipse.jdt.internal.compiler.batch.GCCMain symbol in ejc1 when using the ecj.jar from eclipse? Sure. Just put the file GCCMain.class in someDirectory, and run ecj1 as #!/bin/sh exec gij -cp someDirectory:/usr/share/java/eclipse-ecj.jar org.eclipse.jdt.internal.compiler.batch.GCCMain "\$@" Andrew.