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]

static linking and System.loadLibrary()


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.


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