Skip to content

Commit

Permalink
Merge branch 'master' into license
Browse files Browse the repository at this point in the history
  • Loading branch information
karianna authored Mar 24, 2024
2 parents c65b428 + 17b50e9 commit 20666bf
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 22 deletions.
59 changes: 37 additions & 22 deletions configureBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,21 @@ setWorkingDirectory() {
determineBuildProperties() {
local build_type=
local default_build_full_name=
# From jdk12 there is no build type in the build output directory name
if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK12_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK13_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK14_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK15_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDKHEAD_CORE_VERSION}" ]; then
build_type=normal
default_build_full_name=${BUILD_CONFIG[OS_KERNEL_NAME]}-${BUILD_CONFIG[OS_ARCHITECTURE]}-${BUILD_CONFIG[JVM_VARIANT]}-release
if [ -z "${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}" ] ; then
# From jdk12 there is no build type in the build output directory name
if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK12_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK13_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK14_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK15_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDKHEAD_CORE_VERSION}" ]; then
build_type=normal
default_build_full_name=${BUILD_CONFIG[OS_KERNEL_NAME]}-${BUILD_CONFIG[OS_ARCHITECTURE]}-${BUILD_CONFIG[JVM_VARIANT]}-release
else
default_build_full_name=${BUILD_CONFIG[OS_KERNEL_NAME]}-${BUILD_CONFIG[OS_ARCHITECTURE]}-${build_type}-${BUILD_CONFIG[JVM_VARIANT]}-release
fi
else
default_build_full_name=${BUILD_CONFIG[OS_KERNEL_NAME]}-${BUILD_CONFIG[OS_ARCHITECTURE]}-${build_type}-${BUILD_CONFIG[JVM_VARIANT]}-release
# User defined build output directory
default_build_full_name="${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}"
fi
BUILD_CONFIG[BUILD_FULL_NAME]=${BUILD_CONFIG[BUILD_FULL_NAME]:-"$default_build_full_name"}
}
Expand Down Expand Up @@ -231,34 +236,44 @@ processArgumentsforSpecificArchitectures() {
jvm_variant=server
fi

if [ "${BUILD_CONFIG[OPENJDK_FEATURE_NUMBER]}" -ge 12 ]; then
build_full_name=linux-s390x-${jvm_variant}-release
# Determine correct autoconf configuration name
if [ -z "${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}" ] ; then
if [ "${BUILD_CONFIG[OPENJDK_FEATURE_NUMBER]}" -ge 12 ]; then
build_full_name=linux-s390x-${jvm_variant}-release
else
build_full_name=linux-s390x-normal-${jvm_variant}-release
fi
else
build_full_name=linux-s390x-normal-${jvm_variant}-release
build_full_name="${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}"
fi

# This is to ensure consistency with the defaults defined in setMakeArgs()
if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]; then
make_args_for_any_platform="CONF=${build_full_name} DEBUG_BINARIES=true images"
make_args_for_any_platform="DEBUG_BINARIES=true images"
# Don't produce a JRE
elif [ "${BUILD_CONFIG[CREATE_JRE_IMAGE]}" == "false" ]; then
make_args_for_any_platform="CONF=${build_full_name} DEBUG_BINARIES=true product-images"
make_args_for_any_platform="DEBUG_BINARIES=true product-images"
else
make_args_for_any_platform="CONF=${build_full_name} DEBUG_BINARIES=true product-images legacy-jre-image"
make_args_for_any_platform="DEBUG_BINARIES=true product-images legacy-jre-image"
fi
;;

"ppc64le")
jvm_variant=server

if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK12_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK13_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK14_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK15_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDKHEAD_CORE_VERSION}" ]; then
build_full_name=linux-ppc64-${jvm_variant}-release
# Determine correct autoconf configuration name
if [ -z "${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}" ] ; then
if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK12_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK13_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK14_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK15_CORE_VERSION}" ] ||
[ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDKHEAD_CORE_VERSION}" ]; then
build_full_name=linux-ppc64-${jvm_variant}-release
else
build_full_name=linux-ppc64-normal-${jvm_variant}-release
fi
else
build_full_name=linux-ppc64-normal-${jvm_variant}-release
build_full_name="${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}"
fi

if [ "$(command -v rpm)" ]; then
Expand Down
33 changes: 33 additions & 0 deletions sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,39 @@ configureReproducibleBuildParameter() {
addConfigureArg "--with-extra-cflags=" "-qnotimestamps"
addConfigureArg "--with-extra-cxxflags=" "-qnotimestamps"
fi

# For jdk21u a workaround is required for debug symbol mapping
# until https://bugs.openjdk.org/browse/JDK-8326685 is backported in jdk-21.0.4
if [[ "${BUILD_CONFIG[OPENJDK_FEATURE_NUMBER]}" -eq 21 ]]
then
configureReproducibleBuildDebugMapping
fi
fi
}

# For reproducible builds we need to add debug mappings for the openjdk build outputdir
# so that debug symbol files (and thus libraries) are deterministic
configureReproducibleBuildDebugMapping() {
# Workaround until https://bugs.openjdk.org/browse/JDK-8326685 is backported to jdk21u
if [ "${BUILD_CONFIG[OS_KERNEL_NAME]}" == "linux" ]; then
local buildOutputDir
if [ -z "${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}" ] ; then
if [ "${BUILD_CONFIG[OS_ARCHITECTURE]}" == "armv7l" ]; then
buildOutputDir="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/build/linux-arm-serverANDclient-release/"
else
buildOutputDir="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/build/linux-${BUILD_CONFIG[OS_ARCHITECTURE]}-server-release/"
fi
else
buildOutputDir="${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}/"
fi

# Ensure directory is correctly formed so is mapped, with no ./ or //
buildOutputDir=$(echo ${buildOutputDir} | sed 's,\./,,' | sed 's,//,/,')

local fdebug_flags="-fdebug-prefix-map=${buildOutputDir}="

addConfigureArg "--with-extra-cflags=" "'${fdebug_flags}'"
addConfigureArg "--with-extra-cxxflags=" "'${fdebug_flags}'"
fi
}

Expand Down

0 comments on commit 20666bf

Please sign in to comment.