make/linux/makefiles/defs.make

Print this page




  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #
  23 #
  24 
  25 # The common definitions for hotspot linux builds.
  26 # Include the top level defs.make under make directory instead of this one.
  27 # This file is included into make/defs.make.
  28 
  29 SLASH_JAVA ?= /java
  30 






  31 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
  32 
  33 # ARCH can be set explicitly in spec.gmk
  34 ifndef ARCH
  35   ARCH := $(shell uname -m)
  36   # Fold little endian PowerPC64 into big-endian (if ARCH is set in
  37   # hotspot-spec.gmk, this will be done by the configure script).
  38   ifeq ($(ARCH),ppc64le)
  39     ARCH := ppc64
  40   endif
  41 endif
  42 
  43 PATH_SEP ?= :
  44 
  45 ifeq ($(LP64), 1)
  46   ARCH_DATA_MODEL ?= 64
  47 else
  48   ARCH_DATA_MODEL ?= 32
  49 endif
  50 


 168   # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
 169   # product build, the FULL_DEBUG_SYMBOLS environment variable will be
 170   # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
 171   # the same variable name is used, then different values can be picked
 172   # up by different parts of the build. Just to be clear, we only need
 173   # two variable names because the incoming option value can be
 174   # overridden in some situations, e.g., a BUILD_FLAVOR != product
 175   # build.
 176 
 177   # Due to the multiple sub-make processes that occur this logic gets
 178   # executed multiple times. We reduce the noise by at least checking that
 179   # BUILD_FLAVOR has been set.
 180   ifneq ($(BUILD_FLAVOR),)
 181     ifeq ($(BUILD_FLAVOR), product)
 182       FULL_DEBUG_SYMBOLS ?= 1
 183       ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
 184     else
 185       # debug variants always get Full Debug Symbols (if available)
 186       ENABLE_FULL_DEBUG_SYMBOLS = 1
 187     endif
 188     _JUNK_ := $(shell \
 189       echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
 190     # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
 191 
 192     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 193       # Default OBJCOPY comes from GNU Binutils on Linux
 194       ifeq ($(CROSS_COMPILE_ARCH),)
 195         DEF_OBJCOPY=/usr/bin/objcopy
 196       else
 197         # Assume objcopy is part of the cross-compilation toolset
 198         ifneq ($(ALT_COMPILER_PATH),)
 199           DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy
 200         endif
 201       endif
 202       OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
 203       ifneq ($(ALT_OBJCOPY),)
 204         _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
 205         OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
 206       endif
 207 
 208       ifeq ($(OBJCOPY),)
 209         _JUNK_ := $(shell \
 210           echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")
 211         ENABLE_FULL_DEBUG_SYMBOLS=0
 212         _JUNK_ := $(shell \
 213           echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
 214       else
 215         _JUNK_ := $(shell \
 216           echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
 217 
 218         # Library stripping policies for .debuginfo configs:
 219         #   all_strip - strips everything from the library
 220         #   min_strip - strips most stuff from the library; leaves minimum symbols
 221         #   no_strip  - does not strip the library at all
 222         #
 223         # Oracle security policy requires "all_strip". A waiver was granted on
 224         # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
 225         #
 226         # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
 227         #
 228         STRIP_POLICY ?= min_strip
 229 
 230         _JUNK_ := $(shell \
 231           echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
 232 
 233         ZIP_DEBUGINFO_FILES ?= 1
 234 
 235         _JUNK_ := $(shell \
 236           echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
 237       endif
 238     endif # ENABLE_FULL_DEBUG_SYMBOLS=1
 239   endif # BUILD_FLAVOR
 240 endif # JDK_6_OR_EARLIER
 241 
 242 JDK_INCLUDE_SUBDIR=linux
 243 
 244 # Library suffix
 245 LIBRARY_SUFFIX=so
 246 
 247 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
 248 
 249 # client and server subdirectories have symbolic links to ../libjsig.so
 250 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
 251 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 252   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 253     EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
 254   else
 255     EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
 256   endif




  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #
  23 #
  24 
  25 # The common definitions for hotspot linux builds.
  26 # Include the top level defs.make under make directory instead of this one.
  27 # This file is included into make/defs.make.
  28 
  29 SLASH_JAVA ?= /java
  30 
  31 define print_info
  32   ifneq ($$(LOG_LEVEL), warn)
  33     $$(shell echo >&2 "INFO: $1")
  34   endif
  35 endef
  36 
  37 # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
  38 
  39 # ARCH can be set explicitly in spec.gmk
  40 ifndef ARCH
  41   ARCH := $(shell uname -m)
  42   # Fold little endian PowerPC64 into big-endian (if ARCH is set in
  43   # hotspot-spec.gmk, this will be done by the configure script).
  44   ifeq ($(ARCH),ppc64le)
  45     ARCH := ppc64
  46   endif
  47 endif
  48 
  49 PATH_SEP ?= :
  50 
  51 ifeq ($(LP64), 1)
  52   ARCH_DATA_MODEL ?= 64
  53 else
  54   ARCH_DATA_MODEL ?= 32
  55 endif
  56 


 174   # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
 175   # product build, the FULL_DEBUG_SYMBOLS environment variable will be
 176   # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
 177   # the same variable name is used, then different values can be picked
 178   # up by different parts of the build. Just to be clear, we only need
 179   # two variable names because the incoming option value can be
 180   # overridden in some situations, e.g., a BUILD_FLAVOR != product
 181   # build.
 182 
 183   # Due to the multiple sub-make processes that occur this logic gets
 184   # executed multiple times. We reduce the noise by at least checking that
 185   # BUILD_FLAVOR has been set.
 186   ifneq ($(BUILD_FLAVOR),)
 187     ifeq ($(BUILD_FLAVOR), product)
 188       FULL_DEBUG_SYMBOLS ?= 1
 189       ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
 190     else
 191       # debug variants always get Full Debug Symbols (if available)
 192       ENABLE_FULL_DEBUG_SYMBOLS = 1
 193     endif
 194     $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))

 195     # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
 196 
 197     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 198       # Default OBJCOPY comes from GNU Binutils on Linux
 199       ifeq ($(CROSS_COMPILE_ARCH),)
 200         DEF_OBJCOPY=/usr/bin/objcopy
 201       else
 202         # Assume objcopy is part of the cross-compilation toolset
 203         ifneq ($(ALT_COMPILER_PATH),)
 204           DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy
 205         endif
 206       endif
 207       OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
 208       ifneq ($(ALT_OBJCOPY),)
 209         $(eval $(call print_info, "ALT_OBJCOPY=$(ALT_OBJCOPY)"))
 210         OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
 211       endif
 212 
 213       ifeq ($(OBJCOPY),)
 214         $(eval $(call print_info, "no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY."))

 215         ENABLE_FULL_DEBUG_SYMBOLS=0
 216         $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))

 217       else
 218         $(eval $(call print_info, "$(OBJCOPY) cmd found so will create .debuginfo files."))

 219 
 220         # Library stripping policies for .debuginfo configs:
 221         #   all_strip - strips everything from the library
 222         #   min_strip - strips most stuff from the library; leaves minimum symbols
 223         #   no_strip  - does not strip the library at all
 224         #
 225         # Oracle security policy requires "all_strip". A waiver was granted on
 226         # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
 227         #
 228         # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
 229         #
 230         STRIP_POLICY ?= min_strip
 231 
 232         $(eval $(call print_info, "STRIP_POLICY=$(STRIP_POLICY)"))

 233 
 234         ZIP_DEBUGINFO_FILES ?= 1
 235 
 236         $(eval $(call print_info, "ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)"))

 237       endif
 238     endif # ENABLE_FULL_DEBUG_SYMBOLS=1
 239   endif # BUILD_FLAVOR
 240 endif # JDK_6_OR_EARLIER
 241 
 242 JDK_INCLUDE_SUBDIR=linux
 243 
 244 # Library suffix
 245 LIBRARY_SUFFIX=so
 246 
 247 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
 248 
 249 # client and server subdirectories have symbolic links to ../libjsig.so
 250 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
 251 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 252   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 253     EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz
 254   else
 255     EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
 256   endif