Linux fastdebug build with debug info
David Holmes - Sun Microsystems
David.Holmes at Sun.COM
Wed May 20 00:00:17 PDT 2009
The flags are set in gcc.make and should then be picked up by each
<target>.make file. But in this case it appears that the linux
fastdebug.make is missing the instructions to do that! Looks like a bug
Regarding use of -g, hence the settings and comments from gcc.make:
# Use the stabs format for debugging information (this is the default
# on gcc-2.91). It's good enough, has all the information about line
# numbers and local variables, and libjvm_g.so is only about 16M.
# Change this back to "-g" if you want the most expressive format.
# (warning: that could easily inflate libjvm_g.so to 150M!)
# Note: The Itanium gcc compiler crashes when using -gstabs.
DEBUG_CFLAGS/ia64 = -g
DEBUG_CFLAGS/amd64 = -g
DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
DEBUG_CFLAGS += -gstabs
There's a history here about the size of the lib when -g is used, hence
the -gstabs default.
Hiroshi Yamauchi said the following on 05/20/09 14:32:
> If I build a fastdebug VM on Linux (based on openjdk6 b11), the
> libjvm.so does not get the debug info (symbols and line numbers used
> mainly in gdb). If I copy'n'paste the following lines from jvmg.make
> to fastdebug.make (under hotspot/build/linux/makefiles), I get the
> debug info.
> # The following lines were copied from jvmg.make
> # Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
> DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
> DEBUG_CFLAGS/BYFILE =
> $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@) )
> CFLAGS += $(DEBUG_CFLAGS/BYFILE)
> Is this valid?
> Is there any historic reason why -g isn't used in the fastdebug build
> on Linux (such as conflict between -O and -g)?
> I think the fastdebug should have -g by definition.
More information about the hotspot-dev