diff --git a/build-farm/platform-specific-configurations/linux.sh b/build-farm/platform-specific-configurations/linux.sh index 4954e4b01..9cea6c552 100755 --- a/build-farm/platform-specific-configurations/linux.sh +++ b/build-farm/platform-specific-configurations/linux.sh @@ -135,17 +135,23 @@ if [ "${VARIANT}" == "${BUILD_VARIANT_DRAGONWELL}" ] && [ "$JAVA_FEATURE_VERSION fi export "${BOOT_JDK_VARIABLE}"="$PWD/jdk-8" fi -elif [ "${VARIANT}" == "${BUILD_VARIANT_LOONGSON}" ]; then - if [ "$(uname -m)" = "loongarch64" ]; then - if [ -d /opt/j2sdk-images ]; then - export "${BOOT_JDK_VARIABLE}"=/opt/j2sdk-images - else +fi + +if [ "${VARIANT}" == "${BUILD_VARIANT_LOONGSON}" ] && [ "$JAVA_FEATURE_VERSION" -eq 8 ]; then + if [ "${ARCHITECTURE}" == "loongarch64" ]; then echo Loongson jdk8 requires a Loongson boot JDK - downloading one ... mkdir -p "$PWD/jdk-8" curl -L "http://ftp.loongnix.cn/Java/openjdk8/loongson8.1.11-jdk8u332b09-linux-loongarch64.tar.gz" | tar xpzf - --strip-components=1 -C "$PWD/jdk-8" export "${BOOT_JDK_VARIABLE}"="$PWD/jdk-8" - fi fi +else + echo "Only Java 8 is supported for now" + exit 1 +fi + +if [ "${ARCHITECTURE}" == "loongarch64" ] +then + export LANG=C fi if [ ! -d "$(eval echo "\$$BOOT_JDK_VARIABLE")" ]; then diff --git a/configureBuild.sh b/configureBuild.sh index 3026dc6e3..72ceba0f4 100755 --- a/configureBuild.sh +++ b/configureBuild.sh @@ -174,7 +174,7 @@ setRepository() { elif [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_BISHENG}" ]]; then suffix="openeuler-mirror/bishengjdk-${BUILD_CONFIG[OPENJDK_CORE_VERSION]:3}" elif [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_LOONGSON}" ]]; then - suffix="Panxuefeng-loongson/jdk8u" + suffix="loongson/jdk8u" elif [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ] && [ "${BUILD_CONFIG[OS_ARCHITECTURE]}" == "armv7l" ] && [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_TEMURIN}" ]]; then suffix="adoptium/aarch32-jdk8u"; elif [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ] && [ "${BUILD_CONFIG[OS_ARCHITECTURE]}" == "armv7l" ] && [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_HOTSPOT}" ]]; then diff --git a/sbin/build.sh b/sbin/build.sh index 563d20be2..ab1c07c50 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -244,14 +244,15 @@ getOpenJdkVersion() { version=$(echo "$version" | cut -d'-' -f 2 | cut -d'_' -f 1) fi elif [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_LOONGSON}" ]; then - local loongsonVerFile=${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/version.txt + local loongsonVerFile="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[TARGET_DIR]}/metadata/scmref.txt" if [ -r "${loongsonVerFile}" ]; then if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]; then - local updateNum="$(cut -d'.' -f 2 <"${loongsonVerFile}")" - local buildNum="$(cut -d'.' -f 5 <"${loongsonVerFile}")" - version="jdk8u${updateNum}-b${buildNum}" + local updateNum="$(cat "$loongsonVerFile" | awk -F - '{print $1}' | awk -F u '{print $2}')" + local buildNum="$(cat "$loongsonVerFile" | awk -F - '{print $2}')" + version="jdk8u${updateNum}-${buildNum}" else echo "Only Java 8 is supported for now" + exit 1 fi else version=${BUILD_CONFIG[TAG]:-$(getFirstTagFromOpenJDKGitRepo)} @@ -319,7 +320,7 @@ configureVersionStringParameter() { BUILD_CONFIG[VENDOR_VM_BUG_URL]="https://gitee.com/openeuler/bishengjdk-${BUILD_CONFIG[OPENJDK_FEATURE_NUMBER]}/issues" elif [[ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_LOONGSON}" ]]; then BUILD_CONFIG[VENDOR]="Loongson" - BUILD_CONFIG[VENDOR_VERSION]="loongson" + BUILD_CONFIG[VENDOR_VERSION]="Loongson" BUILD_CONFIG[VENDOR_BUG_URL]="https://github.com/loongson/jdk8u/issues" BUILD_CONFIG[VENDOR_VM_BUG_URL]="https://github.com/loongson/jdk8u/issues" fi @@ -1399,7 +1400,7 @@ getFirstTagFromOpenJDKGitRepo() { fi if [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_LOONGSON}" ]; then - TAG_SEARCH="ls-loongson-jdk8u-init" + TAG_SEARCH="jdk8u*ls-*" fi # If openj9 and the closed/openjdk-tag.gmk file exists which specifies what level the openj9 jdk code is based upon,