This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Problem with linking to shared native library
- From: Andreas Bürgel <Andreas dot Buergel at web dot de>
- To: java at gcc dot gnu dot org
- Date: Fri, 09 Mar 2007 00:04:12 +0100
- Subject: Re: Problem with linking to shared native library
- References: <45EC82D5.70606@web.de> <17901.20385.210904.673119@zebedee.pink>
- Reply-to: mail at andreas-buergel dot de
Andrew Haley schrieb:
Hi Andrew, thank you.
> > My platform:
> > - gcj version: 4.1.2 20061115
> > - binutils version: 2.17.50.0.5 20060927
> > - OS: openSUSE 10.2, Linux kernel 2.6.18.2-34-default
> > - glibc version: 2.5 (20061011)
>
> First thing:
>
> gcj -shared -o"libSimpleCPPLib.so" ./SimpleCPPLib.o
> /usr/bin/ld: ./SimpleCPPLib.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
> ./SimpleCPPLib.o: could not read symbols: Bad value
I cannot reproduce this error message.
> /tmp/foo
> mkdir -p Debug/resource
> gcj -O0 -g "--classpath=./:" -c de/dbt/simplelibclient/SimpleCPPLib.java -o de/dbt/simplelibclient/SimpleCPPLib.o
> de/dbt/simplelibclient/SimpleCPPLib.java:3: warning: The import de.dbt.simplelibclient is never used
> import de.dbt.simplelibclient.*;
> ^^^^^^^^^^^^^^^^^^^^^^
> 1 problem (1 warning)
> gcj -O0 -g --main=de.dbt.simplelibclient.SimpleCPPLib de/dbt/simplelibclient/SimpleCPPLib.o -oDebug/SimpleLibClient -LDebug -L/home/andreas/develop/projects/SimpleCPPLib/Debug -L../SimpleCPPLib/Debug -lSimpleCPPLib -lgcj
> /tmp/foo
I also don't get this warning, even when using "-Wall".
My linker error is persistent.
In the meantime I built gcc/gcj from the 4.1.2 release sources and binutils from
the 2.17 release sources and I'm using them now, but the linker error is still
there.
What versions do you use?
--
Mit freundlichen Grueszen, / With kind regards,
Andreas Bürgel
Diplom-Informatiker (Ingenieur-Informatik)
Software-Engineer/-Architect
http://www.andreas-buergel.de/profile.html
Unbedingt lesenswerte Site:
http://www.nachdenkseiten.de
Entia non sunt multiplicanda sine necessitate.
-- William of Ockham