United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7188168 7071904 broke the DEBUG_BINARIES option on Linux
JDK-7188168 : 7071904 broke the DEBUG_BINARIES option on Linux

Details
Type:
Bug
Submit Date:
2012-07-31
Status:
Resolved
Updated Date:
2013-04-30
Project Name:
JDK
Resolved Date:
2012-08-27
Component:
hotspot
OS:
linux
Sub-Component:
build
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
hs22
Fixed Versions:
hs24 (b21)

Related Reports
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
I posted the following response:

On 7/31/12 7:26 AM, Andrew Hughes wrote:
> ----- Original Message -----
>> I would love for stabs to go away for linux 32 bit.   I think there
>> was
>> a size issue once with that platform and was filling up our disk.  I
>> think I changed this recently and noticed that the issue is gone.
> That's what's noted in the comments.  However, there's also a regression here:
>
> 1.  Prior to 7071904, '-gstabs' was only added for debug builds and fastdebug/opt
> builds did not have debugging information.
> 2.  After 7071904, '-gstabs' is added to all builds except on arm, ppc, x86_64 and
> ia64.
>
> This conflicts with the DEBUG_BINARIES option we use for building that adds '-g' to
> all builds.  It means that, with the change in 7071904, our builds now get '-g -gstabs'
> on x86, whereas before they just got '-g'.

This answers my question about DEBUG_BINARIES. Looks like
my changes for 7071904 broke that option.


> Maybe the following would work without affecting your builds:
>
> --- a/make/linux/makefiles/gcc.make
> +++ b/make/linux/makefiles/gcc.make
> @@ -274,6 +274,8 @@
>   # DEBUG_BINARIES overrides everything, use full -g debug information
>   ifeq ($(DEBUG_BINARIES), true)
>     DEBUG_CFLAGS = -g
> +  OPT_CFLAGS = -g
> +  FASTDEBUG_CFLAGS = -g
>     CFLAGS += $(DEBUG_CFLAGS)
>   endif
>
> The CFLAGS line may be able to be dropped as well.

Actually the CFLAGS line is the only way to be sure that the '-g'
gets into all build configs. At one point, there was more than
"debug", "fastdebug" and "opt"...

I think the right fix for DEBUG_BINARIES is:

 # DEBUG_BINARIES overrides everything, use full -g debug information
 ifeq ($(DEBUG_BINARIES), true)
!  DEBUG_CFLAGS =
+  OPT_CFLAGS =
+  FASTDEBUG_CFLAGS =
   CFLAGS += -g
 endif



>>    I'll
>> file a bug (if there isn't one already) and remove stabs for linux.
> Thanks :-)

I think we need two bugs here. One for the DEBUG_BINARIES breakage
and one for possibly changing to DWARF from STABS on Linux X86.
Andrew Hughes @ RedHat reported the following issue:

----- Original Message -----
> > 
> > I would love for stabs to go away for linux 32 bit.   I think there
> > was
> > a size issue once with that platform and was filling up our disk.  I
> > think I changed this recently and noticed that the issue is gone.
That's what's noted in the comments.  However, there's also a regression here:

1.  Prior to 7071904, '-gstabs' was only added for debug builds and fastdebug/opt
builds did not have debugging information.
2.  After 7071904, '-gstabs' is added to all builds except on arm, ppc, x86_64 and
ia64.

This conflicts with the DEBUG_BINARIES option we use for building that adds '-g' to
all builds.  It means that, with the change in 7071904, our builds now get '-g -gstabs'
on x86, whereas before they just got '-g'.

Maybe the following would work without affecting your builds:

--- a/make/linux/makefiles/gcc.make
+++ b/make/linux/makefiles/gcc.make
@@ -274,6 +274,8 @@
 # DEBUG_BINARIES overrides everything, use full -g debug information
 ifeq ($(DEBUG_BINARIES), true)
   DEBUG_CFLAGS = -g
+  OPT_CFLAGS = -g
+  FASTDEBUG_CFLAGS = -g
   CFLAGS += $(DEBUG_CFLAGS)
 endif

The CFLAGS line may be able to be dropped as well.

> >   I'll
> > file a bug (if there isn't one already) and remove stabs for linux.
Thanks :-)

> > Stabs still work better for solaris.
We have no plans to change the Solaris build :-)

                                    

Comments
EVALUATION

Reorder and slightly tweak the Makefile logic
that supports the DEBUG_BINARIES make option:

- when 'DEBUG_BINARIES=true' is specified, the '-g' option is
  added to the CFLAGS make variable and none of the other
  {DEBUG,FASTDEBUG,OPT}_CFLAGS variables are touched
- this fix prevents doubled '-g' options and combined '-g' and
  '-gstabs' options
- depending on the particular Linux config being built, a
  compilation will have a single '-g' or a single '-gstabs' or
  neither of those options

The Linux embedded builds doesn't support FDS yet so most of
those compiles fall into the "neither" bucket...
                                     
2012-08-01
SUGGESTED FIX

See the attached 7188168-webrev-cr0.tgz for the fix as proposed
in code review round 0.
                                     
2012-08-01
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-rt/hotspot/rev/282abd0fd878
                                     
2012-08-02
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/rev/282abd0fd878
                                     
2012-08-22



Hardware and Software, Engineered to Work Together