I'm not sure if this requires two bug reports or not, nonetheless... My first attempt at compiling used the following CFLAGS/CXXFLAGS: CFLAGS="-mcpu=v8 -mtune=v9 -O2 -pipe -fomit-frame-pointer" CXXFLAGS="-mcpu=v8 -mtune=v9 -O2 -pipe -fomit-frame-pointer" The Ebuild died quite horribly at this point: gcc -c -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_add_n -mcpu=v8 -mtune=v9 -O2 -pipe -fomit-frame-pointer tmp-add_n.s -fPIC -DPIC -o .libs/add_n.o tmp-add_n.s: Assembler messages: tmp-add_n.s:60: Error: Architecture mismatch on "lduw". tmp-add_n.s:60: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:61: Error: Architecture mismatch on "lduw". tmp-add_n.s:61: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:63: Error: Architecture mismatch on "bl,pn %icc,.Lend1". tmp-add_n.s:63: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:64: Error: Architecture mismatch on "lduw". tmp-add_n.s:64: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:65: Error: Architecture mismatch on "lduw". tmp-add_n.s:65: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:66: Error: Architecture mismatch on "be,pn %icc,.Lend2". tmp-add_n.s:66: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:73: Error: Architecture mismatch on "lduw". tmp-add_n.s:73: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:78: Error: Architecture mismatch on "lduw". tmp-add_n.s:78: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:81: Error: Architecture mismatch on "srlx". tmp-add_n.s:81: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:83: Error: Architecture mismatch on "stw". tmp-add_n.s:83: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:84: Error: Architecture mismatch on "be,pn %icc,.Lexito+4". tmp-add_n.s:84: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:88: Error: Architecture mismatch on "lduw". tmp-add_n.s:88: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:93: Error: Architecture mismatch on "lduw". tmp-add_n.s:93: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:96: Error: Architecture mismatch on "srlx". tmp-add_n.s:96: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:97: Error: Architecture mismatch on "bne,pt %icc,.Lloop". tmp-add_n.s:97: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:98: Error: Architecture mismatch on "stw". tmp-add_n.s:98: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:103: Error: Architecture mismatch on "srlx". tmp-add_n.s:103: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:104: Error: Architecture mismatch on "stw". tmp-add_n.s:104: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:107: Error: Architecture mismatch on "stw". tmp-add_n.s:107: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:109: Error: Architecture mismatch on "srlx". tmp-add_n.s:109: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:114: Error: Architecture mismatch on "srlx". tmp-add_n.s:114: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:115: Error: Architecture mismatch on "stw". tmp-add_n.s:115: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:118: Error: Architecture mismatch on "stw". tmp-add_n.s:118: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:120: Error: Architecture mismatch on "srlx". tmp-add_n.s:120: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:124: Error: Architecture mismatch on "stw". tmp-add_n.s:124: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:126: Error: Architecture mismatch on "srlx". tmp-add_n.s:126: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:130: Error: Architecture mismatch on "srlx". tmp-add_n.s:130: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:131: Error: Architecture mismatch on "stw". tmp-add_n.s:131: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:134: Error: Architecture mismatch on "stw". tmp-add_n.s:134: (Requires v9|v9a|v9b; requested architecture is sparclite.) tmp-add_n.s:136: Error: Architecture mismatch on "srlx". tmp-add_n.s:136: (Requires v9|v9a|v9b; requested architecture is sparclite.) make[2]: *** [add_n.lo] Error 1 make[2]: Leaving directory `/usr/obj/portage/gmp-4.1-r1/work/gmp-4.1/mpn' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/obj/portage/gmp-4.1-r1/work/gmp-4.1' make: *** [all] Error 2 !!! ERROR: The ebuild did not complete successfully. !!! Function src_compile, Line -149, Exitcode 2 !!! make failed //------------------------------------------------- The Second attempt at building, I used the following flags: CFLAGS="-mcpu=ultrasparc -mtune=ultrasparc -O2 -pipe -fomit-frame-pointer" CXXFLAGS="-mcpu=ultrasparc -mtune=ultrasparc -O2 -pipe -fomit-frame-pointer" This time, the Ebuild appears to have gotten a bit father. It died at this point: gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -mcpu=ultrasparc -mtune=ultrasparc -O2 -pipe -fomit-frame-pointer -c `test -f uceil_exp2.c || echo './'`uceil_exp2.c uceil_exp2.c: In function `_mpfr_ceil_exp2': uceil_exp2.c:32: storage size of `x' isn't known make[3]: *** [uceil_exp2.o] Error 1 make[3]: Leaving directory `/usr/obj/portage/gmp-4.1-r1/work/gmp-4.1/mpfr' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/obj/portage/gmp-4.1-r1/work/gmp-4.1/mpfr' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/obj/portage/gmp-4.1-r1/work/gmp-4.1' make: *** [all] Error 2 !!! ERROR: The ebuild did not complete successfully. !!! Function src_compile, Line -149, Exitcode 2 !!! make failed //------------------------------------------------- A third and final build attempt that removes the -mcpu and -mtune flags fails for the same reason as the first error. Posted below are small excerpts of the ./configure status that looked to be "different" from the norm. checking build system type... ultrasparc2-unknown-linux-gnu checking host system type... ultrasparc2-unknown-linux-gnu using ABI="standard" CC="gcc" CFLAGS="-mcpu=v8 -mtune=v9 -O2 -pipe -fomit-frame-pointer" CPPFLAGS="" CXX="g++" CXXFLAGS="-mcpu=v8 -mtune=v9 -O2 -pipe -fomit-frame-pointer" MPN_PATH=" sparc32/v9 sparc32/v8 sparc32 generic" checking for working alloca.h... yes checking for alloca (via gmp-impl.h)... yes checking how to allocate temporary memory... alloca configure: WARNING: gmp-impl.h doesnt recognise "double" as IEEE. configure: WARNING: If your CPU floats are in fact IEEE then you configure: WARNING: might like to augment the tests there. checking whether byte ordering is bigendian... yes checking format of `double' floating point... IEEE big endian -fin-
I have noticed if you change the -mcpu=v8 CFLAG to -mcpu=v9, the architecture mismatch problem goes away. According to the gcc 3.2 compiler specs located at <http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/SPARC-Options.html#SPARC%20Options>, v8 is for hypersparc or supersparc processors. Apparently GMP is smart enough to know that sparc64 is not one of those, hence why the v9 fix works. Perhaps a workaround in the ebuild to temporarily change the -mcpu field for this build might work.
That's weird. As far as I know, -mcpu=v9 is the same thing as -mcpu=ultrasparc, and I did try -mcpu=ultrasparc -mtune=ultrasparc. I switched to using -mcpu=v8 -mtune=v9 as a user in the gentoo sparc forums informed me that those flags will build glibc with those flags in a bootstrap, or if glibc ever needs to be re-emerged. Glibc fails with any other flags with an extremely similar error (Architecture mismatch (See some of the other sparc64 bugs)). Is there some further undocumented difference between using v9 or ultrasparc?
Looking into this a little further, the problem seems to come from one of the configure flags in the ebuild. This flag has now been removed for the sparc platform, and the package compiles sucessfully.
Fixed ebuild to remove problimatic configure flags. No problems reported in relation to missing flag. Closing.