This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the GCJ project. See the GCJ home page for more information.


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

Re: coolness



Jeff Sturm wrote:
> I would think an explicit call to foo::bar should be resolved at link
> time, or fail with an unresolved symbol.

That's right.

> What needs to work in gcj is Class.forName("...") which is scattered
> all over in most java code, including the Sun java.* classes, and
> most JDBC programs (consider how JDBC drivers are loaded
> dynamically).

Yes, this is an important feature.  For Class.forName to work right
now, you have to link every needed class into the final image.  This
is relatively straight forward to do with the GNU linker flag `-u'.

For instance, if you used Class.forName("gnu.gcj.test") in your code,
you might build your application like this:

gcj -o foo --main=foo foo.java -Wl,-u,_CL_Q33gnu3gcj4test

...where _CL_Q33gnu3gcj4test is the mangled symbol for gnu.gcj.test.

Hmmm, it seems like a more convenient compiler flag might be useful.

You are right though - dynamically locating and linking the compiled
code is the right way to go for many applications.

AG

-- 
Anthony Green                                               Cygnus Solutions
                                                       Sunnyvale, California