Skip to content

Commit

Permalink
Merge branch 'dragonwell-project:master' into printConstraintFuncs
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyilin authored Oct 28, 2024
2 parents 2d7ef1f + 85a2ef0 commit 7377313
Show file tree
Hide file tree
Showing 160 changed files with 11,233 additions and 624 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#

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

- name: 'Get latest criu release'
id: get_criu_release
uses: actions/github-script@v6
with:
script: |
const repoOwner = 'dragonwell-project';
const repoName = 'criu';
const { data: release } = await github.rest.repos.getLatestRelease({
owner: repoOwner,
repo: repoName,
});
return release;
- name: 'Download asset and copy into jdk'
run: |
if [ "${{ inputs.platform }}" = "linux-aarch64" ];then
keyword=arm64
elif [ "${{ inputs.platform }}" = "linux-x64" ];then
keyword=x64
else
echo "unsupport platform ${{ inputs.platform }}"
exit 1
fi
url=""
echo "${{ steps.get_criu_release.outputs.assets }}" | jq -c '.[]' | while read asset; do
name="$(echo ${asset} | jq -r '.name')"
if [ -n "$(echo ${name} | grep ${keyword})" ];then
url="$(echo ${asset} | jq -r '.url')"
break
fi
done
if [ -n "${url}" ];then
curl -OLSk -C - --retry 5 ${url} -o criu.tar.gz
tar zxvf criu.tar.gz
chmod +x criu
mv criu ${{ steps.bundle_decompress.outputs.java_home }}/lib/
fi
shell: bash

- name: 'Regenerate bundle'
run: |
cd ${{ steps.bundle_decompress.outputs.bundle_home }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
else
extra_packages=
fi
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
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
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 }}
if: inputs.platform != 'linux-aarch64'

Expand Down Expand Up @@ -143,9 +143,9 @@ jobs:
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'

- name: 'Build serverless-adapter'
id: build-serverless-adapter
uses: ./.github/actions/build-serverless-adapter
- name: 'Build additional components'
id: build-additional-components
uses: ./.github/actions/build-additional-components
with:
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'
Expand Down
4 changes: 4 additions & 0 deletions make/CompileDemos.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ $(eval $(call SetupBuildDemo, TransparentRuler, \
MAIN_CLASS := transparentruler.Ruler, \
))

$(eval $(call SetupBuildDemo, JavaCompilerCRaC, \
DEMO_SUBDIR := crac, \
))

################################################################################
# Copy html and README files.

Expand Down
9 changes: 9 additions & 0 deletions make/autoconf/libraries.m4
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lthread"
fi
# librt for legacy clock_gettime
if test "x$OPENJDK_TARGET_OS" = xlinux; then
# Hotspot needs to link librt to get the clock_* functions.
# But once our supported minimum build and runtime platform
# has glibc 2.17, this can be removed as the functions are
# in libc.
BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lrt"
fi
# Because RISC-V only has word-sized atomics, it requries libatomic where
# other common architectures do not. So link libatomic by default.
if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xriscv64; then
Expand Down
5 changes: 5 additions & 0 deletions make/hotspot/symbols/symbols-shared
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ JNI_GetDefaultJavaVMInitArgs
JVM_FindClassFromBootLoader
JVM_GetVersionInfo
JVM_InitAgentProperties
JVM_Checkpoint
JVM_RegisterPersistent
JVM_DeregisterPersistent
JVM_RegisterPseudoPersistent
JVM_UnregisterPseudoPersistent
2 changes: 2 additions & 0 deletions make/hotspot/symbols/symbols-unix
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,5 @@ JVM_AddModuleExportsToAllUnnamed
JVM_AddReadsModule
JVM_DefineModule
JVM_SetBootLoaderUnnamedModule

JVM_CheckpointEnabled
38 changes: 38 additions & 0 deletions make/launcher/Launcher-java.base.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,41 @@ ifeq ($(call isTargetOs, macosx solaris aix linux), true)
endif

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

ifeq ($(OPENJDK_TARGET_OS), linux)
$(eval $(call SetupJdkExecutable, BUILD_CRIUENGINE, \
NAME := criuengine, \
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/criuengine, \
INCLUDE_FILES := criuengine.c, \
OPTIMIZATION := HIGH, \
CFLAGS := $(CFLAGS_JDKEXE), \
LDFLAGS := $(LDFLAGS), \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
))
TARGETS += $(BUILD_CRIUENGINE)

$(eval $(call SetupJdkExecutable, BUILD_PAUSEENGINE, \
NAME := pauseengine, \
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/pauseengine, \
INCLUDE_FILES := pauseengine.c, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKEXE), \
LDFLAGS := $(LDFLAGS), \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
))
TARGETS += $(BUILD_PAUSEENGINE)

$(eval $(call SetupJdkExecutable, BUILD_SIMENGINE, \
NAME := simengine, \
SRC := $(TOPDIR)/src/$(MODULE)/unix/native/simengine, \
INCLUDE_FILES := simengine.c, \
OPTIMIZATION := LOW, \
CFLAGS := $(CFLAGS_JDKEXE), \
LDFLAGS := $(LDFLAGS), \
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
))
TARGETS += $(BUILD_SIMENGINE)

endif

################################################################################
5 changes: 5 additions & 0 deletions src/demo/share/crac/JavaCompilerCRaC/Compile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class Compile {
public static void main(String... args) throws Exception {
JavaCompilerCRaC.runJavac(args);
}
}
29 changes: 29 additions & 0 deletions src/demo/share/crac/JavaCompilerCRaC/JavaCompilerCRaC.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import java.util.Arrays;
import jdk.crac.Core;

public class JavaCompilerCRaC {

static void runJavac(String... args) {
System.out.println("javac " + String.join(" ", args));
int status = com.sun.tools.javac.Main.compile(args);
if (status != 0) {
System.exit(status);
}
}

public static void main(String... args) throws Exception {
int startIdx = 0;
for (int endIdx = 1; endIdx < args.length; ++endIdx) {
if (args[endIdx].equals("--")) {
runJavac(Arrays.copyOfRange(args, startIdx, endIdx));
startIdx = endIdx + 1;
}
}

if (startIdx < args.length) {
runJavac(Arrays.copyOfRange(args, startIdx, args.length));
}

Core.checkpointRestore();
}
}
Loading

0 comments on commit 7377313

Please sign in to comment.