jdk/make/common/shared/Compiler-sun.gmk
author jlaskey
Tue, 19 Feb 2013 09:47:02 -0400
changeset 16248 e4bcc4b4f897
parent 14342 8435a30053c1
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
#
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 9350
diff changeset
     2
# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2186
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2186
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
# accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
#
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2186
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2186
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2186
diff changeset
    23
# questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
# Sun Studio Compiler settings
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
# Sun Studio Compiler settings specific to Solaris
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
ifeq ($(PLATFORM), solaris)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
  CC             = $(COMPILER_PATH)cc
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
  CPP            = $(COMPILER_PATH)cc -E
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
  CXX            = $(COMPILER_PATH)CC
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
  LINT           = $(COMPILER_PATH)lint
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
  # Option used to create a shared library
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
  SHARED_LIBRARY_FLAG = -G
2158
68869a085470 6799141: Build with --hash-style=both so that binaries can work on SuSE 10
ohair
parents: 918
diff changeset
    38
  GCC =$(GCC_COMPILER_PATH)gcc
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
# Sun Studio Compiler settings specific to Linux
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
ifeq ($(PLATFORM), linux)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
  # This has not been tested
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
  CC             = $(COMPILER_PATH)cc
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
  CPP            = $(COMPILER_PATH)cc -E
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
  CXX            = $(COMPILER_PATH)CC
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
  LINT           = $(COMPILER_PATH)lint
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
  # statically link libstdc++ before C++ ABI is stablized on Linux
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
  STATIC_CXX     = true
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
  ifeq ($(STATIC_CXX),true)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    # CC always dynamically links libstdc++, even we use "-Wl,-Bstatic -lstdc++"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    # We need to use cc to statically link the C++ runtime.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    CXX            = $(COMPILER_PATH)cc
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
  else
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    CXX            = $(COMPILER_PATH)CC
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
  endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
  # Option used to create a shared library
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
  SHARED_LIBRARY_FLAG = -G
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
endif
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
# Get compiler version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
_CC_VER :=$(shell $(CC) -V 2>&1 | $(HEAD) -n 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
CC_VER  :=$(call GetVersion,"$(_CC_VER)")
7485
e9e65ce0013a 6980281: SWAT: SwingSet2 got core dumped in Solaris-AMD64 using b107 swat build
bae
parents: 6373
diff changeset
    64
CC_MAJORVER  :=$(call MajorVersion,$(CC_VER))
6373
23ec4a141fc9 6974017: Upgrade required Solaris Studio compilers to 5.10 (12 update 1 + patches)
ohair
parents: 5506
diff changeset
    65
CC_MINORVER  :=$(call MinorVersion,$(CC_VER))
2186
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    66
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    67
# Name of compilers being used
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    68
COMPILER_VERSION-5.7  = SS10
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    69
COMPILER_NAME-5.7     = Sun Studio 10
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    70
COMPILER_VERSION-5.8  = SS11
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    71
COMPILER_NAME-5.8     = Sun Studio 11
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    72
COMPILER_VERSION-5.9  = SS12
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    73
COMPILER_NAME-5.9     = Sun Studio 12
6373
23ec4a141fc9 6974017: Upgrade required Solaris Studio compilers to 5.10 (12 update 1 + patches)
ohair
parents: 5506
diff changeset
    74
COMPILER_VERSION-5.10 = SS12u1
23ec4a141fc9 6974017: Upgrade required Solaris Studio compilers to 5.10 (12 update 1 + patches)
ohair
parents: 5506
diff changeset
    75
COMPILER_NAME-5.10    = Sun Studio 12 Update 1
23ec4a141fc9 6974017: Upgrade required Solaris Studio compilers to 5.10 (12 update 1 + patches)
ohair
parents: 5506
diff changeset
    76
COMPILER_VERSION-5.11 = OSS12u2
23ec4a141fc9 6974017: Upgrade required Solaris Studio compilers to 5.10 (12 update 1 + patches)
ohair
parents: 5506
diff changeset
    77
COMPILER_NAME-5.11    = Oracle Solaris Studio 12 Update 2
2186
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    78
COMPILER_VERSION      = $(COMPILER_VERSION-$(CC_VER))
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    79
COMPILER_NAME         = $(COMPILER_NAME-$(CC_VER))
53da56fa3bf9 6816311: Changes to allow builds with latest Windows SDK 6.1 on 64bit Windows 2003
ohair
parents: 2158
diff changeset
    80
642
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    81
# Arch specific settings (determines type of .o files and instruction set)
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    82
#  Starting in SS12 (5.9), the arch options changed.
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    83
#  The assembler /usr/ccs/bin/as wants older SS11 (5.8) style options.
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    84
#   Note: We need to have both 32 and 64 values at all times for awt Makefiles.
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    85
#
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    86
XARCH_OPTION_OLD/32 =
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    87
XARCH_OPTION_OLD/64 =
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    88
XARCH_OPTION_NEW/32 = -m32
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    89
XARCH_OPTION_NEW/64 = -m64
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    90
# Lint options are slightly different
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    91
LINT_XARCH_OPTION_OLD/32 =
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    92
LINT_XARCH_OPTION_OLD/64 =
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    93
LINT_XARCH_OPTION_NEW/32 = -m32
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    94
LINT_XARCH_OPTION_NEW/64 = -m64
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    95
ifeq ($(ARCH_FAMILY), sparc)
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    96
  ifdef VIS_NEEDED
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    97
    XARCH_OPTION_OLD/32 += -xarch=v8plusa
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    98
    XARCH_OPTION_OLD/64 += -xarch=v9a
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
    99
    XARCH_OPTION_NEW/32 += -xarch=sparcvis
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   100
    XARCH_OPTION_NEW/64 += -xarch=sparcvis
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   101
  else
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   102
    # Someday this should change to improve optimization on UltraSPARC
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   103
    #    and abandon v8, even change to sparcvis or sparcvis2, this
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   104
    #    abandons machines like the SPARCstation 10.
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   105
    #    Indications with jdk6 is that alacrity runs do not show a
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   106
    #    big improvement using v8plus over v8, but other benchmarks might.
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   107
    XARCH_OPTION_OLD/32 += -xarch=v8
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   108
    XARCH_OPTION_OLD/64 += -xarch=v9
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   109
    # Note that this new option (SS12+) effectively means v8plus
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   110
    XARCH_OPTION_NEW/32 += -xarch=sparc
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   111
    XARCH_OPTION_NEW/64 += -xarch=sparc
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   112
  endif
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   113
  LINT_XARCH_OPTION_OLD/64 += -Xarch=v9
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   114
endif
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   115
ifeq ($(ARCH_FAMILY), i586)
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   116
  XARCH_OPTION_OLD/64      += -xarch=amd64
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   117
  LINT_XARCH_OPTION_OLD/64 += -Xarch=amd64
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   118
endif
6373
23ec4a141fc9 6974017: Upgrade required Solaris Studio compilers to 5.10 (12 update 1 + patches)
ohair
parents: 5506
diff changeset
   119
# Pick the options we want based on the compiler being used. (5.9 or newer)
9350
799e0bb89242 7038711: Fix CC_VER checks for compiler options, fix use of -Wno-clobber
ohair
parents: 7668
diff changeset
   120
CC_59_OR_NEWER := \
799e0bb89242 7038711: Fix CC_VER checks for compiler options, fix use of -Wno-clobber
ohair
parents: 7668
diff changeset
   121
  $(shell expr $(CC_MAJORVER) \> 5 \| \
799e0bb89242 7038711: Fix CC_VER checks for compiler options, fix use of -Wno-clobber
ohair
parents: 7668
diff changeset
   122
      \( $(CC_MAJORVER) = 5 \& $(CC_MINORVER) \>= 9 \) )
799e0bb89242 7038711: Fix CC_VER checks for compiler options, fix use of -Wno-clobber
ohair
parents: 7668
diff changeset
   123
ifeq ($(CC_59_OR_NEWER), 1)
642
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   124
  XARCH_OPTION/32 = $(XARCH_OPTION_NEW/32)
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   125
  XARCH_OPTION/64 = $(XARCH_OPTION_NEW/64)
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   126
  LINT_XARCH_OPTION/32 = $(LINT_XARCH_OPTION_NEW/32)
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   127
  LINT_XARCH_OPTION/64 = $(LINT_XARCH_OPTION_NEW/64)
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   128
else
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   129
  XARCH_OPTION/32 = $(XARCH_OPTION_OLD/32)
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   130
  XARCH_OPTION/64 = $(XARCH_OPTION_OLD/64)
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   131
  LINT_XARCH_OPTION/32 = $(LINT_XARCH_OPTION_OLD/32)
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   132
  LINT_XARCH_OPTION/64 = $(LINT_XARCH_OPTION_OLD/64)
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   133
endif
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   134
XARCH_OPTION = $(XARCH_OPTION/$(ARCH_DATA_MODEL))
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   135
LINT_XARCH_OPTION = $(LINT_XARCH_OPTION/$(ARCH_DATA_MODEL))
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   136
# The /usr/ccs/bin/as assembler always wants the older SS11 (5.8) options.
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   137
AS_XARCH_OPTION = $(XARCH_OPTION_OLD/$(ARCH_DATA_MODEL))
d1f02d5e4c74 6563752: Build and test JDK7 with Sun Studio 12 Express compilers (prep makefiles)
ohair
parents: 2
diff changeset
   138