Skip to content

Commit

Permalink
Exclude excessive build warnings on mac for jdk11 and jdk17
Browse files Browse the repository at this point in the history
Also included some aggregate logic to avoid cflags overriding other
cflags unintentionally

Signed-off-by: Adam Farley <adfarley@redhat.com>
  • Loading branch information
adamfarley committed Dec 12, 2023
1 parent 380140f commit 5dbc313
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion build-farm/platform-specific-configurations/mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ source "$SCRIPT_DIR/../../sbin/common/constants.sh"
export MACOSX_DEPLOYMENT_TARGET=10.9
export BUILD_ARGS="${BUILD_ARGS}"

c_flags_bucket=""
cxx_flags_bucket=""

## JDK8 only: If, at this point in the build, the architecure of the machine is arm64 while the ARCHITECTURE variable
## is x64 then we need to add the cross compilation option --openjdk-target=x86_64-apple-darwin
MACHINEARCHITECTURE=$(uname -m)
Expand Down Expand Up @@ -51,6 +54,13 @@ else
# JDK17 requires metal (included in full xcode) as does JDK11 on aarch64
# JDK11 on x64 is matched for consistency
XCODE_SWITCH_PATH="/Applications/Xcode.app"
# JDK11 and 17 on Mac (x86 and aarch) has excessive warnings.
# This is due to a harfbuzz fix which is pending backport.
# Suppressing the warnings for now to aid triage.
if [[ "$JAVA_FEATURE_VERSION" -le 17 ]]; then
export cxx_flags_bucket="${cxx_flags_bucket} -Wno-deprecated-builtins -Wno-deprecated-declarations -Wno-deprecated-non-prototype"
export c_flags_bucket="${c_flags_bucket} -Wno-deprecated-builtins -Wno-deprecated-declarations -Wno-deprecated-non-prototype"
fi
else
# Command line tools used from JDK9-JDK10
XCODE_SWITCH_PATH="/";
Expand All @@ -61,7 +71,7 @@ else
else
if [ "${ARCHITECTURE}" == "x64" ]; then
# We can only target 10.9 on intel macs
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-cxxflags=-mmacosx-version-min=10.9"
export cxx_flags_bucket="${cxx_flags_bucket} -mmacosx-version-min=10.9"
elif [ "${ARCHITECTURE}" == "aarch64" ]; then
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --openjdk-target=aarch64-apple-darwin"
fi
Expand Down Expand Up @@ -156,3 +166,11 @@ if [ "${VARIANT}" == "${BUILD_VARIANT_OPENJ9}" ]; then
export SDKPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
fi
fi

if [ ! "${c_flags_bucket}" = "" ]; then
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-cflags='${c_flags_bucket}'"
fi

if [ ! "${cxx_flags_bucket}" = "" ]; then
export CONFIGURE_ARGS_FOR_ANY_PLATFORM="${CONFIGURE_ARGS_FOR_ANY_PLATFORM} --with-extra-cxxflags='${cxx_flags_bucket}'"
fi

0 comments on commit 5dbc313

Please sign in to comment.