This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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]

Re: Some observations on developing with gcj


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 $@


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