Universal binary t-get_d test failure

Ryan Schmidt gmp-2008b at ryandesign.com
Tue Jun 10 10:54:05 CEST 2008


Hello! When building a universal binary of gmp 4.2.2, the t-get_d  
test fails:


creating t-scan
make  check-TESTS
PASS: t-asmtype
PASS: t-aors_1
PASS: t-divrem_1
PASS: t-fat
mpn_get_d wrong on 2^n
    bit      0
    exp      0
    want_bit 0
    sign     0
    n        =0x1
    nsize    1
    want     =[00 00 00 00 00 00 F0 3F] 1
    got      =[FE 07 00 00 00 00 00 00] 1.0108583113911904294e-320
FAIL: t-get_d
PASS: t-instrument
PASS: t-iord_u
PASS: t-mp_bases
PASS: t-perfsqr
PASS: t-scan
==================================
1 of 10 tests failed
Please report to gmp-bugs at swox.com
==================================
make[4]: *** [check-TESTS] Error 1
make[3]: *** [check-am] Error 2
make[2]: *** [check-recursive] Error 1
make[1]: *** [check-recursive] Error 1
make: *** [check] Error 2


Looks like an endian issue. I know you don't like Apple's gcc, but  
all the tests pass when building just for the local architecture  
(i.e. not building a universal binary). I confirmed this fact on Mac  
OS X 10.4.11 with Xcode 2.4.1 and on Mac OS X 10.5.3 with Xcode 3.0,  
both on a Core 2 Duo Intel MacBook Pro.

Is this something that can be fixed in gmp, or should one not attempt  
to build a universal binary of gmp?

The way I'm building gmp universal is through the MacPorts gmp port  
with the +universal variant, which does it by configuring this way  
(on 10.4.11):


CFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch  
i386' \
CPPFLAGS='-I/mp/include -isysroot /Developer/SDKs/MacOSX10.4u.sdk' \
CXXFLAGS='-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc - 
arch i386' \
CPP='/usr/bin/cpp-4.0' \
CXX='/usr/bin/g++-4.0' \
F90FLAGS='-O2' \
LDFLAGS='-L/mp/lib -arch ppc -arch i386' \
FCFLAGS='-O2' \
OBJC='/usr/bin/gcc-4.0' \
INSTALL='/usr/bin/install -c' \
OBJCFLAGS='-O2' \
FFLAGS='-O2' \
"MACOSX_DEPLOYMENT_TARGET"='10.4' \
CC='/usr/bin/gcc-4.0'
./configure \
--prefix=/mp \
--infodir=/mp/share/info \
--enable-shared \
--enable-cxx \
--host=none-apple-darwin \
--disable-dependency-tracking



More information about the gmp-bugs mailing list