error compiling gmp-6.2.0 on sparc-sun-solaris2.11 - v9os

Klaus Ziegler - owner of sunfreeware.de klausz at haus-gisela.de
Sun Feb 16 20:55:40 UTC 2020


Hi,

I'm currently trying to bring back more life into the SPARC port of
illumos, aka v9os. Therefore I would like to use gmp-6.2.0 for my
next compiler build. At first I'll have to say thank you for the
perfomance boost in 6.2.0, here are my very small benchmarks
for 6.1.2 and 6.2.0 on a very old Sun Ultra-60 runing:
     v9os: http://www.milax.fi/v9os.html
The measured times are only for the reuse test in subdir mpz:

gmp-6.1.2:
==========
ultra2 2x 450Mhz 2048MB:
gcc-7.4.0: -m32 -O2 -pedantic -mcpu=ultrasparc -Wa,-Av8plusa - gas 2.33.1
9:38 min.
gcc-4.7.4: -O2 -pedantic -m64 -mptr64 -mcpu=ultrasparc -Wa,-Av9a - gas 
2.33.1
5:03 min.
studio12.2 -m64 -xcode=pic32 -xO3 -xtarget=ultra2 -xarch=sparcvis
5:14 min.
ultra2 2x 400Mhz snv_130 studio12.2:
11:45 min.


gmp-6.2.0:
==========
ultra2 2x 450Mhz 2048MB
gcc-5.1.0: -O2 -m64 -mptr64 -mcpu=ultrasparc -Wa,-Av9a - gas: 2.33.1
1:50 min.
studio12.2 -m64 -xO2 -xcode=pic32
1:49 min.
studio12.2 -m64 -xO2 -xcode=pic32
1:56 min.
gcc-4.7.4: -O2 -pedantic -m64 -mptr64 -mcpu=ultrasparc -Wa,-Av9a - gas: 
2.33.1
1:45 min.
ultra10 1x 400Mhz 1024MB - Solaris10
studio12.3 -m64 -xO2 -xcode=pic32
1:56 min.

You may wonder about all these -xcode=pic32 settings, the -xcode=pic32 
option,
was introduced for SPARC in Sun C 5.3, and was outlined equivalent to -KPIC.
Later man pages for Sun C, obsolete the -KPIC option for SPARC 
more<https://dict.leo.org/englisch-deutsch/precise>precisely,
Sun C 5.11 for example:

      -KPIC
           (SPARC) Obsolete. You should not use this option. Use
           -xcode=pic32 instead. For a complete list of obsolete
           options and flags, see the C User's Guide.

therefore I've written a small patch to gmp's configure script, which 
changes the
PICFLAG onwards from Sun C 5.3 to -xcode=pic32, but only for SPARC, 
please see
the second hunk in the attached patch: gmp-6.2.0.patch.
The fix for gmp-h.in in the attached patch is carried forward for me 
since 6.0.0,
probably much longer and only enables Sun C 5.3 users to benefit from gmp's
inlining feature. The last hunk gmp-impl.h eliminates the following 
warning on
Solaris10 / Studio12.3:
gmp-6.2.0/gmp-impl.h", line 734: Warning (Anachronism): Attempt to 
redefine __builtin_constant_p without using #undef.

But now to my real problem, if I try to compile gmp-6.2.0 on v9os using 
Sun C 5.11,
I'll get the following very long lines:
gmp-6.2.0/gmpxx.h", line 3375: Error: static __gmp_expr<__mpz_struct[1], 
__mpz_struct[1]>::factorial(signed char), returning 
__gmp_expr<__mpz_struct[1], __gmp_unary_expr<long, __gmp_fac_function>>, 
was previously declared returning __gmp_expr<__mpz_struct[1], 
__gmp_unary_expr<long, __gmp_fac_function>>.

10 times and then for lines 3376/77 ten times, when compiling 
gmp-6.2.0/cxx/limits.cc
could you please have a look into the attachment: Studio11-gmp-6.2.0.log 
for more details.

I'm using gmp-6.1.2 without problems on v9os with Sun C 5.11, but 5.13 
and newer, isn't an
option on v9os, because of some internal library handling between v9os 
and Sun C 5.13 e.g.
5.13 simply does not work on v9os. But the gcc-5.1.0 included in v9os 
isn't able to build a
working combination of gmp/mpfr in 64bit format. So I'm stuck with Sun C 
5.11 for now,
would you please help me in fixing the C++ erros occuring from 
gmp-6.2.0/cxx/limits.cc

Thanks very much in advance
Best Regards

Klaus Ziegler

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gmp-6.2.0.patch
Type: text/x-patch
Size: 2439 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-bugs/attachments/20200216/c7869091/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: studio12.2-gmp-6.2.0.log
Type: text/x-log
Size: 17326 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-bugs/attachments/20200216/c7869091/attachment-0003.bin>


More information about the gmp-bugs mailing list