This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: GCJ Build Problem (CVS)
- To: Jeff Sturm <jsturm at one-point dot com>,Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Subject: Re: GCJ Build Problem (CVS)
- From: Brad Cox <bcox at virtualschool dot edu>
- Date: Sat, 10 Nov 2001 12:10:06 -0500
- Cc: java at gcc dot gnu dot org
On Saturday, November 10, 2001, at 09:00 AM, Brad Cox wrote:
> Sounds likely. Trying that now. Its trying to drain an ada ocean through
> my soda straw modem as we speak. So it goes. Stay tuned.
PROGRESS!! gcj built! Thanks for the help!! cvs update -d did the trick.
Only problem was the time it took to drag in ada stuff I'll never use.
A quick start README to help other first timers get this far might help to
cut down questions like these on the list. I could post the one I've been
writing while the bruises are fresh. Please say if there's interest.
But I'm still hitting snags. The first is I haven't yet figured out the
switches to make jikes style all at once compiles (gcj *.java) generate an
archive. So I fell back to the following, which seems to work.
SRC=\
filenames.java \
...snip...
BIN=$(shell echo $(SRC) | sed -e 's/\.java/\.o/g' )
CP=/mybank/WEB-INF/lib/activation.jar:/mybank/WEB-INF/lib/gnu-regexp-1.0.8.
jar:/mybank/WEB-INF/lib/junit.jar:/mybank/WEB-
INF/lib/mm.mysql-2.0.6.jar:/mybank/WEB-INF/lib/servlet.jar:/mybank/WEB-INF/
lib/mail.jar:/mybank/WEB-INF/lib/jwaa.jar
GCJ=export CLASSPATH=$(CP) && /usr/local/gcc31/bin/gcj -v
%.o: %.java
@echo Compiling $<
@$(GCJ) -c -o $@ $<
test: checkbook.a Test.o
$(GCJ) --main=Test Test.o
a.out
main: checkbook.a
$(GCJ) --main=dom.mybank.ui.ConsoleView checkbook.a
checkbook.a: $(BIN)
ar rs checkbook.a $(BIN)
This leads to the following confusing messages. Consider relinking WHAT?
My application? GCJ? (hope not, that's PAINFUL). Some shared library?
Which one?
[bcox@linux gcj]$ make
export CLASSPATH=/mybank/WEB-INF/lib/activation.jar:/mybank/WEB-
INF/lib/gnu-regexp-1.0.8.jar:/mybank/WEB-INF/lib/junit.jar:/mybank/WEB-INF/
lib/mm.mysql-2.0.6.jar:/mybank/WEB-INF/lib/servlet.jar:/mybank/WEB-INF/lib/
mail.jar:/mybank/WEB-INF/lib/jwaa.jar && /usr/local/gcc31/bin/gcj -v
--main=Test Test.o
Reading specs from /usr/local/gcc31/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Reading specs from /usr/local/gcc31/lib/gcc-lib/i686-pc-linux-
gnu/3.1/../../../libgcj.spec
rename spec lib to liborig
Configured with: ../src/configure --enable-threads=posix
--prefix=/usr/local/gcc31 --enable-shared --enable-languages=c++,java,objc
Thread model: posix
gcc version 3.1 20011110 (experimental)
/usr/local/gcc31/lib/gcc-lib/i686-pc-linux-gnu/3.1/jvgenmain Test
/tmp/ccEvaIHYmain.i
/usr/local/gcc31/lib/gcc-lib/i686-pc-linux-gnu/3.1/cc1 /tmp/ccEvaIHYmain.
i -quiet -dumpbase Test.c -g1 -version -fdollars-in-identifiers -o
/tmp/cccP0LdPmain.s
GNU CPP version 3.1 20011110 (experimental) (cpplib) (i386 Linux/ELF)
GNU C version 3.1 20011110 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
.
as --traditional-format -V -Qy -o /tmp/cckhuyfImain.o /tmp/cccP0LdPmain.s
GNU assembler version 2.10.90 (i386-redhat-linux) using BFD version 2.10.0.
18
/usr/local/gcc31/lib/gcc-lib/i686-pc-linux-gnu/3.1/collect2 -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o
/usr/local/gcc31/lib/gcc-lib/i686-pc-linux-gnu/3.1/crtbegin.o -L/usr/local/
gcc31/lib/gcc-lib/i686-pc-linux-gnu/3.1 -L/usr/local/gcc31/lib/gcc-
lib/i686-pc-linux-gnu/3.1/../../.. /tmp/cckhuyfImain.o Test.o -lgcc_s
-lgcc -lgcj -lm -lgcjgc -lpthread -lzgcj -ldl -lgcc_s -lgcc -lc -lgcc_s
-lgcc /usr/local/gcc31/lib/gcc-lib/i686-pc-linux-gnu/3.1/crtend.o /usr/lib/
crtn.o
a.out
a.out: Symbol `_ZN4java4lang12StringBuffer6class$E' has different size in
shared object, consider re-linking
a.out: Symbol `_ZN4java4lang6System6class$E' has different size in shared
object, consider re-linking
a.out: Symbol `_ZN4java4lang6Object6class$E' has different size in shared
object, consider re-linking
a.out: Symbol `_ZN4java4lang9Throwable6class$E' has different size in
shared object, consider re-linking
a.out: Symbol `_ZN4java8security12SecureRandom6class$E' has different size
in shared object, consider re-linking
make: *** [test] Segmentation fault (core dumped)
[bcox@linux gcj]$
Here's the integrated gcj src/build/deploy directory structure I'm using,
which I propose to document in the proposed quick start README mentioned
below:
[bcox@linux gcj]$ d /usr/local/gcc31/
total 11
-rw-r--r-- 1 bcox wheel 384 Nov 10 10:58 README
drwxr-xr-x 2 bcox wheel 1024 Nov 10 10:45 bin
drwxr-xr-x 9 bcox wheel 1024 Nov 10 09:19 build
-rw-r--r-- 1 bcox wheel 115 Nov 9 19:10 build.sh
drwxr-xr-x 7 bcox sdi 1024 May 11 2001 dox
drwxr-xr-x 8 bcox wheel 1024 Nov 10 10:47 include
drwxr-xr-x 2 bcox wheel 1024 Nov 10 10:43 info
drwxr-xr-x 4 bcox wheel 1024 Nov 10 10:47 lib
drwxr-xr-x 3 bcox wheel 1024 Nov 10 10:42 man
drwxr-xr-x 3 bcox wheel 1024 Nov 10 10:46 share
drwxr-xr-x 25 bcox sdi 1024 Nov 9 21:10 src
Finally, the build directory is quite large. Is it advisable to make clean
in there at this point?
Oh yes, the "experimental" makes me wonder if I should be this close to
the bleeding edge. My real goal is only to compile a vanilla java
application to binary.