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++)


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.
>
> Andrew.

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.

Thanks for the good work!

Lothar
-- 
Lothar Werzinger Dipl.-Ing. Univ.
framework & platform architect
Tradescape Inc.
111 West St. John Street, Suite 200
San Jose, Ca 95113
email: lothar@tradescape.biz


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