Skip to content

Commit 6d05a1d

Browse files
Luigi96erikj79
authored andcommitted
8357079: Fix Windows AArch64 DevKit Creation
Reviewed-by: erikj, ihse
1 parent 8ea544c commit 6d05a1d

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

make/devkit/createWindowsDevkit.sh

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,30 @@ IS_WSL=`echo $UNAME_RELEASE | grep Microsoft`
6464
IS_MSYS=`echo $UNAME_OS | grep -i Msys`
6565
MSYS2_ARG_CONV_EXCL="*" # make "cmd.exe /c" work for msys2
6666
CMD_EXE="cmd.exe /c"
67+
68+
# Detect host architecture to determine devkit platform support
69+
# Note: The devkit always includes x86, x64, and aarch64 libraries and tools
70+
# The difference is in toolchain capabilities:
71+
# - On x64|AMD64 hosts: aarch64 tools are cross-compilation tools (Hostx64/arm64)
72+
# - On aarch64|ARMv8 hosts: aarch64 tools are native tools (Hostarm64/arm64)
73+
HOST_ARCH=`echo $PROCESSOR_IDENTIFIER`
74+
case $HOST_ARCH in
75+
AMD64)
76+
echo "Running on x64 host - generating devkit with native x86/x64 tools and cross-compiled aarch64 tools."
77+
echo "For native aarch64 compilation tools, run this script on a Windows/aarch64 machine."
78+
SUPPORTED_PLATFORMS="x86, x64 (native) and aarch64 (cross-compiled)"
79+
;;
80+
ARMv8)
81+
echo "Running on aarch64 host - generating devkit with native tools for all platforms (x86, x64, aarch64)."
82+
SUPPORTED_PLATFORMS="x86, x64, and aarch64 (all native)"
83+
;;
84+
*)
85+
echo "Unknown host architecture: $HOST_ARCH"
86+
echo "Proceeding with devkit generation - toolchain capabilities may vary."
87+
SUPPORTED_PLATFORMS="x86, x64, and aarch64"
88+
;;
89+
esac
90+
6791
if test "x$IS_CYGWIN" != "x"; then
6892
BUILD_ENV="cygwin"
6993
elif test "x$IS_MSYS" != "x"; then
@@ -139,6 +163,7 @@ DEVKIT_ROOT="${BUILD_DIR}/VS${VS_VERSION}-${VS_VERSION_SP}-devkit"
139163
DEVKIT_BUNDLE="${DEVKIT_ROOT}.tar.gz"
140164

141165
echo "Creating devkit in $DEVKIT_ROOT"
166+
echo "Platform support: $SUPPORTED_PLATFORMS"
142167

143168
MSVCR_DLL=${MSVC_CRT_DIR}/vcruntime${VS_DLL_VERSION}.dll
144169
VCRUNTIME_1_DLL=${MSVC_CRT_DIR}/vcruntime${VS_DLL_VERSION}_1.dll
@@ -156,7 +181,11 @@ REDIST_SUBDIR="VC/Redist/MSVC/$REDIST_VERSION"
156181
echo "Copying VC..."
157182
rm -rf $DEVKIT_ROOT/VC
158183
mkdir -p $DEVKIT_ROOT/VC/bin
159-
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/arm64" $DEVKIT_ROOT/VC/bin/
184+
if [ -d "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostarm64/arm64" ]; then
185+
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostarm64/arm64" $DEVKIT_ROOT/VC/bin/
186+
else
187+
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/arm64" $DEVKIT_ROOT/VC/bin/
188+
fi
160189
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx64/x64" $DEVKIT_ROOT/VC/bin/
161190
cp -r "$VS_INSTALL_DIR/${VC_SUBDIR}/bin/Hostx86/x86" $DEVKIT_ROOT/VC/bin/
162191
mkdir -p $DEVKIT_ROOT/VC/lib

0 commit comments

Comments
 (0)