5.1.1: Test fail in t-aors_1 on Solaris x86 64bit w/ Sun Studio 12.3 compiler

Mark Ashley mark at ibiblio.org
Thu Jan 9 06:23:16 UTC 2014


The recipe:

    setenv CC "cc -m64"
    setenv CXX "CC -m64"
    setenv ABI 64
    setenv M4 /usr/local/bin/m4
    cd /var/tmp
    xz -dc /usr/local/src/gnu/gmp-5.1.1.tar.xz | gtar -xvf -
    cd gmp-5.1.1
    /bin/perl -pe 's#xarch=v9#m64#' -i configure

    ./configure --prefix=/usr/local \
        --build=x86_64-pc-solaris2.11 \
        --host=x86_64-pc-solaris2.11 \
        host_cpu=x86_64 \
        host=x86_64-pc-solaris2.11 \
        gmp_cv_c_attribute_mode=no

    /bin/perl -pe 's#^CFLAGS = .*#CFLAGS = -m64 -DDBUG_OFF #' -i
mpn/Makefile

    gmake
    gmake check

configure: summary of build options:

  Version:           GNU MP 5.1.1
  Host type:         x86_64-pc-solaris2.11
  ABI:               64
  Install prefix:    /gmp
  Compiler:          cc -m64
  Static libraries:  yes
  Shared libraries:  yes

It all works well except for the one test:

gmake[4]: Entering directory `/var/tmp/gmp-5.1.1/tests/mpn'
PASS: t-asmtype
ld.so.1: t-aors_1: fatal: relocation error: R_AMD64_PC32: file
/var/tmp/gmp-5.1.1/.libs/libgmp.so.10: symbol __gmpn_add_1: value
0x7f004fabb669 does not fit
/bin/sh: line 10: 7252: Killed
FAIL: t-aors_1
PASS: t-divrem_1

1 of 43 tests failed

They seem to be PIC files:

Making all in mpn
gmake[2]: Entering directory `/var/tmp/gmp-5.1.1/mpn'
/bin/sh ../libtool --tag=CC   --mode=compile cc -m64 -DHAVE_CONFIG_H -I.
-I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo add_1 | sed 's/_$//'`
-I/usr/local/include  -m64 -DDBUG_OFF  -c -o add_1.lo add_1.c
libtool: compile:  cc -m64 -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I..
-DOPERATION_add_1 -I/usr/local/include -m64 -DDBUG_OFF -c add_1.c  -KPIC
-DPIC -o .libs/add_1.o
libtool: compile:  cc -m64 -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I..
-DOPERATION_add_1 -I/usr/local/include -m64 -DDBUG_OFF -c add_1.c -o
add_1.o >/dev/null 2>&1

build11i64:/var/tmp/gmp-5.1.1/tests/mpn root# file *.o
logic.o:        ELF 64-bit LSB relocatable AMD64 Version 1 [SSE2 CMOV]
t-aors_1.o:     ELF 64-bit LSB relocatable AMD64 Version 1 [SSE2 SSE CMOV]
t-asmtype.o:    ELF 64-bit LSB relocatable AMD64 Version 1
t-bdiv.o:       ELF 64-bit LSB relocatable AMD64 Version 1 [SSE2 SSE CMOV]

The simple cause is the -DDBUG_OFF on CFLAGS, I haven't dug through the
code to find the root cause, it's just being reported here as an issue,
possibly hiding a bug deeper in the code. I used the -DDBUG_OFF previously
for the SPARC compiling, it causes problems for x86.


As an aside, the compiler attribute check for "mode" doesn't work so well,
I need to give gmp_cv_c_attribute_mode=no to configure.

configure:25360: checking whether gcc __attribute__ ((mode (XX))) works
configure:25376: cc -m64 -c -xO3 -m64 -DNO_ASM -I/usr/local/include
conftest.c >&5
"conftest.c", line 60: warning:  attribute "mode" is unknown, ignored
configure:25376: $? = 0
configure:25384: result: yes

ta,
Mark.


More information about the gmp-bugs mailing list