jdk/make/common/Defs-linux.gmk
changeset 12427 116544b5a04c
parent 12309 49cad5b7b263
child 12445 9df4dd548612
--- a/jdk/make/common/Defs-linux.gmk	Tue Apr 10 23:18:33 2012 -0700
+++ b/jdk/make/common/Defs-linux.gmk	Wed Apr 11 07:26:35 2012 -0700
@@ -131,8 +131,9 @@
   # 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 \
@@ -261,6 +262,17 @@
   CFLAGS_REQUIRED += $(DEBUG_FLAG)
 endif
 
+# If Full Debug Symbols is enabled, then we want the same debug and
+# optimization flags as used by FASTDEBUG.
+#
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1)
+    ifeq ($(VARIANT), OPT)
+      CC_OPT = $(DEBUG_FLAG) $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
+    endif
+  endif
+endif
+
 CFLAGS_OPT      = $(CC_OPT)
 CFLAGS_DBG      = $(DEBUG_FLAG)
 CFLAGS_COMMON += $(CFLAGS_REQUIRED)