integer-gmp2 issues on Solaris/SPARC

Karel Gardas karel.gardas at centrum.cz
Sun Jan 18 14:42:05 UTC 2015


Hello Herbert,

I'm sorry to bother you, but recent GHC HEAD does have issue on 
Solaris/SPARC platform which shows as undefined symbols during the 
linkage of stage2 binaries. For example ghc-stage2 link step fails with:

Undefined                       first referenced
  symbol                             in file
__gmpn_andn_n 
/home/karel/src/ghc-sparc-reg_ncg-head-2015-01-17/libraries/integer-gmp2/dist-install/build/libHSinteg_21cuTlnn00eFNd4GMrxOMi.a(Type.o)
__gmpn_and_n 
/home/karel/src/ghc-sparc-reg_ncg-head-2015-01-17/libraries/integer-gmp2/dist-install/build/libHSinteg_21cuTlnn00eFNd4GMrxOMi.a(Type.o)
__gmpn_ior_n 
/home/karel/src/ghc-sparc-reg_ncg-head-2015-01-17/libraries/integer-gmp2/dist-install/build/libHSinteg_21cuTlnn00eFNd4GMrxOMi.a(Type.o)
__gmpn_xor_n 
/home/karel/src/ghc-sparc-reg_ncg-head-2015-01-17/libraries/integer-gmp2/dist-install/build/libHSinteg_21cuTlnn00eFNd4GMrxOMi.a(Type.o)
ld: fatal: symbol referencing errors. No output written to 
ghc/stage2/build/tmp/ghc-stage2


All binaries fail with the same set of unresolved symbols. I can tell 
you that I don't see this issue on Solaris/i386 nor on Solaris/amd64 
builds as you can verify here: http://haskell.inf.elte.hu/builders/

I'm talking here about exact Solaris 11.1 on SPARC and Solaris 11.1 on 
AMD64 box. Both Solarises provide the same version of libgmp:

$ uname -p
sparc
$ ls -la /usr/lib/libgmp.so*
lrwxrwxrwx   1 root     root          15 Feb 20  1999 /usr/lib/libgmp.so 
-> libgmp.so.3.5.2
lrwxrwxrwx   1 root     root          15 Feb 20  1999 
/usr/lib/libgmp.so.3 -> libgmp.so.3.5.2
-r-xr-xr-x   1 root     bin      1093328 Sep 19  2012 
/usr/lib/libgmp.so.3.5.2
$


$ uname -p
i386
$ ls -la /usr/lib/libgmp.so*
lrwxrwxrwx   1 root     root          15 Oct 18  2012 /usr/lib/libgmp.so 
-> libgmp.so.3.5.2
lrwxrwxrwx   1 root     root          15 Oct 18  2012 
/usr/lib/libgmp.so.3 -> libgmp.so.3.5.2
-r-xr-xr-x   1 root     bin       878276 Feb  5  2014 
/usr/lib/libgmp.so.3.5.2
$


And yet on i386/amd64 the symbol (one from the failing set as an 
example) __gmpn_andn_n is defined:

$ nm /usr/lib/libgmp.so|grep __gmpn_andn_n
[86]	|    375728|       101|FUNC |GLOB |0    |14     |__gmpn_andn_n

but on SPARC it's not:

$ nm /usr/lib/libgmp.so|grep __gmpn_andn_n
$


Do you have any magical knob which I can switch on to work around this 
issue by not needing those four symbols above?

Thanks!
Karel



More information about the ghc-devs mailing list