hotspot/make/lib/CompileJvm.gmk
author sspitsyn
Wed, 03 May 2017 02:32:02 +0000
changeset 46426 02a1fc064144
parent 44411 8c642d0b237e
child 46560 388aa8d67c80
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     1
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     2
# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     4
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    10
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    15
# accompanied this code).
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    16
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    20
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    23
# questions.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    24
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    25
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    26
# Include support files that will setup compiler flags due to the selected
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    27
# jvm feature set, and specific file overrides.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    28
include lib/JvmFeatures.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    29
include lib/JvmOverrideFiles.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    30
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    31
$(eval $(call IncludeCustomExtension, hotspot, lib/CompileJvm.gmk))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    32
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    33
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    34
# Setup compilation of the main Hotspot native library (libjvm).
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    35
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    36
JVM_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/libjvm
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    37
JVM_MAPFILE := $(JVM_OUTPUTDIR)/mapfile
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    38
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    39
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    40
# Platform independent setup
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    41
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    42
# This variable may be added to by a custom extension
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    43
JVM_SRC_ROOTS += $(HOTSPOT_TOPDIR)/src
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    44
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    45
JVM_SRC_DIRS += $(call uniq, $(wildcard $(foreach d, $(JVM_SRC_ROOTS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    46
        $d/share/vm \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    47
        $d/os/$(HOTSPOT_TARGET_OS)/vm \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    48
        $d/os/$(HOTSPOT_TARGET_OS_TYPE)/vm \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    49
        $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/vm \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    50
        $d/os_cpu/$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH)/vm \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    51
    ))) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    52
    $(JVM_VARIANT_OUTPUTDIR)/gensrc/jvmtifiles \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    53
    $(JVM_VARIANT_OUTPUTDIR)/gensrc/tracefiles \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    54
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    55
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    56
JVM_CFLAGS_INCLUDES += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    57
    $(patsubst %,-I%,$(filter-out $(JVM_VARIANT_OUTPUTDIR)/gensrc/%, $(JVM_SRC_DIRS))) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    58
    -I$(JVM_VARIANT_OUTPUTDIR)/gensrc \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    59
    -I$(HOTSPOT_TOPDIR)/src/share/vm/precompiled \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    60
    -I$(HOTSPOT_TOPDIR)/src/share/vm/prims \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    61
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    62
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    63
# INCLUDE_SUFFIX_* is only meant for including the proper
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    64
# platform files. Don't use it to guard code. Use the value of
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    65
# HOTSPOT_TARGET_CPU_DEFINE etc. instead.
43402
caa829a4272a 8004842: Unify values of boolean make variables set in configure to true/false
ihse
parents: 42664
diff changeset
    66
# Remaining TARGET_ARCH_* is needed to select the cpu specific
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
    67
# sources for 64-bit ARM ports (arm versus aarch64).
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    68
JVM_CFLAGS_TARGET_DEFINES += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    69
    -DTARGET_ARCH_$(HOTSPOT_TARGET_CPU_ARCH) \
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    70
    -DINCLUDE_SUFFIX_OS=_$(HOTSPOT_TARGET_OS) \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    71
    -DINCLUDE_SUFFIX_CPU=_$(HOTSPOT_TARGET_CPU_ARCH) \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    72
    -DTARGET_COMPILER_$(HOTSPOT_TOOLCHAIN_TYPE) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    73
    -D$(HOTSPOT_TARGET_CPU_DEFINE) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    74
    -DHOTSPOT_LIB_ARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    75
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    76
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    77
ifeq ($(DEBUG_LEVEL), release)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    78
  # For hotspot, release builds differ internally between "optimized" and "product"
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    79
  # in that "optimize" does not define PRODUCT.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
  ifneq ($(HOTSPOT_DEBUG_LEVEL), optimized)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
    JVM_CFLAGS_DEBUGLEVEL := -DPRODUCT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    82
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    83
else ifeq ($(DEBUG_LEVEL), fastdebug)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    84
  JVM_CFLAGS_DEBUGLEVEL := -DASSERT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    85
  ifeq ($(filter $(OPENJDK_TARGET_OS), windows aix), )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    86
    # NOTE: Old build did not define CHECK_UNHANDLED_OOPS on Windows and AIX.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
    JVM_CFLAGS_DEBUGLEVEL += -DCHECK_UNHANDLED_OOPS
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    89
else ifeq ($(DEBUG_LEVEL), slowdebug)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    90
  # _NMT_NOINLINE_ informs NMT that no inlining is done by the compiler
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
  JVM_CFLAGS_DEBUGLEVEL := -DASSERT -D_NMT_NOINLINE_
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    92
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    94
JVM_CFLAGS += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    95
    $(JVM_CFLAGS_DEBUGLEVEL) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    96
    $(JVM_CFLAGS_TARGET_DEFINES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
    $(JVM_CFLAGS_FEATURES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    98
    $(JVM_CFLAGS_INCLUDES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    99
    $(EXTRA_CFLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   100
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   101
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   102
JVM_LDFLAGS += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   103
    $(SHARED_LIBRARY_FLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   104
    $(JVM_LDFLAGS_FEATURES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   105
    $(EXTRA_LDFLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   106
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   107
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   108
JVM_LIBS += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   109
    $(JVM_LIBS_FEATURES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   110
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   111
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   112
# These files and directories are always excluded
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   113
JVM_EXCLUDE_FILES += jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp args.cc
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   114
JVM_EXCLUDES += adlc
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   115
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   116
# Needed by vm_version.cpp
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   117
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   118
  OPENJDK_TARGET_CPU_VM_VERSION := amd64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   119
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   120
  OPENJDK_TARGET_CPU_VM_VERSION := sparc
44411
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   121
else ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm)
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   122
  ifeq ($(OPENJDK_TARGET_CPU), aarch64)
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   123
    # This sets the Oracle Aarch64 port to use arm64
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   124
    # while the original Aarch64 port uses aarch64
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   125
    OPENJDK_TARGET_CPU_VM_VERSION := arm64
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   126
  endif
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   127
else
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   128
  OPENJDK_TARGET_CPU_VM_VERSION := $(OPENJDK_TARGET_CPU)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   129
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   130
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   131
CFLAGS_VM_VERSION := \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   132
    $(VERSION_CFLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   133
    -DHOTSPOT_VERSION_STRING='"$(VERSION_STRING)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   134
    -DDEBUG_LEVEL='"$(DEBUG_LEVEL)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   135
    -DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   136
    -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   137
    -DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   138
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   139
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   140
# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
43402
caa829a4272a 8004842: Unify values of boolean make variables set in configure to true/false
ihse
parents: 42664
diff changeset
   141
ifeq ($(USE_PRECOMPILED_HEADER), false)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   142
  JVM_CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   143
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   144
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   145
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   146
# Platform specific setup
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   147
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   148
# ARM source selection
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   149
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   150
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), linux-arm)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   151
  JVM_EXCLUDE_PATTERNS += arm_64
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   152
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   153
else ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), linux-aarch64)
43402
caa829a4272a 8004842: Unify values of boolean make variables set in configure to true/false
ihse
parents: 42664
diff changeset
   154
  # For 64-bit arm builds, we use the 64 bit hotspot/src/cpu/arm
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   155
  # hotspot sources if HOTSPOT_TARGET_CPU_ARCH is set to arm.
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   156
  # Exclude the aarch64 and 32 bit arm files for this build.
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   157
  ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   158
    JVM_EXCLUDE_PATTERNS += arm_32 aarch64
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   159
  endif
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   160
endif
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   161
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   162
ifneq ($(filter $(OPENJDK_TARGET_OS), linux macosx windows), )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   163
  JVM_PRECOMPILED_HEADER := $(HOTSPOT_TOPDIR)/src/share/vm/precompiled/precompiled.hpp
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   164
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   165
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   166
ifeq ($(OPENJDK_TARGET_CPU), x86)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   167
  JVM_EXCLUDE_PATTERNS += x86_64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   168
else ifeq ($(OPENJDK_TARGET_CPU), x86_64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   169
  JVM_EXCLUDE_PATTERNS += x86_32
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   170
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   171
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   172
# Inline assembly for solaris
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   173
ifeq ($(OPENJDK_TARGET_OS), solaris)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   174
  ifeq ($(OPENJDK_TARGET_CPU), x86_64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   175
    JVM_CFLAGS += $(HOTSPOT_TOPDIR)/src/os_cpu/solaris_x86/vm/solaris_x86_64.il
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   176
  else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   177
    JVM_CFLAGS += $(HOTSPOT_TOPDIR)/src/os_cpu/solaris_sparc/vm/solaris_sparc.il
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   178
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   179
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   180
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   181
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   182
  ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), false)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   183
    # NOTE: In the old build, we weirdly enough set -g/-g0 always, regardless
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   184
    # of if debug symbols were needed. Without it, compilation fails on
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   185
    # sparc! :-(
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   186
    JVM_CFLAGS += -g0
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   187
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   188
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   189
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   190
ifeq ($(OPENJDK_TARGET_OS), windows)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   191
  ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   192
    RC_DESC := 64-Bit$(SPACE)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   193
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   194
  JVM_RCFLAGS += -D"HS_FILEDESC=$(HOTSPOT_VM_DISTRO) $(RC_DESC)$(JVM_VARIANT) VM"
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   195
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   196
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   197
JVM_OPTIMIZATION ?= HIGHEST_JVM
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   198
41674
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   199
# Need to set JVM_STRIPFLAGS to the default value from SPEC since the STRIPFLAGS
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   200
# parameter to SetupNativeCompilation allows an empty value to override the
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   201
# default.
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   202
JVM_STRIPFLAGS ?= $(STRIPFLAGS)
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   203
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   204
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   205
# Now set up the actual compilation of the main hotspot native library
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   206
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   207
$(eval $(call SetupNativeCompilation, BUILD_LIBJVM, \
41193
9e274c9c3047 8160630: libjimage.so and others should link statically to libgcc
erikj
parents: 40010
diff changeset
   208
    TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   209
    LIBRARY := jvm, \
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   210
    OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   211
    SRC := $(JVM_SRC_DIRS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   212
    EXCLUDES := $(JVM_EXCLUDES), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   213
    EXCLUDE_FILES := $(JVM_EXCLUDE_FILES), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   214
    EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   215
    EXTRA_OBJECT_FILES := $(DTRACE_EXTRA_OBJECT_FILES), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   216
    CFLAGS := $(JVM_CFLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   217
    CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   218
    CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   219
    vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   220
    DISABLED_WARNINGS_clang := delete-non-virtual-dtor dynamic-class-memaccess \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   221
        empty-body format logical-op-parentheses parentheses \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   222
        parentheses-equality switch tautological-compare, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   223
    DISABLED_WARNINGS_xlc := 1540-0216 1540-0198 1540-1090 1540-1639 \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   224
        1540-1088 1500-010, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   225
    ASFLAGS := $(JVM_ASFLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   226
    LDFLAGS := $(JVM_LDFLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   227
    LIBS := $(JVM_LIBS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   228
    OPTIMIZATION := $(JVM_OPTIMIZATION), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   229
    OBJECT_DIR := $(JVM_OUTPUTDIR)/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   230
    MAPFILE := $(JVM_MAPFILE), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   231
    USE_MAPFILE_FOR_SYMBOLS := true, \
41674
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   232
    STRIPFLAGS := $(JVM_STRIPFLAGS), \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   233
    EMBED_MANIFEST := true, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   234
    RC_FLAGS := $(JVM_RCFLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   235
    VERSIONINFO_RESOURCE := $(HOTSPOT_TOPDIR)/src/os/windows/vm/version.rc, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   236
    PRECOMPILED_HEADER := $(JVM_PRECOMPILED_HEADER), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   237
    PRECOMPILED_HEADER_EXCLUDE := $(JVM_PRECOMPILED_HEADER_EXCLUDE), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   238
))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   239
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   240
ifeq ($(OPENJDK_TARGET_OS), windows)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   241
  # It doesn't matter which jvm.lib file gets exported, but we need
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   242
  # to pick just one.
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   243
  ifeq ($(JVM_VARIANT), $(firstword $(JVM_VARIANTS)))
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   244
    $(eval $(call SetupCopyFiles, COPY_JVM_LIB, \
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   245
        DEST := $(LIB_OUTPUTDIR), \
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   246
        FILES :=$(JVM_VARIANT_OUTPUTDIR)/libjvm/objs/jvm.lib, \
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   247
    ))
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   248
    TARGETS += $(COPY_JVM_LIB)
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   249
  endif
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   250
endif
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   251
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   252
# AIX warning explanation:
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   253
# 1500-010  : (W) WARNING in ...: Infinite loop.  Program may not stop.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   254
#             There are several infinite loops in the vm, so better suppress.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   255
# 1540-0198 : (W) The omitted keyword "private" is assumed for base class "...".
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   256
# 1540-0216 : (W) An expression of type .. cannot be converted to type ..
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   257
#             In hotspot this fires for functionpointer to pointer conversions
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   258
# 1540-1088 : (W) The exception specification is being ignored.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   259
#             In hotspot this is caused by throw() in declaration of new() in nmethod.hpp.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   260
# 1540-1090 : (I) The destructor of "..." might not be called.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   261
# 1540-1639 : (I) The behavior of long type bit fields has changed ...
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   262
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   263
# Include mapfile generation. It relies on BUILD_LIBJVM_ALL_OBJS which is only
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   264
# defined after the above call to BUILD_LIBJVM. Mapfile will be generated
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   265
# after all object files are built, but before the jvm library is linked.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   266
include lib/JvmMapfile.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   267
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   268
TARGETS += $(BUILD_LIBJVM)