make/common/Defs-linux.gmk

Print this page

        

@@ -1,7 +1,7 @@
 #
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License version 2 only, as
 # published by the Free Software Foundation.  Oracle designates this

@@ -72,38 +72,42 @@
 SCRIPT_SUFFIX =
 # CC compiler object code output directive flag value
 CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
 CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
 
-# Default OBJCOPY comes from GNU Binutils on Linux:
-DEF_OBJCOPY=/usr/bin/objcopy
-ifdef CROSS_COMPILE_ARCH
+ENABLE_FULL_DEBUG_SYMBOLS ?= 1
+# since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
+
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+  # Default OBJCOPY comes from GNU Binutils on Linux:
+  DEF_OBJCOPY=/usr/bin/objcopy
+  ifdef CROSS_COMPILE_ARCH
   # don't try to generate .debuginfo files when cross compiling
   _JUNK_ := $(shell \
     echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \
       "skipping .debuginfo generation.")
   OBJCOPY=
-else
+  else
   OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
   ifneq ($(ALT_OBJCOPY),)
     _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
     # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
     OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
   endif
-endif
+  endif
 
-ifdef LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
-# The setting of OBJCOPY above enables the JDK build to import
-# .debuginfo files from the HotSpot build. However, adding FDS
-# support to the JDK build will occur in phases so a different
-# make variable is used to indicate that a particular library
-# supports FDS.
+  # 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.
 
-ifeq ($(OBJCOPY),)
+  ifeq ($(OBJCOPY),)
   _JUNK_ := $(shell \
     echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
-else
+    ENABLE_FULL_DEBUG_SYMBOLS=0
+  else
   _JUNK_ := $(shell \
     echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
 
   # Library stripping policies for .debuginfo configs:
   #   all_strip - strips everything from the library

@@ -111,21 +115,22 @@
   #   no_strip  - does not strip the library at all
   #
   # Oracle security policy requires "all_strip". A waiver was granted on
   # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
   #
-  DEF_STRIP_POLICY="min_strip"
-  ifeq ($(ALT_STRIP_POLICY),)
-    STRIP_POLICY=$(DEF_STRIP_POLICY)
-  else
-    STRIP_POLICY=$(ALT_STRIP_POLICY)
-  endif
+    # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
+    STRIP_POLICY ?= min_strip
 
   _JUNK_ := $(shell \
     echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
+
+    ZIP_DEBUGINFO_FILES ?= 1
+
+    _JUNK_ := $(shell \
+      echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
+  endif
 endif
-endif
 
 #
 # Default optimization
 #
 

@@ -411,10 +416,11 @@
 
 # Settings for the JDI - Serviceability Agent binding.
 HOTSPOT_SALIB_PATH   = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
 SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX)
 SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo
+SA_DIZ_NAME = $(LIB_PREFIX)saproc.diz
 
 # The JDI - Serviceability Agent binding is not currently supported
 # on Linux-ia64.
 ifeq ($(ARCH), ia64)
   INCLUDE_SA = false