Project

General

Profile

Actions

Bug #5196

open

The cw wrapper restricts gcc to -O2

Added by Gary Mills about 7 years ago. Updated almost 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2014-09-29
Due date:
% Done:

50%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

I'm using Illumos gcc-4.4.4-il-3 as the primary compiler and Sun C 5.9 as the shadow compiler. Even though the default optimization level is specified as -xO3 in Makefile.master, the gcc compiler only optimizes at level 2. This code in usr/src/tools/cw/cw.c is the cause:

@
if (level >= 2) {
/* * For gcc-3.4.x at -O2 we * need to disable optimizations * that break ON.
/
optim_disable(ctx->i_ae, level);/
* limit xO3 to -O2 as well.
*/
level = 2;
}
(void) snprintf(s, len, "-O%d", level);
newae(ctx
>i_ae, s);
free(s);
break;
@

Note that it does not actually check the gcc compiler version. The cw wrapper needs to be fixed.

By modifying this code, I was able to get gcc to run with optimization level 3. In order to get a clean build, I had to suppress warnings by adding -Wno-uninitialized and to eliminate some optimizations by adding -fno-strict-aliasing -fno-tree-vrp .

Is anybody building illumos by running gcc without the cw wrapper? I'd like to know what -W and -f options you had to add, not counting the ones already specified in the Makefiles.

Actions

Also available in: Atom PDF