assembly files on Solaris SPARC can only be processed with gcc

Marc Glisse marc.glisse at inria.fr
Mon Aug 28 21:01:33 UTC 2017


On Sun, 27 Aug 2017, Dennis Clarke wrote:

> I have been trying to get gmp-6.1.2 to build while avoiding the use of
> "disable-assembly" in the configure stage. I think I may have tripped on
> something here.  So I isolated everything into my home dir and gave it
> a try.  Mostly trying to get some decent performance.

If you care about performance, use gcc to compile GMP. The only good
reason to compile GMP with studio is for gmpxx for ABI reasons.

> Configure looks fine thus :
>
> v9_7++ $ ./configure ABI=64 --enable-cxx \
>> --prefix=/export/home/dclarke/local \
>> --libdir=/export/home/dclarke/local/lib \

that libdir is redundant.

>> --build=sparc64-sun-solaris2.10

so you are explicitly trying to disable some optimizations?

> checking compiler /opt/developerstudio12.5/bin/c99 -errfmt=error 
> -erroff=%none -errshort=full -xstrconst -xildoff -m64 -xmemalign=8s 
> -xnolibmil -Xc -xcode=pic32 -xregs=no%appl -xlibmieee -mc -g -xs -ftrap=%none 
> -Qy -xbuiltin=%none -xdebugformat=dwarf -xunroll=1 -xarch=sparc 
> -I/export/home/dclarke/local/include -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS 
> -D_LARGEFILE64_SOURCE... yes

I know those are the flags that you are using elsewhere, but the first
thing to try is always to remove all your special stuff.

> libtool: compile:  /opt/developerstudio12.5/bin/c99 -DHAVE_CONFIG_H -I. -I.. 
> -D__GMP_WITHIN_GMP -I.. -DOPERATION_perfpow 
> -I/export/home/dclarke/local/include -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS 
> -D_LARGEFILE64_SOURCE -errfmt=error -erroff=%none -errshort=full -xstrconst 
> -xildoff -m64 -xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl 
> -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf 
> -xunroll=1 -xarch=sparc -c perfpow.c  -KPIC -DPIC -o .libs/perfpow.o
> "../gmp-impl.h", line 3701: warning:  attribute "mode" is unknown, ignored
> "../gmp-impl.h", line 3702: warning:  attribute "mode" is unknown, ignored
> "../gmp-impl.h", line 3703: warning:  attribute "mode" is unknown, ignored
> "../gmp-impl.h", line 3704: warning:  attribute "mode" is unknown, ignored
> "../gmp-impl.h", line 3705: warning:  attribute "mode" is unknown, ignored
> libtool: compile:  /opt/developerstudio12.5/bin/c99 -DHAVE_CONFIG_H -I. -I.. 
> -D__GMP_WITHIN_GMP -I.. -DOPERATION_perfpow 
> -I/export/home/dclarke/local/include -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS 
> -D_LARGEFILE64_SOURCE -errfmt=error -erroff=%none -errshort=full -xstrconst 
> -xildoff -m64 -xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl 
> -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf 
> -xunroll=1 -xarch=sparc -c perfpow.c -o perfpow.o >/dev/null 2>&1
> /usr/local/bin/bash ../libtool --mode=compile --tag=CC ../mpn/m4-ccas 
> --m4="/usr/local/bin/m4" /opt/developerstudio12.5/bin/c99 -c -DHAVE_CONFIG_H 
> -I. -I..  -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo gcd_1 | sed 's/_$//'` 
> -I/export/home/dclarke/local/include -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS 
> -D_LARGEFILE64_SOURCE  -errfmt=error -erroff=%none -errshort=full -xstrconst 
> -xildoff -m64 -xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl 
> -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf 
> -xunroll=1 -xarch=sparc  `test -f 'gcd_1.asm' || echo './'`gcd_1.asm
> libtool: compile:  ../mpn/m4-ccas --m4=/usr/local/bin/m4 
> /opt/developerstudio12.5/bin/c99 -c -DHAVE_CONFIG_H -I. -I.. 
> -D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_1 
> -I/export/home/dclarke/local/include -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS 
> -D_LARGEFILE64_SOURCE -errfmt=error -erroff=%none -errshort=full -xstrconst 
> -xildoff -m64 -xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl 
> -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf 
> -xunroll=1 -xarch=sparc gcd_1.asm  -KPIC -DPIC -o .libs/gcd_1.o
> /usr/local/bin/m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_gcd_1 
> -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS -D_LARGEFILE64_SOURCE -DPIC gcd_1.asm 
>> tmp-gcd_1.s
> /opt/developerstudio12.5/bin/c99 -c -DHAVE_CONFIG_H -I. -I.. 
> -D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_1 
> -I/export/home/dclarke/local/include -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS 
> -D_LARGEFILE64_SOURCE -errfmt=error -erroff=%none -errshort=full -xstrconst 
> -xildoff -m64 -xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl 
> -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf 
> -xunroll=1 -xarch=sparc tmp-gcd_1.s -KPIC -DPIC -o .libs/gcd_1.o
> libtool: compile:  ../mpn/m4-ccas --m4=/usr/local/bin/m4 
> /opt/developerstudio12.5/bin/c99 -c -DHAVE_CONFIG_H -I. -I.. 
> -D__GMP_WITHIN_GMP -I.. -DOPERATION_gcd_1 
> -I/export/home/dclarke/local/include -D_TS_ERRNO -D_POSIX_PTHREAD_SEMANTICS 
> -D_LARGEFILE64_SOURCE -errfmt=error -erroff=%none -errshort=full -xstrconst 
> -xildoff -m64 -xmemalign=8s -xnolibmil -Xc -xcode=pic32 -xregs=no%appl 
> -xlibmieee -mc -g -xs -ftrap=%none -Qy -xbuiltin=%none -xdebugformat=dwarf 
> -xunroll=1 -xarch=sparc gcd_1.asm -o gcd_1.o >/dev/null 2>&1
> gmake[2]: *** [Makefile:768: gcd_1.lo] Error 1

this isn't giving any hint as to what the error is :-(

> Just going into mpn directory and re-running that last compile command gives

Look again, that's not exactly what the last command was.

> So the question is ... is there any way at all to use the assembly files
> that pre-exist in the tarball and yet avoid gcc and thus avoid
> dependencies on libstdc++.so.6 and libgcc_s.so.1 ?   Is this a bug or
> just a build environment problem?  Should I even care?

No (to the last question).

> Better than before but a 12 year old PowerMac G5 does the same job in
> just about 3.5 secs. An AMD Opteron at 3GHz does it all faster than that and 
> I hear from Paul Zimmermann that his laptop is sub-second. Not sure
> how to get some performance out of libgmp on this platform.  Am really
> open to any thoughts.

If you care about GMP performance, don't use sparc... Some small
improvements might be possible on newer platforms (I think David Miller
did some work a few years ago, don't remember how far that went).

-- 
Marc Glisse


More information about the gmp-bugs mailing list