Re: when linking on Solaris 64bit shared object using cc, -m64 should be used

Bob Friesenhahn <[email protected]>
Newsgroups gmane.comp.gnu.libtool.patches
Message-ID <[email protected]>
On Mon, 9 Jun 2014, Petr Sumbera wrote:

> Hi,
>
> I'm often getting following error:
>
> /usr/apr/1.5/build/sparcv9/libtool --silent --mode=link cc -o mod_dtrace.la
> -rpath /usr/apache2/2.2/libexec/sparcv9 -module -avoid-version
> mod_dtrace.lo
> ld: fatal: file .libs/mod_dtrace.o: wrong ELF class: ELFCLASS64
> apxs:Error: Command failed with rc=131072
>
> Attached patch fixes the issue.

Normally such options should already be included in CFLAGS (or 
sometimes works better in CC).  All of the software needs to be 
compiled with the same -m64 option.

When compiling using the Sun compiler and targeting 64-bits, I 
configure using something like

   ./configure 'CC=/opt/SUNWspro/bin/cc -m64' ...

Libtool is not multilib capable under Solaris.  That is, it does not 
automatically install a library into an architecture-specific 
subdirectory or search there either.  You might notice that the system 
does support different directories (e.g. '/lib/32', '/lib/64', 
'/lib/amd64') and GCC is multilib capable, putting its own 64-bit 
libraries in an architecture-specific subdirectory.

For my own 64-bit compiles under Solaris, I use a different 
installation prefix in order to make sure that 32-bit and 64-bit 
libraries/includes are sane.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.