
On 01/18/15 04:05 PM, Herbert Valerio Riedel wrote:
On 2015-01-18 at 15:42:05 +0100, Karel Gardas wrote:
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:
Btw, what GMP version is that exactly? "GMP 3.5.2" doesn't seem to be an official GMP release?
This is version 4.3.2 in both cases.
...does the
header differ?
Unfortunately not. The only difference is in CFLAGS: $ gdiff -u /usr/include/gmp/gmp.h /tmp/gmp.h --- /usr/include/gmp/gmp.h 2014-02-05 14:40:13.405522327 +0100 +++ /tmp/gmp.h 2015-01-19 08:35:38.146637514 +0100 @@ -2231,7 +2231,7 @@ /* Define CC and CFLAGS which were used to build this version of GMP */ #define __GMP_CC "/ws/on11update-tools/SUNWspro/sunstudio12.1/bin/cc" -#define __GMP_CFLAGS "-m64 -xO4 -xchip=generic -Ui386 -U__i386 -xregs=no%frameptr -mt -features=extinl,extensions -xustr=ascii_utf16_ushort -xcsi -xthreadvar=%all -D_STDC_99 -xc99=all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -D_XPG6 -KPIC -DPIC" +#define __GMP_CFLAGS "-m64 -xO4 -xtarget=ultra2 -xarch=sparcvis -xchip=ultra2 -Qoption cg -xregs=no%appl -W2,-xwrap_int -xmemalign=16s -mt -features=extinl,extensions -xustr=ascii_utf16_ushort -xcsi -xthreadvar=%all -D_STDC_99 -xc99=all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -D_XPG6 -KPIC -DPIC" /* Major version number is the value of __GNU_MP__ too, above and in mp.h. */ #define __GNU_MP_VERSION 4 Let me also add that the gmp.h file does not define mpn_andn_n symbol at all neither it declare __gmpn_andn_n function! Since both i386 and sparc gmp.h are the same this applies to both.
can you create a simple C program that calls the mpn_andn operation and compare how linkage differs?
No, I'm not able to use "mpn_andn" nor "mpn_andn_n". What I'm able to
use is "__gmpn_andn_n". On i386 this pass with implicitly declared
symbol warning:
gmp_test.c: In function ‘main’:
gmp_test.c:10:5: warning: implicit declaration of function ‘__gmpn_andn_n’
on sparc fails on linkage:
$ gcc -Wall gmp_test.c -lgmp
gmp_test.c: In function ‘main’:
gmp_test.c:10:5: warning: implicit declaration of function ‘__gmpn_andn_n’
Undefined first referenced
symbol in file
__gmpn_andn_n /var/tmp//ccSHaGtf.o
ld: fatal: symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
My testing program is:
$ cat gmp_test.c
#include