This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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]

Cannot create 64 bits shared library on solaris 9


Hello,

I'm trying to create a shared library, but I get the following error from ld

>g++ -shared -Wl,-h,libdnode.so -L/usr/local/lib -R/usr/local/lib -lsocket -lnsl -lpthread -lrt -ldgms -lm -o libdnode.so Provider.o Dialogue.o Retrieval.o Enquiry.o UException.o Semaphore.o Interface.o traces.o
>ld: fatal: file Provider.o: wrong ELF class: ELFCLASS64
>ld: fatal: File processing errors. No output written to libdnode.so
>collect2: ld returned 1 exit status
>make: *** [libmapnode.so] Error 1


I have read there are 2 versions of ld, one for 32 bits and one for 64 bits. I suppose the 32 bits version is the one at /usr/ccs/bin and the 64 bits version is the one at /usr/ccs/bin/sparcv9. Anyway, the man page says that both can create 32 bits and 64 bits output (strange?).

The man page says that ld will look at the first object and will produce an output in 64 or 32 bits depending on this first object. So, my compilation should produce a 64 bits shared library.

My g++ is configured:
>Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.9/3.4.2/specs
>Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls
>Thread model: posix
>gcc version 3.4.2

This g++ will always use the ld from /usr/ccs/bin? I have tried to copy the ld executable from /usr/ccs/bin/sparcv9 to /usr/ccs/bin, but the error remains. So, I suppose it is not a problem of what ld version g++ uses.

At this point... I don't know what more to do. If anyone can tell me what to do or point me to any manual or something it will be very welcomed.


thanks
Miguel Angel




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