static linking and System.loadLibrary()

Anthony Green green@redhat.com
Fri Oct 17 16:24:00 GMT 2003


I was just helping somebody build a statically linked gcj app. The app
uses SWT, and, of course, JNI for the gtk interface. We linked in the
JNI code with --whole-archive, and hacked the SWT sources so they don't
call System.loadLibrary to load them. As we were doing this, we thought
it would be useful if there was some way to tell the system what runtime
libraries are pre-loaded into the executable at link-time. We wouldn't
have to hack the SWT sources if this were possible.
One idea is to list the pre-loaded libraries at linktime as a system
property (ie. gcj -Dgcj.preload=lib-swt-pi-2155:lib-swt-2155). Any
objections to adding a feature like this? Any words of caution?
AG
-- 
Anthony Green <green@redhat.com>
Red Hat, Inc.


More information about the Java mailing list

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