This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
static linking and System.loadLibrary()
- From: Anthony Green <green at redhat dot com>
- To: java at gcc dot gnu dot org
- Date: 17 Oct 2003 12:24:15 -0400
- Subject: static linking and System.loadLibrary()
- Organization: Red Hat, Inc.
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.