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: LibGCJ static linking trouble


On Thu, 16 Nov 2006, 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


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