Skip to content

Commit 7377313

Browse files
authored
Merge branch 'dragonwell-project:master' into printConstraintFuncs
2 parents 2d7ef1f + 85a2ef0 commit 7377313

File tree

160 files changed

+11233
-624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+11233
-624
lines changed

.github/actions/build-serverless-adapter/action.yml renamed to .github/actions/build-additional-components/action.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2020
#
2121

22-
name: 'Build serverless-adapter'
22+
name: 'Build additional components'
2323
description: 'Build it using built JDK'
2424
inputs:
2525
platform:
@@ -91,6 +91,45 @@ runs:
9191
cp -f serverless-adapter/output/libloadclassagent.so ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless/libloadclassagent.so
9292
shell: bash
9393

94+
- name: 'Get latest criu release'
95+
id: get_criu_release
96+
uses: actions/github-script@v6
97+
with:
98+
script: |
99+
const repoOwner = 'dragonwell-project';
100+
const repoName = 'criu';
101+
const { data: release } = await github.rest.repos.getLatestRelease({
102+
owner: repoOwner,
103+
repo: repoName,
104+
});
105+
return release;
106+
107+
- name: 'Download asset and copy into jdk'
108+
run: |
109+
if [ "${{ inputs.platform }}" = "linux-aarch64" ];then
110+
keyword=arm64
111+
elif [ "${{ inputs.platform }}" = "linux-x64" ];then
112+
keyword=x64
113+
else
114+
echo "unsupport platform ${{ inputs.platform }}"
115+
exit 1
116+
fi
117+
url=""
118+
echo "${{ steps.get_criu_release.outputs.assets }}" | jq -c '.[]' | while read asset; do
119+
name="$(echo ${asset} | jq -r '.name')"
120+
if [ -n "$(echo ${name} | grep ${keyword})" ];then
121+
url="$(echo ${asset} | jq -r '.url')"
122+
break
123+
fi
124+
done
125+
if [ -n "${url}" ];then
126+
curl -OLSk -C - --retry 5 ${url} -o criu.tar.gz
127+
tar zxvf criu.tar.gz
128+
chmod +x criu
129+
mv criu ${{ steps.bundle_decompress.outputs.java_home }}/lib/
130+
fi
131+
shell: bash
132+
94133
- name: 'Regenerate bundle'
95134
run: |
96135
cd ${{ steps.bundle_decompress.outputs.bundle_home }}

.github/workflows/build-linux.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
else
116116
extra_packages=
117117
fi
118-
sudo apt-get install -y gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }} $extra_packages
118+
sudo apt-get install -y gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }} $extra_packages jq
119119
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
120120
if: inputs.platform != 'linux-aarch64'
121121

@@ -143,9 +143,9 @@ jobs:
143143
platform: ${{ inputs.platform }}
144144
debug-suffix: '${{ matrix.suffix }}'
145145

146-
- name: 'Build serverless-adapter'
147-
id: build-serverless-adapter
148-
uses: ./.github/actions/build-serverless-adapter
146+
- name: 'Build additional components'
147+
id: build-additional-components
148+
uses: ./.github/actions/build-additional-components
149149
with:
150150
platform: ${{ inputs.platform }}
151151
debug-suffix: '${{ matrix.suffix }}'

make/CompileDemos.gmk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ $(eval $(call SetupBuildDemo, TransparentRuler, \
219219
MAIN_CLASS := transparentruler.Ruler, \
220220
))
221221

222+
$(eval $(call SetupBuildDemo, JavaCompilerCRaC, \
223+
DEMO_SUBDIR := crac, \
224+
))
225+
222226
################################################################################
223227
# Copy html and README files.
224228

make/autoconf/libraries.m4

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,15 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
130130
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lthread"
131131
fi
132132
133+
# librt for legacy clock_gettime
134+
if test "x$OPENJDK_TARGET_OS" = xlinux; then
135+
# Hotspot needs to link librt to get the clock_* functions.
136+
# But once our supported minimum build and runtime platform
137+
# has glibc 2.17, this can be removed as the functions are
138+
# in libc.
139+
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lrt"
140+
fi
141+
133142
# Because RISC-V only has word-sized atomics, it requries libatomic where
134143
# other common architectures do not. So link libatomic by default.
135144
if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xriscv64; then

make/hotspot/symbols/symbols-shared

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ JNI_GetDefaultJavaVMInitArgs
3333
JVM_FindClassFromBootLoader
3434
JVM_GetVersionInfo
3535
JVM_InitAgentProperties
36+
JVM_Checkpoint
37+
JVM_RegisterPersistent
38+
JVM_DeregisterPersistent
39+
JVM_RegisterPseudoPersistent
40+
JVM_UnregisterPseudoPersistent

make/hotspot/symbols/symbols-unix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,5 @@ JVM_AddModuleExportsToAllUnnamed
199199
JVM_AddReadsModule
200200
JVM_DefineModule
201201
JVM_SetBootLoaderUnnamedModule
202+
203+
JVM_CheckpointEnabled

make/launcher/Launcher-java.base.gmk

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,41 @@ ifeq ($(call isTargetOs, macosx solaris aix linux), true)
9090
endif
9191

9292
################################################################################
93+
94+
ifeq ($(OPENJDK_TARGET_OS), linux)
95+
$(eval $(call SetupJdkExecutable, BUILD_CRIUENGINE, \
96+
NAME := criuengine, \
97+
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/criuengine, \
98+
INCLUDE_FILES := criuengine.c, \
99+
OPTIMIZATION := HIGH, \
100+
CFLAGS := $(CFLAGS_JDKEXE), \
101+
LDFLAGS := $(LDFLAGS), \
102+
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
103+
))
104+
TARGETS += $(BUILD_CRIUENGINE)
105+
106+
$(eval $(call SetupJdkExecutable, BUILD_PAUSEENGINE, \
107+
NAME := pauseengine, \
108+
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/pauseengine, \
109+
INCLUDE_FILES := pauseengine.c, \
110+
OPTIMIZATION := LOW, \
111+
CFLAGS := $(CFLAGS_JDKEXE), \
112+
LDFLAGS := $(LDFLAGS), \
113+
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
114+
))
115+
TARGETS += $(BUILD_PAUSEENGINE)
116+
117+
$(eval $(call SetupJdkExecutable, BUILD_SIMENGINE, \
118+
NAME := simengine, \
119+
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/simengine, \
120+
INCLUDE_FILES := simengine.c, \
121+
OPTIMIZATION := LOW, \
122+
CFLAGS := $(CFLAGS_JDKEXE), \
123+
LDFLAGS := $(LDFLAGS), \
124+
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
125+
))
126+
TARGETS += $(BUILD_SIMENGINE)
127+
128+
endif
129+
130+
################################################################################
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class Compile {
2+
public static void main(String... args) throws Exception {
3+
JavaCompilerCRaC.runJavac(args);
4+
}
5+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import java.util.Arrays;
2+
import jdk.crac.Core;
3+
4+
public class JavaCompilerCRaC {
5+
6+
static void runJavac(String... args) {
7+
System.out.println("javac " + String.join(" ", args));
8+
int status = com.sun.tools.javac.Main.compile(args);
9+
if (status != 0) {
10+
System.exit(status);
11+
}
12+
}
13+
14+
public static void main(String... args) throws Exception {
15+
int startIdx = 0;
16+
for (int endIdx = 1; endIdx < args.length; ++endIdx) {
17+
if (args[endIdx].equals("--")) {
18+
runJavac(Arrays.copyOfRange(args, startIdx, endIdx));
19+
startIdx = endIdx + 1;
20+
}
21+
}
22+
23+
if (startIdx < args.length) {
24+
runJavac(Arrays.copyOfRange(args, startIdx, args.length));
25+
}
26+
27+
Core.checkpointRestore();
28+
}
29+
}

0 commit comments

Comments
 (0)