make/linux/makefiles/vm.make

Wed, 03 Jul 2019 20:42:37 +0800

author
aoqi
date
Wed, 03 Jul 2019 20:42:37 +0800
changeset 9637
eef07cd490d4
parent 9448
73d689add964
parent 9634
d1520f0c3524
child 9852
70aa912cebe5
permissions
-rw-r--r--

Merge

duke@435 1 #
andrew@9634 2 # Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved.
duke@435 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 #
duke@435 5 # This code is free software; you can redistribute it and/or modify it
duke@435 6 # under the terms of the GNU General Public License version 2 only, as
duke@435 7 # published by the Free Software Foundation.
duke@435 8 #
duke@435 9 # This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 # version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 # accompanied this code).
duke@435 14 #
duke@435 15 # You should have received a copy of the GNU General Public License version
duke@435 16 # 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 #
trims@1907 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 # or visit www.oracle.com if you need additional information or have any
trims@1907 21 # questions.
sla@5237 22 #
duke@435 23 #
duke@435 24
aoqi@1 25 #
aoqi@9137 26 # This file has been modified by Loongson Technology in 2018. These
aoqi@9137 27 # modifications are Copyright (c) 2018 Loongson Technology, and are made
aoqi@1 28 # available on the same license terms set forth above.
aoqi@1 29 #
aoqi@1 30
duke@435 31 # Rules to build JVM and related libraries, included from vm.make in the build
duke@435 32 # directory.
duke@435 33
duke@435 34 # Common build rules.
kamg@526 35 MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
duke@435 36 include $(MAKEFILES_DIR)/rules.make
kamg@2515 37 include $(GAMMADIR)/make/altsrc.make
duke@435 38
duke@435 39 default: build
duke@435 40
duke@435 41 #----------------------------------------------------------------------
duke@435 42 # Defs
duke@435 43
duke@435 44 GENERATED = ../generated
stefank@2314 45 DEP_DIR = $(GENERATED)/dependencies
duke@435 46
stefank@2314 47 # reads the generated files defining the set of .o's and the .o .h dependencies
stefank@2314 48 -include $(DEP_DIR)/*.d
duke@435 49
duke@435 50 # read machine-specific adjustments (%%% should do this via buildtree.make?)
erikj@3649 51 ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
never@1445 52 include $(MAKEFILES_DIR)/zeroshark.make
never@1445 53 else
dlong@7598 54 BUILDARCH_MAKE = $(MAKEFILES_DIR)/$(BUILDARCH).make
dlong@7598 55 ALT_BUILDARCH_MAKE = $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make
dlong@7598 56 include $(if $(wildcard $(ALT_BUILDARCH_MAKE)),$(ALT_BUILDARCH_MAKE),$(BUILDARCH_MAKE))
never@1445 57 endif
duke@435 58
duke@435 59 # set VPATH so make knows where to look for source files
stefank@2314 60 # Src_Dirs_V is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
duke@435 61 # The adfiles directory contains ad_<arch>.[ch]pp.
duke@435 62 # The jvmtifiles directory contains jvmti*.[ch]pp
sla@5237 63 Src_Dirs_V += $(GENERATED)/adfiles $(GENERATED)/jvmtifiles $(GENERATED)/tracefiles
stefank@2314 64 VPATH += $(Src_Dirs_V:%=%:)
duke@435 65
stefank@2314 66 # set INCLUDES for C preprocessor.
stefank@2314 67 Src_Dirs_I += $(GENERATED)
stefank@2314 68 # The order is important for the precompiled headers to work.
stefank@2314 69 INCLUDES += $(PRECOMPILED_HEADER_DIR:%=-I%) $(Src_Dirs_I:%=-I%)
duke@435 70
dcubed@3150 71 # SYMFLAG is used by {jsig,saproc}.make
dcubed@3724 72 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dcubed@3150 73 # always build with debug info when we can create .debuginfo files
duke@435 74 SYMFLAG = -g
duke@435 75 else
dcubed@3150 76 ifeq (${VERSION}, debug)
dcubed@3150 77 SYMFLAG = -g
dcubed@3150 78 else
dcubed@3150 79 SYMFLAG =
dcubed@3150 80 endif
duke@435 81 endif
duke@435 82
sla@5237 83 # HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
duke@435 84 # in $(GAMMADIR)/make/defs.make
duke@435 85 ifeq ($(HOTSPOT_BUILD_VERSION),)
duke@435 86 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
duke@435 87 else
duke@435 88 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
duke@435 89 endif
duke@435 90
duke@435 91 # The following variables are defined in the generated flags.make file.
duke@435 92 BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
duke@435 93 JRE_VERSION = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
jrose@535 94 HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
duke@435 95 BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
duke@435 96 BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
duke@435 97 VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
duke@435 98
erikj@3518 99 CXXFLAGS = \
duke@435 100 ${SYSDEFS} \
duke@435 101 ${INCLUDES} \
duke@435 102 ${BUILD_VERSION} \
duke@435 103 ${BUILD_TARGET} \
duke@435 104 ${BUILD_USER} \
jrose@535 105 ${HS_LIB_ARCH} \
duke@435 106 ${VM_DISTRO}
duke@435 107
aoqi@1 108 ifeq ($(MIPS_ABI),n32)
aoqi@1 109 CXXFLAGS += -DN32
aoqi@1 110 else
aoqi@1 111 ifeq ($(MIPS_ABI),n64)
aoqi@1 112 CXXFLAGS += -DN64
aoqi@1 113 endif
aoqi@1 114 endif
ohrstrom@3517 115 # This is VERY important! The version define must only be supplied to vm_version.o
ohrstrom@3517 116 # If not, ccache will not re-use the cache at all, since the version string might contain
sla@5237 117 # a time and date.
aoqi@9137 118 ifdef LOONGSON_RUNTIME_NAME
aoqi@9137 119 LOONGSON_VM_INFO = -DLOONGSON_RUNTIME_NAME="\"$(LOONGSON_RUNTIME_NAME)\""
aoqi@9137 120 else
aoqi@9137 121 LOONGSON_VM_INFO = -DLOONGSON_RUNTIME_NAME="\"\""
aoqi@9137 122 endif
aoqi@9137 123 CXXFLAGS/vmError.o += ${LOONGSON_VM_INFO}
andrew@9634 124 CXXFLAGS/vm_version.o += ${JRE_VERSION} ${VERSION_CFLAGS}
andrew@9634 125 CXXFLAGS/arguments.o += ${VERSION_CFLAGS}
mikael@4602 126
mikael@4602 127 CXXFLAGS/BYFILE = $(CXXFLAGS/$@)
mikael@4602 128
mikael@4602 129 # File specific flags
mikael@4602 130 CXXFLAGS += $(CXXFLAGS/BYFILE)
mikael@4602 131
tamao@5309 132 # Large File Support
tamao@5309 133 ifneq ($(LP64), 1)
tamao@5309 134 CXXFLAGS/ostream.o += -D_FILE_OFFSET_BITS=64
tamao@5309 135 endif # ifneq ($(LP64), 1)
ohrstrom@3517 136
duke@435 137 # CFLAGS_WARN holds compiler options to suppress/enable warnings.
duke@435 138 CFLAGS += $(CFLAGS_WARN/BYFILE)
duke@435 139
duke@435 140 # Do not use C++ exception handling
duke@435 141 CFLAGS += $(CFLAGS/NOEX)
duke@435 142
duke@435 143 # Extra flags from gnumake's invocation or environment
duke@435 144 CFLAGS += $(EXTRA_CFLAGS)
sgehwolf@9330 145 LFLAGS += $(EXTRA_CFLAGS) $(EXTRA_LDFLAGS)
duke@435 146
dsamersoff@2837 147 # Don't set excutable bit on stack segment
dsamersoff@2837 148 # the same could be done by separate execstack command
dsamersoff@2837 149 LFLAGS += -Xlinker -z -Xlinker noexecstack
dsamersoff@2837 150
duke@435 151 LIBS += -lm -ldl -lpthread
duke@435 152
duke@435 153 # By default, link the *.o into the library, not the executable.
duke@435 154 LINK_INTO$(LINK_INTO) = LIBJVM
duke@435 155
duke@435 156 JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
duke@435 157
duke@435 158 #----------------------------------------------------------------------
duke@435 159 # jvm_db & dtrace
duke@435 160 include $(MAKEFILES_DIR)/dtrace.make
duke@435 161
duke@435 162 #----------------------------------------------------------------------
duke@435 163 # JVM
duke@435 164
phh@1558 165 JVM = jvm
phh@1558 166 LIBJVM = lib$(JVM).so
duke@435 167
dcubed@3150 168 LIBJVM_DEBUGINFO = lib$(JVM).debuginfo
dcubed@3724 169 LIBJVM_DIZ = lib$(JVM).diz
dcubed@3150 170
kamg@2515 171 SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt
stefank@2314 172
kamg@2515 173 SOURCE_PATHS=\
kamg@2515 174 $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \
kamg@2515 175 \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \))
kamg@2515 176 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm
kamg@2515 177 SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm
kamg@2515 178 SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm
kamg@2515 179 SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm
stefank@2314 180
sla@5237 181 CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path))
sla@5237 182 CORE_PATHS+=$(GENERATED)/jvmtifiles $(GENERATED)/tracefiles
sla@5237 183
sla@5237 184 ifneq ($(INCLUDE_TRACE), false)
sla@5237 185 CORE_PATHS+=$(shell if [ -d $(HS_ALT_SRC)/share/vm/jfr ]; then \
phh@3427 186 find $(HS_ALT_SRC)/share/vm/jfr -type d; \
phh@3427 187 fi)
phh@3427 188 endif
kamg@2515 189
kamg@2515 190 COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1)
kamg@2515 191 COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1
kamg@2515 192
kamg@2515 193 COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto)
kamg@2515 194 COMPILER2_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/libadt)
kamg@2515 195 COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/opto
kamg@2515 196 COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/libadt
kamg@2515 197 COMPILER2_PATHS += $(GENERATED)/adfiles
stefank@2314 198
dholmes@2752 199 SHARK_PATHS := $(GAMMADIR)/src/share/vm/shark
dholmes@2752 200
stefank@2314 201 # Include dirs per type.
stefank@2314 202 Src_Dirs/CORE := $(CORE_PATHS)
stefank@2314 203 Src_Dirs/COMPILER1 := $(CORE_PATHS) $(COMPILER1_PATHS)
stefank@2314 204 Src_Dirs/COMPILER2 := $(CORE_PATHS) $(COMPILER2_PATHS)
stefank@2314 205 Src_Dirs/TIERED := $(CORE_PATHS) $(COMPILER1_PATHS) $(COMPILER2_PATHS)
stefank@2314 206 Src_Dirs/ZERO := $(CORE_PATHS)
dholmes@2752 207 Src_Dirs/SHARK := $(CORE_PATHS) $(SHARK_PATHS)
stefank@2314 208 Src_Dirs := $(Src_Dirs/$(TYPE))
stefank@2314 209
neliasso@4949 210 COMPILER2_SPECIFIC_FILES := opto libadt bcEscapeAnalyzer.cpp c2_\* runtime_\*
stefank@2314 211 COMPILER1_SPECIFIC_FILES := c1_\*
stefank@2314 212 SHARK_SPECIFIC_FILES := shark
stefank@2314 213 ZERO_SPECIFIC_FILES := zero
stefank@2314 214
stefank@2314 215 # Always exclude these.
jprovino@4165 216 Src_Files_EXCLUDE += jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
stefank@2314 217
stefank@2314 218 # Exclude per type.
stefank@2314 219 Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
stefank@2314 220 Src_Files_EXCLUDE/COMPILER1 := $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
stefank@2314 221 Src_Files_EXCLUDE/COMPILER2 := $(COMPILER1_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
stefank@2314 222 Src_Files_EXCLUDE/TIERED := $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES)
stefank@2314 223 Src_Files_EXCLUDE/ZERO := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
stefank@2314 224 Src_Files_EXCLUDE/SHARK := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES)
stefank@2314 225
stefank@2314 226 Src_Files_EXCLUDE += $(Src_Files_EXCLUDE/$(TYPE))
stefank@2314 227
stefank@2314 228 # Special handling of arch model.
stefank@2314 229 ifeq ($(Platform_arch_model), x86_32)
stefank@2314 230 Src_Files_EXCLUDE += \*x86_64\*
stefank@2314 231 endif
stefank@2314 232 ifeq ($(Platform_arch_model), x86_64)
stefank@2314 233 Src_Files_EXCLUDE += \*x86_32\*
stefank@2314 234 endif
aoqi@1 235 ifeq ($(Platform_arch_model), mips_32)
aoqi@1 236 Src_Files_EXCLUDE += \*mips_64\*
aoqi@1 237 endif
aoqi@1 238 ifeq ($(Platform_arch_model), mips_64)
aoqi@1 239 Src_Files_EXCLUDE += \*mips_32\*
aoqi@1 240 endif
stefank@2314 241
dholmes@5442 242 # Alternate vm.make
dholmes@5442 243 # This has to be included here to allow changes to the source
dholmes@5442 244 # directories and excluded files before they are expanded
dholmes@5442 245 # by the definition of Src_Files.
dholmes@5442 246 -include $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/vm.make
dholmes@5442 247
stefank@2314 248 # Locate all source files in the given directory, excluding files in Src_Files_EXCLUDE.
stefank@2314 249 define findsrc
stefank@2368 250 $(notdir $(shell find $(1)/. ! -name . -prune \
stefank@2368 251 -a \( -name \*.c -o -name \*.cpp -o -name \*.s \) \
stefank@2368 252 -a ! \( -name DUMMY $(addprefix -o -name ,$(Src_Files_EXCLUDE)) \)))
stefank@2314 253 endef
stefank@2314 254
stefank@2314 255 Src_Files := $(foreach e,$(Src_Dirs),$(call findsrc,$(e)))
stefank@2314 256
stefank@2326 257 Obj_Files = $(sort $(addsuffix .o,$(basename $(Src_Files))))
stefank@2314 258
duke@435 259 JVM_OBJ_FILES = $(Obj_Files)
duke@435 260
duke@435 261 vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
duke@435 262
jwilhelm@7059 263 mapfile : $(MAPFILE) vm.def mapfile_ext
duke@435 264 rm -f $@
never@1729 265 awk '{ if ($$0 ~ "INSERT VTABLE SYMBOLS HERE") \
jwilhelm@7059 266 { system ("cat mapfile_ext"); system ("cat vm.def"); } \
never@1729 267 else \
never@1729 268 { print $$0 } \
never@1729 269 }' > $@ < $(MAPFILE)
duke@435 270
duke@435 271 mapfile_reorder : mapfile $(REORDERFILE)
duke@435 272 rm -f $@
duke@435 273 cat $^ > $@
duke@435 274
dlong@7573 275 VMDEF_PAT = ^_ZTV
dlong@7573 276 VMDEF_PAT := ^gHotSpotVM|$(VMDEF_PAT)
dlong@7573 277 VMDEF_PAT := ^UseSharedSpaces$$|$(VMDEF_PAT)
dlong@7573 278 VMDEF_PAT := ^_ZN9Arguments17SharedArchivePathE$$|$(VMDEF_PAT)
dlong@7573 279
never@1729 280 vm.def: $(Res_Files) $(Obj_Files)
dlong@7573 281 $(QUIETLY) $(NM) --defined-only $(Obj_Files) | sort -k3 -u | \
dlong@7573 282 awk '$$3 ~ /$(VMDEF_PAT)/ { print "\t" $$3 ";" }' > $@
never@1729 283
jwilhelm@7059 284 mapfile_ext:
jwilhelm@7059 285 rm -f $@
jwilhelm@7059 286 touch $@
jwilhelm@7059 287 if [ -f $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext ]; then \
jwilhelm@7059 288 cat $(HS_ALT_MAKE)/linux/makefiles/mapfile-ext > $@; \
jwilhelm@7059 289 fi
jwilhelm@7059 290
erikj@3649 291 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
never@1445 292 STATIC_CXX = false
never@1445 293 else
twisti@2047 294 ifeq ($(ZERO_LIBARCH), ppc64)
twisti@2047 295 STATIC_CXX = false
twisti@2047 296 else
twisti@2047 297 STATIC_CXX = true
twisti@2047 298 endif
never@1445 299 endif
duke@435 300
duke@435 301 ifeq ($(LINK_INTO),AOUT)
duke@435 302 LIBJVM.o =
duke@435 303 LIBJVM_MAPFILE =
duke@435 304 LIBS_VM = $(LIBS)
duke@435 305 else
duke@435 306 LIBJVM.o = $(JVM_OBJ_FILES)
duke@435 307 LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
duke@435 308 LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
duke@435 309 LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM))
duke@435 310
duke@435 311 # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
duke@435 312 # get around library dependency and compatibility issues. Must use gcc not
duke@435 313 # g++ to link.
duke@435 314 ifeq ($(STATIC_CXX), true)
duke@435 315 LFLAGS_VM += $(STATIC_LIBGCC)
duke@435 316 LIBS_VM += $(STATIC_STDCXX)
duke@435 317 else
duke@435 318 LIBS_VM += -lstdc++
duke@435 319 endif
duke@435 320
duke@435 321 LIBS_VM += $(LIBS)
duke@435 322 endif
erikj@3649 323 ifeq ($(JVM_VARIANT_ZERO), true)
never@1445 324 LIBS_VM += $(LIBFFI_LIBS)
never@1445 325 endif
erikj@3649 326 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
erikj@3649 327 LIBS_VM += $(LIBFFI_LIBS) $(LLVM_LIBS)
twisti@2047 328 LFLAGS_VM += $(LLVM_LDFLAGS)
twisti@2047 329 endif
duke@435 330
erikj@3518 331 LINK_VM = $(LINK_LIB.CC)
duke@435 332
duke@435 333 # rule for building precompiled header
stefank@2314 334 $(PRECOMPILED_HEADER):
duke@435 335 $(QUIETLY) echo Generating precompiled header $@
stefank@2314 336 $(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)
erikj@3518 337 $(QUIETLY) $(COMPILE.CXX) $(DEPFLAGS) -x c++-header $(PRECOMPILED_HEADER_SRC) -o $@ $(COMPILE_DONE)
duke@435 338
duke@435 339 # making the library:
duke@435 340
duke@435 341 ifneq ($(JVM_BASE_ADDR),)
duke@435 342 # By default shared library is linked at base address == 0. Modify the
duke@435 343 # linker script if JVM prefers a different base location. It can also be
duke@435 344 # implemented with 'prelink -r'. But 'prelink' is not (yet) available on
duke@435 345 # our build platform (AS-2.1).
duke@435 346 LD_SCRIPT = libjvm.so.lds
duke@435 347 $(LD_SCRIPT): $(LIBJVM_MAPFILE)
duke@435 348 $(QUIETLY) { \
duke@435 349 rm -rf $@; \
duke@435 350 $(LINK_VM) -Wl,--verbose $(LFLAGS_VM) 2>&1 | \
duke@435 351 sed -e '/^======/,/^======/!d' \
duke@435 352 -e '/^======/d' \
duke@435 353 -e 's/0\( + SIZEOF_HEADERS\)/$(JVM_BASE_ADDR)\1/' \
duke@435 354 > $@; \
duke@435 355 }
duke@435 356 LD_SCRIPT_FLAG = -Wl,-T,$(LD_SCRIPT)
duke@435 357 endif
duke@435 358
duke@435 359 # With more recent Redhat releases (or the cutting edge version Fedora), if
duke@435 360 # SELinux is configured to be enabled, the runtime linker will fail to apply
duke@435 361 # the text relocation to libjvm.so considering that it is built as a non-PIC
sla@5237 362 # DSO. To workaround that, we run chcon to libjvm.so after it is built. See
duke@435 363 # details in bug 6538311.
duke@435 364 $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
duke@435 365 $(QUIETLY) { \
duke@435 366 echo Linking vm...; \
erikj@3518 367 $(LINK_LIB.CXX/PRE_HOOK) \
duke@435 368 $(LINK_VM) $(LD_SCRIPT_FLAG) \
ohair@4087 369 $(LFLAGS_VM) -o $@ $(sort $(LIBJVM.o)) $(LIBS_VM); \
erikj@3518 370 $(LINK_LIB.CXX/POST_HOOK) \
duke@435 371 rm -f $@.1; ln -s $@ $@.1; \
bobv@2036 372 if [ \"$(CROSS_COMPILE_ARCH)\" = \"\" ] ; then \
bobv@2036 373 if [ -x /usr/sbin/selinuxenabled ] ; then \
bobv@2036 374 /usr/sbin/selinuxenabled; \
bobv@2036 375 if [ $$? = 0 ] ; then \
bobv@2036 376 /usr/bin/chcon -t textrel_shlib_t $@; \
bobv@2036 377 if [ $$? != 0 ]; then \
bobv@2036 378 echo "ERROR: Cannot chcon $@"; \
bobv@2036 379 fi \
bobv@2036 380 fi \
bobv@2036 381 fi \
bobv@2036 382 fi \
duke@435 383 }
dholmes@4243 384
dholmes@4243 385 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
sgehwolf@9357 386 ifneq ($(STRIP_POLICY),no_strip)
dcubed@3150 387 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
sgehwolf@9357 388 $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
sgehwolf@9357 389 endif
sgehwolf@9346 390 ifeq ($(STRIP_POLICY),all_strip)
dcubed@3150 391 $(QUIETLY) $(STRIP) $@
dholmes@4243 392 else
dholmes@4243 393 ifeq ($(STRIP_POLICY),min_strip)
dcubed@3150 394 $(QUIETLY) $(STRIP) -g $@
sgehwolf@9346 395 endif
dholmes@4243 396 # implied else here is no stripping at all
dholmes@4243 397 endif
sgehwolf@9357 398 ifneq ($(STRIP_POLICY),no_strip)
sgehwolf@9357 399 ifeq ($(ZIP_DEBUGINFO_FILES),1)
dcubed@4344 400 $(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO)
dcubed@4344 401 $(RM) $(LIBJVM_DEBUGINFO)
sgehwolf@9357 402 endif
dcubed@3150 403 endif
dcubed@3150 404 endif
duke@435 405
dcubed@3150 406 DEST_SUBDIR = $(JDK_LIBDIR)/$(VM_SUBDIR)
dcubed@3150 407 DEST_JVM = $(DEST_SUBDIR)/$(LIBJVM)
dcubed@3150 408 DEST_JVM_DEBUGINFO = $(DEST_SUBDIR)/$(LIBJVM_DEBUGINFO)
dcubed@3724 409 DEST_JVM_DIZ = $(DEST_SUBDIR)/$(LIBJVM_DIZ)
duke@435 410
duke@435 411 install_jvm: $(LIBJVM)
duke@435 412 @echo "Copying $(LIBJVM) to $(DEST_JVM)"
dcubed@3150 413 $(QUIETLY) test -f $(LIBJVM_DEBUGINFO) && \
dcubed@3150 414 cp -f $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO)
dcubed@3724 415 $(QUIETLY) test -f $(LIBJVM_DIZ) && \
dcubed@3724 416 cp -f $(LIBJVM_DIZ) $(DEST_JVM_DIZ)
duke@435 417 $(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
duke@435 418
duke@435 419 #----------------------------------------------------------------------
duke@435 420 # Other files
duke@435 421
duke@435 422 # Signal interposition library
duke@435 423 include $(MAKEFILES_DIR)/jsig.make
duke@435 424
duke@435 425 # Serviceability agent
duke@435 426 include $(MAKEFILES_DIR)/saproc.make
duke@435 427
duke@435 428 #----------------------------------------------------------------------
duke@435 429
mgerdin@4637 430 build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) dtraceCheck
duke@435 431
duke@435 432 install: install_jvm install_jsig install_saproc
duke@435 433
dholmes@5442 434 .PHONY: default build install install_jvm $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/$(BUILDARCH).make $(HS_ALT_MAKE)/$(Platform_os_family)/makefiles/vm.make

mercurial