RFR (S): JDK-8150201 Restore missing -g flags to files with OPT_CFLAGS/per-file

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Thu Feb 18 23:16:52 UTC 2016

There seems to be a bit of confusion as to OPT_CFLAGS meant "CFLAGS for 
optimization" or "CFLAGS for optimized/product build". Some usages seems 
to suggest the first interpretation, while other usages seems to have 
made the second (where OPT_CFLAGS align with DEBUG_CFLAGS/FASTDEBUG_CFLAGS).

The first interpretation seems to have been used for the code that make 
it possible to override OPT_CFLAGS on a per-file basis by setting e.g. 
OPT_CFLAGS/foo.o is set. In this case, the general value of OPT_CFLAGS 
is discarded, including any -O flags.

However, the second interpretation seems to have been used for FDS, 
where -g (or -g0 -xs on solaris) are added to OPT_CFLAGS.

The end result is that whenever the OPT_CFLAGS/foo.o mechanism is used, 
the FDS -g flag is lost. :-(

This patch is a minimal fix to restore the -g flag to these files.

A more general approach to fix this was originally suggested as part of 
JDK-8142909, but was deemed inadequate. After some discussion, the 
entire problem with the missing -g flags was dropped from that bug. 
However, one of the key points in the discussion was that an explicit 
add of -g would be a better solution, which is what I have adopted here 
(short of a major rewrite of the flag handling in the old build system, 
which is not going to happen). I have also made a more thorough check 
this time to really catch all such issues (at least for default Oracle 

The main reason for bringing this change in now is to make it possible 
to compare the build results between the upcoming new hotspot build, and 
the old. Since the new build always adds -g to all files (if we need 
debug symbols, that is), there will be huge discrepances between the two 
build system in the affected files.

Bug: https://bugs.openjdk.java.net/browse/JDK-8150201


More information about the hotspot-runtime-dev mailing list