make/hotspot/lib/CompileJvm.gmk
author michaelm
Wed, 29 Nov 2017 16:59:38 +0000
branchhttp-client-branch
changeset 55912 dfa9489d1cb1
parent 47871 5ab3961d20dd
child 48021 3bb4d90d1ebc
child 48093 2cb07c3778e1
permissions -rw-r--r--
http-client-branch: fixed Http2TestServerConnection problem
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     1
#
46560
388aa8d67c80 8181449: Fix debug.hpp / globalDefinitions.hpp dependency inversion
kbarrett
parents: 44411
diff changeset
     2
# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
37437
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
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47217
diff changeset
    31
$(eval $(call IncludeCustomExtension, hotspot/lib/CompileJvm.gmk))
37437
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
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    43
JVM_SRC_ROOTS += $(TOPDIR)/src/hotspot
37437
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), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    46
        $d/share \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    47
        $d/os/$(HOTSPOT_TARGET_OS) \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    48
        $d/os/$(HOTSPOT_TARGET_OS_TYPE) \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    49
        $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH) \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    50
        $d/os_cpu/$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH) \
37437
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 \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    59
    -I$(TOPDIR)/src/hotspot/share/precompiled \
47646
c20cc2d3aa39 8189607: Remove duplicated jvmticmlr.h
ihse
parents: 47314
diff changeset
    60
    -I$(TOPDIR)/src/java.base/share/native/include \
47765
b7c7428eaab9 8189610: Reconcile jvm.h and all jvm_md.h between java.base and hotspot
coleenp
parents: 47646
diff changeset
    61
    -I$(TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/native/include \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    62
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    63
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    64
# INCLUDE_SUFFIX_* is only meant for including the proper
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    65
# platform files. Don't use it to guard code. Use the value of
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    66
# 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
    67
# Remaining TARGET_ARCH_* is needed to select the cpu specific
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
    68
# sources for 64-bit ARM ports (arm versus aarch64).
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    69
JVM_CFLAGS_TARGET_DEFINES += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    70
    -DTARGET_ARCH_$(HOTSPOT_TARGET_CPU_ARCH) \
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    71
    -DINCLUDE_SUFFIX_OS=_$(HOTSPOT_TARGET_OS) \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 38097
diff changeset
    72
    -DINCLUDE_SUFFIX_CPU=_$(HOTSPOT_TARGET_CPU_ARCH) \
46560
388aa8d67c80 8181449: Fix debug.hpp / globalDefinitions.hpp dependency inversion
kbarrett
parents: 44411
diff changeset
    73
    -DINCLUDE_SUFFIX_COMPILER=_$(HOTSPOT_TOOLCHAIN_TYPE) \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    74
    -DTARGET_COMPILER_$(HOTSPOT_TOOLCHAIN_TYPE) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    75
    -D$(HOTSPOT_TARGET_CPU_DEFINE) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    76
    -DHOTSPOT_LIB_ARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    77
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    78
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    79
ifeq ($(DEBUG_LEVEL), release)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
  # For hotspot, release builds differ internally between "optimized" and "product"
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
  # in that "optimize" does not define PRODUCT.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    82
  ifneq ($(HOTSPOT_DEBUG_LEVEL), optimized)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    83
    JVM_CFLAGS_DEBUGLEVEL := -DPRODUCT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    84
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    85
else ifeq ($(DEBUG_LEVEL), fastdebug)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    86
  JVM_CFLAGS_DEBUGLEVEL := -DASSERT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
  ifeq ($(filter $(OPENJDK_TARGET_OS), windows aix), )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
    # NOTE: Old build did not define CHECK_UNHANDLED_OOPS on Windows and AIX.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    89
    JVM_CFLAGS_DEBUGLEVEL += -DCHECK_UNHANDLED_OOPS
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    90
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
else ifeq ($(DEBUG_LEVEL), slowdebug)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    92
  # _NMT_NOINLINE_ informs NMT that no inlining is done by the compiler
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
  JVM_CFLAGS_DEBUGLEVEL := -DASSERT -D_NMT_NOINLINE_
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    94
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    95
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    96
JVM_CFLAGS += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
    $(JVM_CFLAGS_DEBUGLEVEL) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    98
    $(JVM_CFLAGS_TARGET_DEFINES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    99
    $(JVM_CFLAGS_FEATURES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   100
    $(JVM_CFLAGS_INCLUDES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   101
    $(EXTRA_CFLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   102
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   103
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   104
JVM_LDFLAGS += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   105
    $(SHARED_LIBRARY_FLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   106
    $(JVM_LDFLAGS_FEATURES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   107
    $(EXTRA_LDFLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   108
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   109
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   110
JVM_LIBS += \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   111
    $(JVM_LIBS_FEATURES) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   112
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   113
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   114
# These files and directories are always excluded
47871
5ab3961d20dd 8191204: Post-consolidation cleaning up of the build system
ihse
parents: 47765
diff changeset
   115
JVM_EXCLUDE_FILES += jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp args.cc
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   116
JVM_EXCLUDES += adlc
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   117
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   118
# Needed by vm_version.cpp
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   119
ifeq ($(OPENJDK_TARGET_CPU), x86_64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   120
  OPENJDK_TARGET_CPU_VM_VERSION := amd64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   121
else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   122
  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
   123
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
   124
  ifeq ($(OPENJDK_TARGET_CPU), aarch64)
8c642d0b237e 8177390: java -version does not differentiate between which port of AArch64 is used
neugens
parents: 43402
diff changeset
   125
    # 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
   126
    # 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
   127
    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
   128
  endif
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   129
else
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   130
  OPENJDK_TARGET_CPU_VM_VERSION := $(OPENJDK_TARGET_CPU)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   131
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   132
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   133
CFLAGS_VM_VERSION := \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   134
    $(VERSION_CFLAGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   135
    -DHOTSPOT_VERSION_STRING='"$(VERSION_STRING)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   136
    -DDEBUG_LEVEL='"$(DEBUG_LEVEL)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   137
    -DHOTSPOT_BUILD_USER='"$(USERNAME)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   138
    -DHOTSPOT_VM_DISTRO='"$(HOTSPOT_VM_DISTRO)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   139
    -DCPU='"$(OPENJDK_TARGET_CPU_VM_VERSION)"' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   140
    #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   141
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   142
# -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
   143
ifeq ($(USE_PRECOMPILED_HEADER), false)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   144
  JVM_CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   145
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   146
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   147
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   148
# Platform specific setup
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   149
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   150
# ARM source selection
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   151
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   152
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), linux-arm)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   153
  JVM_EXCLUDE_PATTERNS += arm_64
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   154
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   155
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
   156
  # 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
   157
  # hotspot sources if HOTSPOT_TARGET_CPU_ARCH is set to arm.
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   158
  # Exclude the aarch64 and 32 bit arm files for this build.
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   159
  ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   160
    JVM_EXCLUDE_PATTERNS += arm_32 aarch64
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   161
  endif
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   162
endif
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 41692
diff changeset
   163
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   164
ifneq ($(filter $(OPENJDK_TARGET_OS), linux macosx windows), )
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   165
  JVM_PRECOMPILED_HEADER := $(TOPDIR)/src/hotspot/share/precompiled/precompiled.hpp
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   166
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   167
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   168
ifeq ($(OPENJDK_TARGET_CPU), x86)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   169
  JVM_EXCLUDE_PATTERNS += x86_64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   170
else ifeq ($(OPENJDK_TARGET_CPU), x86_64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   171
  JVM_EXCLUDE_PATTERNS += x86_32
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   172
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   173
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   174
# Inline assembly for solaris
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   175
ifeq ($(OPENJDK_TARGET_OS), solaris)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   176
  ifeq ($(OPENJDK_TARGET_CPU), x86_64)
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   177
    JVM_CFLAGS += $(TOPDIR)/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.il
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   178
  else ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   179
    JVM_CFLAGS += $(TOPDIR)/src/hotspot/os_cpu/solaris_sparc/solaris_sparc.il
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   180
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   181
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   182
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   183
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), solaris-sparcv9)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   184
  ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), false)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   185
    # NOTE: In the old build, we weirdly enough set -g/-g0 always, regardless
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   186
    # of if debug symbols were needed. Without it, compilation fails on
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   187
    # sparc! :-(
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   188
    JVM_CFLAGS += -g0
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   189
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   190
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   191
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   192
ifeq ($(OPENJDK_TARGET_OS), windows)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   193
  ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   194
    RC_DESC := 64-Bit$(SPACE)
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
  JVM_RCFLAGS += -D"HS_FILEDESC=$(HOTSPOT_VM_DISTRO) $(RC_DESC)$(JVM_VARIANT) VM"
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   197
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   198
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   199
JVM_OPTIMIZATION ?= HIGHEST_JVM
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   200
41674
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   201
# 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
   202
# 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
   203
# default.
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   204
JVM_STRIPFLAGS ?= $(STRIPFLAGS)
8ff2f216109b 8164120: The minimal VM should be stripped using --strip-unneeded
erikj
parents: 40010
diff changeset
   205
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   206
################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   207
# Now set up the actual compilation of the main hotspot native library
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   208
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   209
$(eval $(call SetupNativeCompilation, BUILD_LIBJVM, \
41193
9e274c9c3047 8160630: libjimage.so and others should link statically to libgcc
erikj
parents: 40010
diff changeset
   210
    TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   211
    LIBRARY := jvm, \
41277
65200988b2ee 8150736: Excessive disk space used by build system
erikj
parents: 41193
diff changeset
   212
    OUTPUT_DIR := $(JVM_LIB_OUTPUTDIR), \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   213
    SRC := $(JVM_SRC_DIRS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   214
    EXCLUDES := $(JVM_EXCLUDES), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   215
    EXCLUDE_FILES := $(JVM_EXCLUDE_FILES), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   216
    EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   217
    EXTRA_OBJECT_FILES := $(DTRACE_EXTRA_OBJECT_FILES), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   218
    CFLAGS := $(JVM_CFLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   219
    CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   220
    CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   221
    vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
46630
75aa3e39d02c 8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents: 46560
diff changeset
   222
    DISABLED_WARNINGS_clang := tautological-compare, \
37437
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), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   235
    VERSIONINFO_RESOURCE := $(TOPDIR)/src/hotspot/os/windows/version.rc, \
37437
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)