LibGCJ static linking trouble

Thomas Womack twomack@globalphasing.com
Thu Nov 16 15:44:00 GMT 2006


On 2006年11月16日, Andrew Haley wrote:
> Thomas Womack writes:
>> > Using gcc instead of gcj for the final link has produced an executable
> > with no run-time dependency on libgcj, and reminded me to go and get my
> > eyeglass prescription checked, but I've now run into another problem:
>> It's the usual static linking problem: you're going to have to find
> out some way to force MessagesBundle.properties to be included in your
> executable or you'll have to provide a jar file so that it will be
> found at runtime. When compiling a jarfile, gcj's default behaviour
> is to include the resource files it finds, or you can use the
> --resource option.

That was surprisingly painless: add a couple of lines to the makefile
javalibs= ... \
 	 obj/MessagesBundleResource.o \
 ...
obj/MessagesBundleResource.o: /public/sw/gcc-4.1.1/gcc-4.1.1/libjava/classpath/resource/gnu/regexp/MessagesBundle.properties
 	$(GCJ) -c -o obj/MessagesBundleResource.o --resource gnu/regexp/MessagesBundle.properties $^
a quick re-make, and it appears to work at least in the case where it 
previously failed.
Many thanks for your quick reply and your immediate solution,
Thomas Womack


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /