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: GCJ and C++ (calling Java from C++)


Lothar Werzinger writes:
 > On Thursday 08 December 2005 09:37, Andrew Haley wrote:
 > > OK, I found the problem, and it's a weird one.
 > >
 > > Basically, calling code linked -Bsymbolic from non-PIC code is
 > > impossible.  An explanation is attached.
 > >
 > > I can make your test run by compiling absolutely *everything*,
 > > including your executable, with -fPIC.  This causes
 > > org::eclipse::emf::examples::extlibrary::Library::class$ to be
 > > resolved in the library where it belongs instead of being copied to
 > > the executable.
 > >
 > > We need to add a note to this effect the CNI manual pages.
 > 
 > Great, thanks. I added -fPIC as you did and everything went fine.
 > I tried so many combinations with and without -findirect-dispatch and with and 
 > without -fjni which all had more problems. I never thought about the 
 > -Wl,-Bsymbolic -fPIC line which I copied from the classpath wiki where it 
 > expalins how to compile a native eclipse.

Fair enough.  It was a really weird bug, though.  There's no way that
anyone could have figured it out without actually attempting to build
your example.

There are some quite unpleasant complexities combining CNI with
-findirect-dispatch.  We do intend to make this much easier and
cleaner at some point in the future, but be aware that at the present
time you're sailing in uncharted waters.  It's quite likely that you
will have further problems.

Andrew.


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