Per-file OPT_CFLAGS is being ignored
David Holmes - Sun Microsystems
David.Holmes at Sun.COM
Sun Nov 9 11:10:11 UTC 2008
I found the problem - thanks to Kelly's hints at what look for.
Later in fastdebug.make we have:
# Workaround for a bug in dtrace. If
# is inlined, the resulting dtrace object file needs a reference to this
# function, whose symbol name is too long for dtrace. So disable inlining
# for this method for now. (fix this when dtrace bug 6258412 is fixed)
OPT_CFLAGS/ciEnv.o = $(OPT_CFLAGS)
which is overwriting any previous flag settings for ciEnv. The above
should just be written as:
to add the inline option.
David Holmes - Sun Microsystems said the following on 11/07/08 09:03:
> I'm trying to work around a compiler issue with an older version of the
> JDK, but which uses the same basic build process, and have run into a
> strange problem.
> For a product build I was able to bypass a compiler crash by lowering
> the optimization level using:
> OPT_CFLAGS/ciEnv.o = $(OPT_CFLAGS/O2)
> which sets -xO2 rather than the default -xO4. This was done in product.make
> Then I moved to fastdebug and I got the same compiler crash and so again
> added the above to lower the optimization level, in fastdebug.make. But
> I still got the crash. I tried lowering again to no-optimization, and
> still got the crash.
> So I used make -n to see what was being passed to CC and much to my
> surprise it shows -xO4 is always being passed. For some reason the
> per-file flag setting is not being picked up.
> I'm stumped. Does anyone have any insights on how this might happen
> (make bug?) or some way to further try and diagnoze?
> David Holmes
More information about the build-dev