Skip to content

Commit

Permalink
Merge jdk-24+13 into rivos/main (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
luhenry authored Sep 2, 2024
2 parents 3f78769 + 256e6f2 commit c77bba3
Show file tree
Hide file tree
Showing 332 changed files with 7,417 additions and 1,654 deletions.
12 changes: 12 additions & 0 deletions make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,18 @@ $(eval $(call SetupTarget, eclipse-mixed-env, \
ARGS := --always-make, \
))

$(eval $(call SetupTarget, hotspot-xcode-project, \
MAKEFILE := ide/xcode/hotspot/CreateXcodeProject, \
TARGET := build, \
DEPS := hotspot compile-commands-hotspot jdk-image, \
))

$(eval $(call SetupTarget, open-hotspot-xcode-project, \
MAKEFILE := ide/xcode/hotspot/CreateXcodeProject, \
TARGET := open, \
DEPS := hotspot-xcode-project, \
))

ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \
$(HOTSPOT_VARIANT_LIBS_TARGETS) $(HOTSPOT_VARIANT_STATIC_LIBS_TARGETS)

Expand Down
5 changes: 5 additions & 0 deletions make/common/FileUtils.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ else
endef
endif

define copy-and-chmod-executable
$(install-file)
$(CHMOD) a+rx $@
endef

################################################################################

# Recursive wildcard function. Walks down directories recursively and matches
Expand Down
36 changes: 20 additions & 16 deletions make/common/JavaCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,26 @@ define SetupJavaCompilationBody
$1_FLAGS += -Xlint:$$(call CommaList, $$(addprefix -, $$($1_DISABLED_WARNINGS)))
endif

ifneq ($$($1_CLASSPATH), )
$1_FLAGS += -cp $$(call PathList, $$($1_CLASSPATH))
$1_AUGMENTED_CLASSPATH := $$($1_CLASSPATH)
$1_API_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi
$1_API_INTERNAL := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_internalapi

ifeq ($$($1_CREATE_API_DIGEST), true)
$1_API_DIGEST_FLAGS := \
-Xplugin:"depend $$($1_API_TARGET)" \
"-XDinternalAPIPath=$$($1_API_INTERNAL)" \
"-XDLOG_LEVEL=$(LOG_LEVEL)" \
#

$1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch
# including the compilation output on the classpath, so that incremental
# compilations in unnamed module can refer to other classes from the same
# source root, which are not being recompiled in this compilation:
$1_AUGMENTED_CLASSPATH += $$(BUILDTOOLS_OUTPUTDIR)/depend $$($1_BIN)
endif

ifneq ($$($1_AUGMENTED_CLASSPATH), )
$1_FLAGS += -cp $$(call PathList, $$($1_AUGMENTED_CLASSPATH))
endif

# Make sure the dirs exist, or that one of the EXTRA_FILES, that may not
Expand Down Expand Up @@ -411,9 +429,6 @@ define SetupJavaCompilationBody
$1_MODFILELIST := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch.modfiles
$1_MODFILELIST_FIXED := $$($1_MODFILELIST).fixed

$1_API_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi
$1_API_INTERNAL := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_internalapi

# Put headers in a temp dir to filter out those that actually
# changed before copying them to the real header dir.
ifneq (,$$($1_HEADERS))
Expand Down Expand Up @@ -442,17 +457,6 @@ define SetupJavaCompilationBody
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps)

ifeq ($$($1_CREATE_API_DIGEST), true)
$1_API_DIGEST_FLAGS := \
-classpath $$(BUILDTOOLS_OUTPUTDIR)/depend \
-Xplugin:"depend $$($1_API_TARGET)" \
"-XDinternalAPIPath=$$($1_API_INTERNAL)" \
"-XDLOG_LEVEL=$(LOG_LEVEL)" \
#

$1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch
endif

# Create a file with all sources, to pass to javac in an @file.
# $$($1_VARDEPS_FILE) is used as dependency to track changes in set of
# list of files.
Expand Down
2 changes: 1 addition & 1 deletion make/common/NativeCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ define SetupNativeCompilationBody

ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
# Override all targets (this is a hack)
$1 := $$($1_ALL_OBJS_JSON)
$1 := $$($1_ALL_OBJS_JSON) $$($1_LDFLAGS_FILE)
endif
endef

Expand Down
12 changes: 12 additions & 0 deletions make/common/native/Link.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,16 @@ define CreateDynamicLibraryOrExecutable
$(CODESIGN) -f -s $$($1_CODESIGN_OPTS) --entitlements \
$$(call GetEntitlementsFile, $$@) $$@)
endif

# This is for IDE integration purposes only, and is not normally generated
$1_LDFLAGS_FILE := $$(MAKESUPPORT_OUTPUTDIR)/compile-commands/$$($1_NAME)-ldflags.txt

$1_ALL_LD_ARGS := $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
$$($1_LIBS) $$($1_EXTRA_LIBS)

$$($1_LDFLAGS_FILE): $$($1_VARDEPS_FILE)
$$(call LogInfo, Creating compile commands linker flags output for $$($1_BASENAME))
$$(call MakeDir, $$(dir $$@))
$$(ECHO) $$($1_ALL_LD_ARGS) > $$@

endef
32 changes: 5 additions & 27 deletions make/conf/module-loader-map.conf
Original file line number Diff line number Diff line change
Expand Up @@ -94,48 +94,26 @@ PLATFORM_MODULES_windows= \

NATIVE_ACCESS_MODULES= \
java.base \
java.datatransfer \
java.desktop \
java.instrument \
java.logging \
java.management \
java.management.rmi \
java.naming \
java.net.http \
java.prefs \
java.rmi \
java.scripting \
java.se \
java.security.jgss \
java.security.sasl \
java.smartcardio \
java.sql \
java.sql.rowset \
java.transaction.xa \
java.xml \
java.xml.crypto \
jdk.accessibility \
jdk.charsets \
jdk.attach \
jdk.crypto.cryptoki \
jdk.dynalink \
jdk.httpserver \
jdk.incubator.vector \
jdk.crypto.mscapi \
jdk.hotspot.agent \
jdk.internal.le \
jdk.internal.vm.ci \
jdk.jdi \
jdk.jfr \
jdk.jsobject \
jdk.localedata \
jdk.jpackage \
jdk.management \
jdk.management.agent \
jdk.management.jfr \
jdk.naming.dns \
jdk.naming.rmi \
jdk.net \
jdk.nio.mapmode \
jdk.sctp \
jdk.security.auth \
jdk.security.jgss \
jdk.unsupported \
jdk.xml.dom \
jdk.zipfs \
#
4 changes: 2 additions & 2 deletions make/ide/visualstudio/hotspot/CreateVSProject.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2024, 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
Expand Down Expand Up @@ -83,7 +83,7 @@ ifeq ($(call isTargetOs, windows), true)
################################################################################
# Build the ProjectCreator java tool.

TOOLS_OUTPUTDIR := $(HOTSPOT_OUTPUTDIR)/support/ide_classes
TOOLS_OUTPUTDIR := $(MAKESUPPORT_OUTPUTDIR)/ide/visualstudio

$(eval $(call SetupJavaCompilation, BUILD_PROJECT_CREATOR, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
Expand Down
112 changes: 112 additions & 0 deletions make/ide/xcode/hotspot/CreateXcodeProject.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
#
# Copyright (c) 2023, 2024, 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.
#

# This must be the first rule
default: all

include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include Execute.gmk
include JavaCompilation.gmk

ifeq ($(call isTargetOs, macosx), true)
##############################################################################
# Build the XcodeProjectMaker java tool.

PROJECT_MAKER_DIR := $(TOPDIR)/make/ide/xcode/hotspot
TOOLS_OUTPUTDIR := $(MAKESUPPORT_OUTPUTDIR)/ide/xcode
IDE_OUTPUTDIR := $(OUTPUTDIR)/xcode
PROJECT_FILE_NAME := hotspot.xcodeproj

COMPILE_COMMAND_FILE := $(OUTPUTDIR)/compile_commands.json
LINKER_FLAGS_FILE := $(MAKESUPPORT_OUTPUTDIR)/compile-commands/jvm-ldflags.txt

$(eval $(call SetupJavaCompilation, BUILD_PROJECT_CREATOR, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := $(PROJECT_MAKER_DIR)/src/classes, \
BIN := $(TOOLS_OUTPUTDIR), \
DISABLED_WARNINGS := rawtypes unchecked serial, \
))

TARGETS += $(BUILD_PROJECT_CREATOR)

# Run the XcodeProjectMaker tool
PROJECT_CREATOR_TOOL := $(JAVA_SMALL) -cp $(TOOLS_OUTPUTDIR) XcodeProjectMaker

ifneq ($(findstring $(LOG_LEVEL), debug trace), )
XCODE_PROJ_DEBUG_OPTION := -d
endif

XCODE_PROJ_VARDEPS := $(WORKSPACE_ROOT) $(IDE_OUTPUTDIR) \
$(PROJECT_MAKER_DIR)/data $(COMPILE_COMMAND_FILE) $(LINKER_FLAGS_FILE)
XCODE_PROJ_VARDEPS_FILE := $(call DependOnVariable, XCODE_PROJ_VARDEPS, \
$(TOOLS_OUTPUTDIR)/xcodeproj.vardeps)

$(eval $(call SetupExecute, build_xcode_project, \
WARN := Generating Xcode project file, \
DEPS := $(BUILD_PROJECT_CREATOR) $(COMPILE_COMMAND_FILE) \
$(LINKER_FLAGS_FILE) $(XCODE_PROJ_VARDEPS_FILE), \
OUTPUT_DIR := $(TOOLS_OUTPUTDIR), \
COMMAND := $(PROJECT_CREATOR_TOOL) $(WORKSPACE_ROOT) $(IDE_OUTPUTDIR) \
$(PROJECT_MAKER_DIR)/data $(COMPILE_COMMAND_FILE) \
$(LINKER_FLAGS_FILE) $(XCODE_PROJ_DEBUG_OPTION), \
))

TARGETS += $(build_xcode_project)

$(eval $(call SetupCopyFiles, copy_xcode_project, \
DEST := $(IDE_OUTPUTDIR), \
FILES := $(PROJECT_MAKER_DIR)/data/script_before.sh $(PROJECT_MAKER_DIR)/data/script_after.sh , \
MACRO := copy-and-chmod-executable, \
))

TARGETS += $(copy_xcode_project)

$(eval $(call SetupExecute, open_xcode_project, \
INFO := Opening Xcode project file, \
DEPS := $(build_xcodeproject_TARGET) FORCE, \
OUTPUT_DIR := $(TOOLS_OUTPUTDIR), \
COMMAND := open $(IDE_OUTPUTDIR)/$(PROJECT_FILE_NAME), \
))

TARGETS += $(open_xcode_project)

# Always call open without considering dependencies being up to date
FORCE:

build: $(build_xcode_project) $(copy_xcode_project)

open: $(open_xcode_project)

all: $(TARGETS)
else
build:
open:
all:
$(info Xcode projects are only supported on macOS)
endif

.PHONY: default all build open
41 changes: 41 additions & 0 deletions make/ide/xcode/hotspot/data/Breakpoints_v2.xcbkptlist.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "4"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "Yes"
symbolName = "load_jimage_library"
moduleName = "libjvm.dylib">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "process handle -n true -p true -s false SIGSEGV SIGBUS SIGUSR2">
</ActionContent>
</BreakpointActionProxy>
</Actions>
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "ClassLoader::load_jimage_library()"
moduleName = "libjvm.dylib"
usesParentBreakpointCondition = "Yes"
timestampString = "0"
startingColumnNumber = "0"
endingColumnNumber = "0"
startingLineNumber = "0"
endingLineNumber = "0"
offsetFromSymbolStart = "0">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Loading

0 comments on commit c77bba3

Please sign in to comment.