Some observations on developing with gcj
Jeff Sturm
jsturm@one-point.com
Tue Jul 1 02:33:00 GMT 2003
On 30 Jun 2003, Mark Wielaard wrote:
> > Does it still fail if you link with a static libgcj.a and libc DSO? I've
> > been using that as a workaround until libgcj has a stable ABI.
>> Interesting idea. But how do I actually produce such a binary?
I wish it were easier! The quick-and-dirty way is to remove
prefix/lib/libgcj.so before you link.
Otherwise experiment with -Bstatic/-Bdynamic, roughly:
GCJ = gcj
JVGENMAIN = /opt/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.5-tree-ssa/jvgenmain
%.o: %.java
$(GCJ) $(GCJFLAGS) -c $< -o $@
Hello: Hello.o Hello_main.o
gcc -shared-libgcc Hello.o Hello_main.o -o Hello \
-Wl,-Bstatic -lgcj -Wl,-Bdynamic -lm -lpthread -ldl
Hello.o: Hello.java
Hello_main.o: Hello_main.c
Hello_main.c:
$(JVGENMAIN) Hellomain $@
More information about the Java
mailing list