gcc-7 build fails with native assembler
When the native assembler is specified, as it is for SPARC hardware, the build of gcc-7 fails with an internal compiler error. The culprit is the configure option --enable-initfini-array . See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87836> for details. This option is not shown in configure --help output, suggesting that it is not recommended. This feature requires assembler and linker support. It's not supported by the native assembler. If this option is specified, it forces the feature on, even when it doesn't work. It the option is omitted, the configure script tests for it, making it suitable for x86 or SPARC hardware.
As well, three of the options in the OI Makefile are missing the equal sign (=). The attached Makefile is for 7.3.0-il-1, the same as used in gcc-7 in a recent oi-userland. It includes the fix for Bug #9980, a better CFLAGS value, and fixes for the two errors mentioned above. It's suitable for x86 and SPARC.
The attached patch, 0008-crts.patch, enables creation of two more crt object files on SPARC. It's also suitable for x86 and SPARC.
Updated by Gary Mills 9 months ago
This suggestion is not necessary for x86. If --enable-initfini-array is omitted, the gcc configure script still enables the associated feature. It does this by testing the assembler and linker to determine if support for the feature is present. In other words, detection of the feature is automatic. It's never necessary to specify --enable-initfini-array . Specifying it bypasses the tests, causing trouble when the native assembler is used.