-
-
Save ganadist/3e38cfe88fe1346c46ca1ee964e45dd9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# vim: ts=2 sw=2 sts=2 et ai | |
set -e | |
BUILD_BASE=$(dirname $(realpath $0)) | |
MX_HOME="${BUILD_BASE}/mx" | |
MX_PYTHON=python3 | |
PATH="${MX_HOME}:$PATH" | |
export MX_HOME MX_PYTHON PATH BUILD_BASE | |
case $(uname -s) in | |
Darwin) | |
export CONF_NAME=macos-aarch64 | |
export DEVELOPER_DIR=/Applications/Xcode-14.3.1.app/Contents/Developer | |
export DEVELOPER_DIR=/Applications/Xcode-13.4.1.app/Contents/Developer | |
export _CFLAGS="-mtune=generic -O3 -pipe -fno-plt \ | |
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ | |
-fcommon" | |
export _CXXFLAGS="$CFLAGS" | |
#export _LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" | |
;; | |
Linux) | |
# https://gitlab.archlinux.org/archlinux/packaging/packages/java-openjdk/-/blob/main/PKGBUILD?ref_type=heads | |
# https://www.phoronix.com/review/gcc11-rocket-opts | |
export CONF_NAME=linux-x64 | |
export _CFLAGS="-Ofast -pipe -fno-plt \ | |
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ | |
-fstack-clash-protection -fcf-protection -fcommon" | |
export _CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS" | |
export _LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" | |
;; | |
esac | |
export CONF_NAME=labsjdk | |
build_jdk() { | |
local SRC_DIR=$1 | |
local BOOTJDK=$2 | |
cd "$SRC_DIR" | |
JVMCI_TAG=$(git describe --tags) | |
JAVA_VERSION=$(git describe --tags --exclude=jvmci\* --abbrev=0) | |
BUILD_NUMBER=${JAVA_VERSION##*+} | |
bash ./configure \ | |
--with-conf-name=${CONF_NAME} \ | |
--without-version-pre \ | |
--with-vendor-name="GraalVM Community" \ | |
--with-vendor-url="https://www.graalvm.org/" \ | |
--with-vendor-bug-url="https://github.com/oracle/graal/issues" \ | |
--with-vendor-vm-bug-url="https://github.com/oracle/graal/issues" \ | |
--with-version-opt="${JVMCI_TAG}" \ | |
--with-vendor-version-string="${JAVA_VERSION}-${JVMCI_TAG}" \ | |
--with-version-build="${BUILD_NUMBER}" \ | |
--with-boot-jdk="${BOOTJDK}" \ | |
--disable-warnings-as-errors \ | |
--with-jvm-variants=server \ | |
--with-stdc++lib=static \ | |
--with-debug-level=release \ | |
--with-zlib=system \ | |
--with-extra-cflags="${_CFLAGS}" \ | |
--with-extra-cxxflags="${_CXXFLAGS}" \ | |
--with-extra-ldflags="${_LDFLAGS}" \ | |
make CONF_NAME=${CONF_NAME} graal-builder-image JOBS=8 | |
} | |
build_graal() { | |
local JDK_DIR=$1 | |
local OUT_DST=$2 | |
local TAGS=$3 | |
OUT_BASE=$(dirname ${OUT_DST}) | |
rm -rf "${OUT_DST}" | |
mkdir -p "${OUT_BASE}" | |
cd "${BUILD_BASE}/graal" | |
# https://github.com/oracle/graal/blob/master/.github/workflows/main.yml#L109-L116 | |
export DYNAMIC_IMPORTS=/tools,/substratevm | |
export NATIVE_IMAGES=lib:jvmcicompiler,native-image,lib:native-image-agent,lib:native-image-diagnostics-agent,polyglot | |
export WITHOUT_VCS=true | |
"${MX_HOME}/mx" \ | |
--primary-suite-path vm \ | |
--java-home="${JDK_DIR}" \ | |
gate \ | |
--strict-mode \ | |
--no-warning-as-error \ | |
--tags build | |
} | |
( | |
build_jdk \ | |
"${BUILD_BASE}/labs-openjdk-17" \ | |
"${BUILD_BASE}/java-17-openjdk" | |
build_graal \ | |
"${BUILD_BASE}/labs-openjdk-17/build/${CONF_NAME}/images/graal-builder-jdk" \ | |
"${BUILD_BASE}/dist/graaljdk-17" \ | |
) | |
( | |
build_jdk \ | |
"${BUILD_BASE}/labs-openjdk-21" \ | |
"${BUILD_BASE}/jdk-21" | |
build_graal \ | |
"${BUILD_BASE}/labs-openjdk-21/build/${CONF_NAME}/images/graal-builder-jdk" \ | |
"${BUILD_BASE}/dist/graaljdk-21" \ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM quay.io/centos/centos:7 | |
RUN yum -y groupinstall "Development Tools" && \ | |
yum -y install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel cups-devel fontconfig-devel alsa-lib-devel && \ | |
yum -y install centos-release-scl && \ | |
yum -y install devtoolset-11-gcc-c++ rh-python38-python rh-git227 | |
#ENTRYPOINT ["scl", "enable", "devtoolset-11", "rh-python38", "rh-git227", "--", "bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/sdk/mx.sdk/mx_sdk_vm.py b/sdk/mx.sdk/mx_sdk_vm.py | |
index 053d9e3d404..2e6a58501b0 100644 | |
--- a/sdk/mx.sdk/mx_sdk_vm.py | |
+++ b/sdk/mx.sdk/mx_sdk_vm.py | |
@@ -1090,7 +1090,7 @@ def jlink_new_jdk(jdk, dst_jdk_dir, module_dists, ignore_dists, | |
if isfile(release_file): | |
jlink.append(f'--release-info={release_file}') | |
- if jlink_has_save_jlink_argfiles(jdk): | |
+ if 0 and jlink_has_save_jlink_argfiles(jdk): | |
jlink_persist_argfile = join(build_dir, 'jlink.persist.options') | |
with open(jlink_persist_argfile, 'w') as fp: | |
fp.write('\n'.join(jlink_persist)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/Defa> | |
index c5e2f4adc1b..a6355afd7c2 100644 | |
--- a/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java | |
+++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java | |
@@ -175,6 +175,10 @@ public final class DefaultImageBuilder implements ImageBuilder { | |
if (value == null) { | |
throw new PluginException("ModuleTarget attribute is missing for java.base module"); | |
} | |
+ // https://issuetracker.google.com/issues/294137077 | |
+ if (value.equals("android")) { | |
+ value = "LINUX-OTHER"; | |
+ } | |
try { | |
this.platform = Platform.parsePlatform(value); | |
} catch (IllegalArgumentException iae) { |
Author
ganadist
commented
Sep 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment