Problem compiling 4.2.4 on Solaris 10 with Sun Studio 12

Marc Glisse marc.glisse at normalesup.org
Fri Feb 20 09:40:50 CET 2009


On Fri, 20 Feb 2009, John Center wrote:

> To follow up, I recompiled with GMP 4.2.4 with -library=stlport4. I used 
> the -enable-cxx option & the compile failed while building osdoprnti.cc.

Oh yes, I had forgotten to warn you about this gmp bug.

> On a different issue, when I ran "make check" one test failed, t-locale, & 
> dumped core.
>
> Here's the output from dbx:
>
> # dbx .libs/t-locale /var/core/core_ra_t-locale_0_0_1235103740_10227
> Reading t-locale
> core file header read successfully
> Reading ld.so.1
> Reading libc.so.1
> Reading libgmp.so.3.4.4
> Reading libumem.so.1
> Reading libstlport.so.1
> Reading libCrun.so.1
> Reading libm.so.1
> Reading librt.so.1
> Reading libaio.so.1
> Reading libmd.so.1
> Reading libc_psr.so.1
> Reading libm.so.2
> Reading libgmpxx.so.4.0.4
> program terminated by signal SEGV (no mapping at the fault address)
> 0xffffffff7eb771f8: imbue+0x0078:       ldx      [%o0], %i5
> Current function is check_output (optimized)
>  141         ostringstream  got;
> (dbx) where
>  [1] std::basic_ios<char,std::char_traits<char> >::imbue(0xffffffff7ffff018, 
> 0xffffffff7ffff3a0, 0xffffffff7ffff010, 0x5d8, 0x400, 0x400), at 
> 0xffffffff7eb771f8
>  [2] std::basic_ios<char,std::char_traits<char> >::init(0xffffffff7ffff3a0, 
> 0x0, 0x158, 0xffffffff7ed194c8, 0xffffffff7ed194f0, 0xffffffff7ffff248), at 
> 0xffffffff7eb76fc8
>  [3] 
> std::basic_ostringstream<char,std::char_traits<char>,std::allocator<char> 
>> ::basic_ostringstream(0xffffffff7ffff248, 0x10, 0x6f0, 0xffffffff7ffff3a0, 
> 0xffffffff7ed19518, 0xffffffff7ed10300), at 0xffffffff7eb796d0
> =>[4] check_output() (optimized), at 0x10000658c (line ~141) in "t-locale.cc"
>  [5] main() (optimized), at 0x100006ed0 (line ~184) in "t-locale.cc"
>
> Here's the flags it was compiled & linked with:
>
> cc -xc99=%all -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../tests 
> -I/opt/gnu/include -I/opt/local/include -I/usr/sfw/include -I/usr/include  -g 
> -xs -fast -fsimple=1 -fns=no -xtarget=ultraT1 -xarch=sparcvis2 -m64 -mt -xipo 
> -xcode=pic32 -xpagesize=default -xlic_lib=sunperf  -c t-locale.c
>
> cc -xc99=%all -g -xs -fast -fsimple=1 -fns=no -xtarget=ultraT1 
> -xarch=sparcvis2 -m64 -mt -xipo -xcode=pic32 -xpagesize=default 
> -xlic_lib=sunperf -Wl,-ztext -Wl,-Bdirect -Wl,-zlazyload -Wl,-zcombreloc 
> -Wl,-zignore -o .libs/t-locale t-locale.o  -L/opt/gnu/lib/sparcv9 
> -L/opt/local/lib/sparcv9 -L/usr/sfw/lib/sparcv9 -L/usr/lib/sparcv9 
> ../../tests/.libs/libtests.a /opt/ws/dists/gmp-4.2.4/.libs/libgmp.so 
> ../../.libs/libgmp.so -lumem -lpthread  -R/opt/gnu/lib/sparcv9 
> -R/opt/local/lib/sparcv9 -R/usr/sfw/lib/sparcv9 -R/usr/lib/sparcv9

These are the flags for misc/t-locale.c, not cxx/t-locale.cc.

> Could someone please tell me what might be wrong?

I don't know. Well I do know that stlport4 only supports the C locale, but 
that should not cause this segfault. Also, you are using -fast without 
-fsimple=0, which could cause problems, but usually not just there.

You could try running the test in dbx with check -all to get more 
information, but I fear someone more knowledgeable than me will have to 
help. You can try -library=stlport4_dbg, play with the various options 
used (try with the default flags for instance), check you have the latest 
patches for your compiler, etc.

Not related: I see you are compiling for a T1. You may want to replace 
-xarch=sparcvis2 by -xarch=sparc there (I am not sure whether gmp disables 
the use of floating point for the T1). Also, -xlic_lib=sunperf is a bit 
useless for gmp.

-- 
Marc Glisse


More information about the gmp-bugs mailing list