Bug #10294


gcc-7 build fails with native assembler

Added by Gary Mills almost 4 years ago. Updated about 2 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


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 <> 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.


Makefile (6.71 KB) Makefile Gary Mills, 2019-01-25 11:52 PM
0008-crts.patch (514 Bytes) 0008-crts.patch Gary Mills, 2019-01-25 11:52 PM
Makefile (6.71 KB) Makefile Gary Mills, 2019-01-26 10:43 PM
Actions #1

Updated by Aurélien Larcher almost 4 years ago

Linker support was added before I pushed gcc-7 so it is fine for x86.
If you make any change I suggest that you do not alter the x86 configuration, SPARC modifications should not interfere.

Actions #2

Updated by Gary Mills almost 4 years 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.

Actions #3

Updated by Gary Mills almost 4 years ago

Ah, the test in the gcc configure script doesn't work for illumos. You were right: you have to force it for illumos x86. I've adjusted the Makefile to do that. I've attached the new Makefile. The patch is unchanged.

Actions #4

Updated by Gary Mills almost 4 years ago

I've confirmed that the same Makefile works on SPARC and x86. On x86 it does set HAVE_INITFINI_ARRAY_SUPPORT to 1.
So, this Makefile and the patch can be incorporated in OI hipster now.

Actions #5

Updated by Gary Mills about 2 years ago

  • Status changed from New to Closed

The i386-only addition of --enable-initfini-array is now included in OI for gcc-7, gcc-9, and gcc-10. It's omitted from gcc-8, for some reason. Different assemblers for x86 and sparc platforms are included with all of them. The patch 0008-crts.patch , which adds more crt files for the sparc platform is omitted from all of them. This bug report will be closed.


Also available in: Atom PDF