make/common/Defs-solaris.gmk

Print this page

        

@@ -131,12 +131,13 @@
   endif
 
   # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the
   # JDK build to import .debuginfo or .diz files from the HotSpot build.
   # However, adding FDS support to the JDK build will occur in phases
-  # so a different make variable (LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS)
-  # is used to indicate that a particular library supports FDS.
+  # so a different make variable (LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
+  # and PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS) is used to indicate that a
+  # particular library or program supports FDS.
 
   ifeq ($(OBJCOPY),)
     _JUNK_ := $(shell \
       echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
     ENABLE_FULL_DEBUG_SYMBOLS=0

@@ -233,10 +234,25 @@
 ifeq ($(FASTDEBUG), true)
   CFLAGS_DEBUG_OPTION    = -g  $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
   CXXFLAGS_DEBUG_OPTION  = -g0 $(CXX_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
 endif
 
+# If Full Debug Symbols is enabled, then we want the same debug and
+# optimization flags as used by FASTDEBUG. We also want all the
+# debug info in one place (-xs).
+#
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
+    ifeq ($(VARIANT), OPT)
+      CC_OPT   = -g  -xs $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
+      CXX_OPT  = -g0 -xs $(CXX_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
+    endif
+    CFLAGS_DEBUG_OPTION    += -xs
+    CXXFLAGS_DEBUG_OPTION  += -xs
+  endif
+endif
+
 CFLAGS_COMMON   = -L$(OBJDIR)
 
 # Do not allow C99 language features like declarations in code etc.
 CFLAGS_COMMON  += -xc99=%none