bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Linking gmp-4.1.4 fails on Solaris 10/x86_64


From: Henrik Grubbström
Subject: Linking gmp-4.1.4 fails on Solaris 10/x86_64
Date: Sun, 22 May 2005 12:59:21 +0200 (CEST)

Configure for gmp 4.1.4 detects that the architecture is x86_64 and adds -m64 to CFLAGS as expected. The problem is that libtool doesn't pass -m64 along to gcc when linking, so it fails to link:

/bin/sh ./libtool --mode=link gcc -O2 -m64 -mtune=k8 -o libgmp.la -rpath /i/gmp/4.1.4/lib -version-info 6:3:3 assert.lo compat.lo errno.lo extract-dbl.lo insert-dbl.lo memory.lo mp_bpl.lo mp_clz_tab.lo mp_minv_tab.lo mp_set_fns.lo rand.lo randclr.lo randdef.lo randlc.lo randlc2s.lo randlc2x.lo randraw.lo rands.lo randsd.lo randsdui.lo version.lo mpf/init.lo mpf/init2.lo mpf/set.lo mpf/set_ui.lo mpf/set_si.lo mpf/set_str.lo mpf/set_d.lo mpf/set_z.lo
[...]
scanf/sscanf.lo scanf/sscanffuns.lo scanf/vfscanf.lo scanf/vscanf.lo scanf/vsscanf.lo gcc -shared -Wl,-h -Wl,libgmp.so.3 -o .libs/libgmp.so.3.3.3 .libs/assert.o .libs/compat.o .libs/errno.o .libs/extract-dbl.o .libs/insert-dbl.o .libs/memory.o .libs/mp_bpl.o .libs/mp_clz_tab.o .libs/mp_minv_tab.o .libs/mp_set_fns.o .libs/rand.o .libs/randclr.o .libs/randdef.o .libs/randlc.o .libs/randlc2s.o .libs/randlc2x.o .libs/randraw.o .libs/rands.o .libs/randsd.o .libs/randsdui.o .libs/version
[...]
funs.o scanf/.libs/scanf.o scanf/.libs/sscanf.o scanf/.libs/sscanffuns.o scanf/.libs/vfscanf.o scanf/.libs/vscanf.o scanf/.libs/vsscanf.o -lc
ld: fatal: file .libs/assert.o: wrong ELF class: ELFCLASS64
ld: fatal: File processing errors. No output written to .libs/libgmp.so.3.3.3
collect2: ld returned 1 exit status

Changing the option -m64 to -Wc,-m64 forces libtool to pass it through, and yields link without complaints.

The dynamic library as gernerated by /usr/sfw/bin/gcc does however not work, since it attempts to link against /usr/sfw/lib/libgcc_s.so.1:

 $ ldd .libs/libgmp.so
        libc.so.1 =>     /lib/64/libc.so.1
        libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1  - wrong ELF class: 
ELFCLASS32
        libm.so.2 =>     /lib/64/libm.so.2

This is probably a misconfiguration by Sun, but can be worked around by also adding a -Wc,-R/usr/sfw/lib/64 to ldflags.

With the two additions to ldflags a make check passes.

 $ uname -a
SunOS shipon.roxen.com 5.10 Generic i86pc i386 i86pc
 $ isainfo
amd64 i386
 $ ./config.guess
x86_64-pc-solaris2.10
 ./configfsf.guess
i386-pc-solaris2.10
 $ gcc --version
gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks,

--
Henrik Grubbström                                       address@hidden
Roxen Internet Software AB                              address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]