Project

General

Profile

Bug #10294

gcc-7 build fails with native assembler

Added by Gary Mills 9 months ago. Updated 9 months ago.

Status:
New
Priority:
Normal
Assignee:
Category:
OI-Userland
Target version:
-
Start date:
2019-01-25
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

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.


Files

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

History

#1

Updated by Aurélien Larcher 9 months 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.

#2

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.

#3

Updated by Gary Mills 9 months 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.

#4

Updated by Gary Mills 9 months 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.

Also available in: Atom PDF