# # Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as # published by the Free Software Foundation. Oracle designates this # particular file as subject to the "Classpath" exception as provided # by Oracle in the LICENSE file that accompanied this code. # # This code is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # version 2 for more details (a copy is included in the LICENSE file that # accompanied this code). # # You should have received a copy of the GNU General Public License version # 2 along with this work; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # or visit www.oracle.com if you need additional information or have any # questions. #
# Include support files that will setup compiler flags due to the selected # jvm feature set, specific file overrides, and general flags. include lib/JvmFeatures.gmk include lib/JvmOverrideFiles.gmk include lib/JvmFlags.gmk
################################################################################ # Setup compilation of the main Hotspot native library (libjvm).
elseifeq ($(call And, $(call isTargetOs, linux) $(call isTargetCpu, aarch64)), true) # For 64-bit arm builds, we use the 64 bit hotspot/src/cpu/arm # hotspot sources if HOTSPOT_TARGET_CPU_ARCH is set to arm. # Exclude the aarch64 and 32 bit arm files for this build. ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm)
JVM_EXCLUDE_PATTERNS += arm_32 aarch64 endif endif
# Need to set JVM_STRIPFLAGS to the default value from SPEC since the STRIPFLAGS # parameter to SetupNativeCompilation allows an empty value to override the # default.
JVM_STRIPFLAGS ?= $(STRIPFLAGS)
# This source set is reused so save in cache.
$(call FillFindCache, $(JVM_SRC_DIRS))
################################################################################ # Now set up the actual compilation of the main hotspot native library
# Always recompile abstract_vm_version.cpp if libjvm needs to be relinked. This ensures # that the internal vm version is updated as it relies on __DATE__ and __TIME__ # macros.
ABSTRACT_VM_VERSION_OBJ := $(JVM_OUTPUTDIR)/objs/abstract_vm_version$(OBJ_SUFFIX)
$(ABSTRACT_VM_VERSION_OBJ): $(filter-out $(ABSTRACT_VM_VERSION_OBJ) $(JVM_MAPFILE), \
$(BUILD_LIBJVM_TARGET_DEPS))
ifneq ($(GENERATE_COMPILE_COMMANDS_ONLY), true) ifeq ($(call isTargetOs, windows), true) # It doesn't matter which jvm.lib file gets exported, but we need # to pick just one. ifeq ($(JVM_VARIANT), $(JVM_VARIANT_MAIN))
$(eval $(call SetupCopyFiles, COPY_JVM_LIB, \
DEST := $(LIB_OUTPUTDIR), \
FILES :=$(BUILD_LIBJVM_IMPORT_LIBRARY), \
))
TARGETS += $(COPY_JVM_LIB) endif endif endif
# AIX warning explanation: # 1500-010 : (W) WARNING in ...: Infinite loop. Program may not stop. # There are several infinite loops in the vm, so better suppress. # 1540-0198 : (W) The omitted keyword "private" is assumed for base class "...". # 1540-0216 : (W) An expression of type .. cannot be converted to type .. # In hotspot this fires for functionpointer to pointer conversions # 1540-1088 : (W) The exception specification is being ignored. # In hotspot this is caused by throw() in declaration of new() in nmethod.hpp. # 1540-1090 : (I) The destructor of "..." might not be called. # 1540-1639 : (I) The behavior of long type bit fields has changed ...
# Include mapfile generation. It relies on BUILD_LIBJVM_ALL_OBJS which is only # defined after the above call to BUILD_LIBJVM. Mapfile will be generated # after all object files are built, but before the jvm library is linked. include lib/JvmMapfile.gmk
TARGETS += $(BUILD_LIBJVM)
################################################################################ # Hotspot disallows the use of global operators 'new' and 'delete'. This build # time check helps enforce this requirement. If you trigger this check and the # reference is not obvious from the source, GNU objdump can be used to help find # the reference if compiled with GCC: # # objdump -lrdSC <path/to/file.o> # # -C demangle # -d disassemble # -r print relocation entries, interspersed with the disassembly # -S print source code, intermixed with disassembly # -l include filenames and line numbers # # Search the output for the operator(s) of interest, to see where they are # referenced. # # When a reference to the global 'operator delete' is reported, it might be # due to a "deleting destructor". In this case, objdump may show the # reference to be associated with but not actually in a destructor. A # deleting destructor is automatically generated for a class whose destructor # is virtual. A deleting destructor requires an accessible 'operator delete' # for the associated class. If the class doesn't provide a more specific # declaration (either directly or by inheriting from a class that provides # one) then the global definition will be used, triggering this check.
# Running c++filt to find offending symbols in all files is too expensive, # so use mangled names when looking for symbols. # Save the demangling for when something is actually found.
MANGLED_SYMS := \
_ZdaPv \
_ZdlPv \
_Znam \
_Znwm \ #
UNDEF_PATTERN := ' U '
define SetupOperatorNewDeleteCheck
$1.op_check: $1
$$(call ExecuteWithLog, $1.op_check, \
$$(NM) $$< 2>&1 | $$(GREP) $$(addprefix -e , $$(MANGLED_SYMS)) | $$(GREP) $$(UNDEF_PATTERN) > $1.op_check || true) if [ -s $1.op_check ]; then \
$$(ECHO) "$$(notdir $$<): Error: Use of global operators new and delete is not allowed in Hotspot:"; \
$$(NM) $$< | $$(CXXFILT) | $$(EGREP) '$$(DEMANGLED_REGEXP)' | $$(GREP) $$(UNDEF_PATTERN); \
$$(ECHO) "See: $$(TOPDIR)/make/hotspot/lib/CompileJvm.gmk"; \
exit 1; \ fi
TARGETS += $1.op_check endef
$(foreach o, $(BUILD_LIBJVM_ALL_OBJS), $(eval $(call SetupOperatorNewDeleteCheck,$o))) endif endif
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.