hotspot/make/solaris/makefiles/defs.make
changeset 33957 39113ae98993
parent 30113 3f6beb804b02
child 34319 9d6dd3c5ca23
equal deleted inserted replaced
30850:56166ce66037 33957:39113ae98993
     1 #
     1 #
     2 # Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     5 # This code is free software; you can redistribute it and/or modify it
     6 # under the terms of the GNU General Public License version 2 only, as
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.
     7 # published by the Free Software Foundation.
    75     JVM_VARIANTS:=server
    75     JVM_VARIANTS:=server
    76     JVM_VARIANT_SERVER:=true
    76     JVM_VARIANT_SERVER:=true
    77   endif
    77   endif
    78 endif
    78 endif
    79 
    79 
    80 # determine if HotSpot is being built in JDK6 or earlier version
    80 # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
    81 JDK6_OR_EARLIER=0
    81 # builds is enabled with debug info files ZIP'ed to save space. For
    82 ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
    82 # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
    83   # if the longer variable names (newer build style) are set, then check those
    83 # debug build without debug info isn't very useful.
    84   ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1"
    84 # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
    85     JDK6_OR_EARLIER=1
    85 #
    86   endif
    86 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
    87 else
    87 # disabled for a BUILD_FLAVOR == product build.
    88   # the longer variables aren't set so check the shorter variable names
    88 #
    89   ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1"
    89 # Note: Use of a different variable name for the FDS override option
    90     JDK6_OR_EARLIER=1
    90 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
    91   endif
    91 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
    92 endif
    92 # in options via environment variables, use of distinct variables
    93 
    93 # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
    94 ifeq ($(JDK6_OR_EARLIER),0)
    94 # product build, the FULL_DEBUG_SYMBOLS environment variable will be
    95   # Full Debug Symbols is supported on JDK7 or newer.
    95 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
    96   # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
    96 # the same variable name is used, then different values can be picked
    97   # builds is enabled with debug info files ZIP'ed to save space. For
    97 # up by different parts of the build. Just to be clear, we only need
    98   # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
    98 # two variable names because the incoming option value can be
    99   # debug build without debug info isn't very useful.
    99 # overridden in some situations, e.g., a BUILD_FLAVOR != product
   100   # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
   100 # build.
   101   #
   101 
   102   # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
   102 # Due to the multiple sub-make processes that occur this logic gets
   103   # disabled for a BUILD_FLAVOR == product build.
   103 # executed multiple times. We reduce the noise by at least checking that
   104   #
   104 # BUILD_FLAVOR has been set.
   105   # Note: Use of a different variable name for the FDS override option
   105 ifneq ($(BUILD_FLAVOR),)
   106   # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
   106   ifeq ($(BUILD_FLAVOR), product)
   107   # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
   107     FULL_DEBUG_SYMBOLS ?= 1
   108   # in options via environment variables, use of distinct variables
   108     ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
   109   # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
   109   else
   110   # product build, the FULL_DEBUG_SYMBOLS environment variable will be
   110     # debug variants always get Full Debug Symbols (if available)
   111   # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
   111     ENABLE_FULL_DEBUG_SYMBOLS = 1
   112   # the same variable name is used, then different values can be picked
   112   endif
   113   # up by different parts of the build. Just to be clear, we only need
   113   $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
   114   # two variable names because the incoming option value can be
   114   # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
   115   # overridden in some situations, e.g., a BUILD_FLAVOR != product
   115 
   116   # build.
   116   ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   117 
   117     # Default OBJCOPY comes from the SUNWbinutils package:
   118   # Due to the multiple sub-make processes that occur this logic gets
   118     DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
   119   # executed multiple times. We reduce the noise by at least checking that
   119     OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
   120   # BUILD_FLAVOR has been set.
   120     ifneq ($(ALT_OBJCOPY),)
   121   ifneq ($(BUILD_FLAVOR),)
   121       $(eval $(call print_info, "ALT_OBJCOPY=$(ALT_OBJCOPY)"))
   122     ifeq ($(BUILD_FLAVOR), product)
   122       OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
   123       FULL_DEBUG_SYMBOLS ?= 1
   123     endif
   124       ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
   124 
       
   125     ifneq ($(OBJCOPY),)
       
   126       # OBJCOPY version check:
       
   127       # - version number is last blank separate word on first line
       
   128       # - version number formats that have been seen:
       
   129       #   - <major>.<minor>
       
   130       #   - <major>.<minor>.<micro>
       
   131       #
       
   132       # Full Debug Symbols on Solaris needs version 2.21.1 or newer.
       
   133       #
       
   134       OBJCOPY_VERS_CHK := $(shell \
       
   135         $(OBJCOPY) --version \
       
   136           | sed -n \
       
   137                 -e 's/.* //' \
       
   138                 -e '/^[01]\./b bad' \
       
   139                 -e '/^2\./{' \
       
   140                 -e '  s/^2\.//' \
       
   141                 -e '  /^[0-9]$$/b bad' \
       
   142                 -e '  /^[0-9]\./b bad' \
       
   143                 -e '  /^1[0-9]$$/b bad' \
       
   144                 -e '  /^1[0-9]\./b bad' \
       
   145                 -e '  /^20\./b bad' \
       
   146                 -e '  /^21\.0$$/b bad' \
       
   147                 -e '  /^21\.0\./b bad' \
       
   148                 -e '}' \
       
   149                 -e ':good' \
       
   150                 -e 's/.*/VALID_VERSION/p' \
       
   151                 -e 'q' \
       
   152                 -e ':bad' \
       
   153                 -e 's/.*/BAD_VERSION/p' \
       
   154                 -e 'q' \
       
   155         )
       
   156       ifeq ($(OBJCOPY_VERS_CHK),BAD_VERSION)
       
   157         _JUNK_ := $(shell \
       
   158           echo >&2 "WARNING: $(OBJCOPY) --version info:"; \
       
   159           $(OBJCOPY) --version | sed -n -e 's/^/WARNING: /p' -e 'q' >&2; \
       
   160           echo >&2 "WARNING: an objcopy version of 2.21.1 or newer" \
       
   161             "is needed to create valid .debuginfo files."; \
       
   162           echo >&2 "WARNING: ignoring above objcopy command."; \
       
   163           echo >&2 "WARNING: patch 149063-01 or newer contains the" \
       
   164             "correct Solaris 10 SPARC version."; \
       
   165           echo >&2 "WARNING: patch 149064-01 or newer contains the" \
       
   166             "correct Solaris 10 X86 version."; \
       
   167           echo >&2 "WARNING: Solaris 11 Update 1 contains the" \
       
   168             "correct version."; \
       
   169           )
       
   170         OBJCOPY=
       
   171       endif
       
   172     endif
       
   173 
       
   174     ifeq ($(OBJCOPY),)
       
   175       $(eval $(call print_info, "no objcopy cmd found so cannot create .debuginfo files."))
       
   176       ENABLE_FULL_DEBUG_SYMBOLS=0
       
   177       $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
   125     else
   178     else
   126       # debug variants always get Full Debug Symbols (if available)
   179       $(eval $(call print_info, "$(OBJCOPY) cmd found so will create .debuginfo files."))
   127       ENABLE_FULL_DEBUG_SYMBOLS = 1
   180 
   128     endif
   181       # Library stripping policies for .debuginfo configs:
   129     $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
   182       #   all_strip - strips everything from the library
   130     # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
   183       #   min_strip - strips most stuff from the library; leaves minimum symbols
   131 
   184       #   no_strip  - does not strip the library at all
   132     ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
   185       #
   133       # Default OBJCOPY comes from the SUNWbinutils package:
   186       # Oracle security policy requires "all_strip". A waiver was granted on
   134       DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
   187       # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
   135       OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
   188       #
   136       ifneq ($(ALT_OBJCOPY),)
   189       # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
   137         $(eval $(call print_info, "ALT_OBJCOPY=$(ALT_OBJCOPY)"))
   190       #
   138         OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
   191       STRIP_POLICY ?= min_strip
   139       endif
   192 
   140 
   193       $(eval $(call print_info, "STRIP_POLICY=$(STRIP_POLICY)"))
   141       ifneq ($(OBJCOPY),)
   194 
   142         # OBJCOPY version check:
   195       ZIP_DEBUGINFO_FILES ?= 1
   143         # - version number is last blank separate word on first line
   196 
   144         # - version number formats that have been seen:
   197       $(eval $(call print_info, "ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)"))
   145         #   - <major>.<minor>
   198     endif
   146         #   - <major>.<minor>.<micro>
   199   endif # ENABLE_FULL_DEBUG_SYMBOLS=1
   147         #
   200 endif # BUILD_FLAVOR
   148         # Full Debug Symbols on Solaris needs version 2.21.1 or newer.
       
   149         #
       
   150         OBJCOPY_VERS_CHK := $(shell \
       
   151           $(OBJCOPY) --version \
       
   152             | sed -n \
       
   153                   -e 's/.* //' \
       
   154                   -e '/^[01]\./b bad' \
       
   155                   -e '/^2\./{' \
       
   156                   -e '  s/^2\.//' \
       
   157                   -e '  /^[0-9]$$/b bad' \
       
   158                   -e '  /^[0-9]\./b bad' \
       
   159                   -e '  /^1[0-9]$$/b bad' \
       
   160                   -e '  /^1[0-9]\./b bad' \
       
   161                   -e '  /^20\./b bad' \
       
   162                   -e '  /^21\.0$$/b bad' \
       
   163                   -e '  /^21\.0\./b bad' \
       
   164                   -e '}' \
       
   165                   -e ':good' \
       
   166                   -e 's/.*/VALID_VERSION/p' \
       
   167                   -e 'q' \
       
   168                   -e ':bad' \
       
   169                   -e 's/.*/BAD_VERSION/p' \
       
   170                   -e 'q' \
       
   171           )
       
   172         ifeq ($(OBJCOPY_VERS_CHK),BAD_VERSION)
       
   173           _JUNK_ := $(shell \
       
   174             echo >&2 "WARNING: $(OBJCOPY) --version info:"; \
       
   175             $(OBJCOPY) --version | sed -n -e 's/^/WARNING: /p' -e 'q' >&2; \
       
   176             echo >&2 "WARNING: an objcopy version of 2.21.1 or newer" \
       
   177               "is needed to create valid .debuginfo files."; \
       
   178             echo >&2 "WARNING: ignoring above objcopy command."; \
       
   179             echo >&2 "WARNING: patch 149063-01 or newer contains the" \
       
   180               "correct Solaris 10 SPARC version."; \
       
   181             echo >&2 "WARNING: patch 149064-01 or newer contains the" \
       
   182               "correct Solaris 10 X86 version."; \
       
   183             echo >&2 "WARNING: Solaris 11 Update 1 contains the" \
       
   184               "correct version."; \
       
   185             )
       
   186           OBJCOPY=
       
   187         endif
       
   188       endif
       
   189 
       
   190       ifeq ($(OBJCOPY),)
       
   191         $(eval $(call print_info, "no objcopy cmd found so cannot create .debuginfo files."))
       
   192         ENABLE_FULL_DEBUG_SYMBOLS=0
       
   193         $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)"))
       
   194       else
       
   195         $(eval $(call print_info, "$(OBJCOPY) cmd found so will create .debuginfo files."))
       
   196 
       
   197         # Library stripping policies for .debuginfo configs:
       
   198         #   all_strip - strips everything from the library
       
   199         #   min_strip - strips most stuff from the library; leaves minimum symbols
       
   200         #   no_strip  - does not strip the library at all
       
   201         #
       
   202         # Oracle security policy requires "all_strip". A waiver was granted on
       
   203         # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
       
   204         #
       
   205         # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
       
   206         #
       
   207         STRIP_POLICY ?= min_strip
       
   208 
       
   209         $(eval $(call print_info, "STRIP_POLICY=$(STRIP_POLICY)"))
       
   210 
       
   211         ZIP_DEBUGINFO_FILES ?= 1
       
   212 
       
   213         $(eval $(call print_info, "ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)"))
       
   214       endif
       
   215     endif # ENABLE_FULL_DEBUG_SYMBOLS=1
       
   216   endif # BUILD_FLAVOR
       
   217 endif # JDK_6_OR_EARLIER
       
   218 
   201 
   219 JDK_INCLUDE_SUBDIR=solaris
   202 JDK_INCLUDE_SUBDIR=solaris
   220 
   203 
   221 # Library suffix
   204 # Library suffix
   222 LIBRARY_SUFFIX=so
   205 LIBRARY_SUFFIX=so