From 206787d0cfeeaafe710c75b8c301f9a3f579fd0c Mon Sep 17 00:00:00 2001 From: Foivos Date: Sat, 1 Jun 2024 08:13:29 +0300 Subject: [PATCH] Fix OS architecture for darwin aarch64 builds of static libs (#3827) This is a follow up to https://github.com/adoptium/temurin-build/pull/2725. `uname -m` seems to return `arm64` on MacOS but the expected naming seems to be `aarch64` ( which is consistend with linux and windows as well) as observed in https://github.com/graalvm/mandrel-packaging/pull/415#issuecomment-2134025210 Co-authored-by: Martijn Verburg --- sbin/build.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sbin/build.sh b/sbin/build.sh index 9400ae9af..79eb6a9ca 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -1516,12 +1516,16 @@ cleanAndMoveArchiveFiles() { osArch="amd64" fi - # TODO: Remove the "if" below once OS_ARCHITECTURE has been replaced. - # This is because OS_ARCHITECTURE is currently the build arch, not the target arch, - # and that confuses things when cross-compiling an x64 mac build on arm mac. if [ "${BUILD_CONFIG[OS_ARCHITECTURE]}" = "arm64" ]; then + # TODO: Remove the "if" below once OS_ARCHITECTURE has been replaced. + # This is because OS_ARCHITECTURE is currently the build arch, not the target arch, + # and that confuses things when cross-compiling an x64 mac build on arm mac. if [[ "${BUILD_CONFIG[TARGET_FILE_NAME]}" =~ .*_x64_.* ]]; then osArch="amd64" + else + # GraalVM expects aarch64 for arm64 builds on MacOS. This is also consistent + # with linux and windows builds. + osArch="aarch64" fi fi