jdk/make/common/Defs-linux.gmk
changeset 12293 6c4b13381b81
parent 12047 320a714614e9
child 12307 b34445ac110f
--- a/jdk/make/common/Defs-linux.gmk	Fri Mar 23 11:28:58 2012 +0000
+++ b/jdk/make/common/Defs-linux.gmk	Fri Mar 23 09:27:44 2012 -0700
@@ -1,5 +1,5 @@
 #
-# 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
@@ -73,55 +73,60 @@
 # CC compiler object code output directive flag value
 CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
 
-# 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
-  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
+ENABLE_FULL_DEBUG_SYMBOLS ?= 1
+# since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
 
-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.
-
-ifeq ($(OBJCOPY),)
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
-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
-  #   min_strip - strips most stuff from the library; leaves minimum symbols
-  #   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)
+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
-    STRIP_POLICY=$(ALT_STRIP_POLICY)
+    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
 
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
-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.
+
+  ifeq ($(OBJCOPY),)
+    _JUNK_ := $(shell \
+      echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
+    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
+    #   min_strip - strips most stuff from the library; leaves minimum symbols
+    #   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.
+    #
+    # 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
 
 #
@@ -412,6 +417,7 @@
 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.