@@ -1026,14 +1026,33 @@ jobs:
10261026 - name : Set up build environment (Linux)
10271027 if : ${{ runner.os == 'Linux' }}
10281028 run : |
1029+ # Create workspace directory
1030+ WORKSPACE="${RUNNER_TEMP}/workspace"
1031+ mkdir -p ${WORKSPACE}
1032+
1033+ # Install dependencies for cross compilation
1034+ if [ "${{ matrix.host.name }}" == "windows-x86_64" ]; then
1035+ # Make MinGW-w64 win32 cross toolchain available in PATH
1036+ echo "/opt/mingw-w64-win32/bin" >> $GITHUB_PATH
1037+ export PATH="/opt/mingw-w64-win32/bin:$PATH"
1038+ fi
1039+
10291040 # Set environment variables
10301041 echo "TAR=tar" >> $GITHUB_ENV
1042+ echo "WORKSPACE=${WORKSPACE}" >> $GITHUB_ENV
10311043
10321044 - name : Set up build environment (macOS)
10331045 if : ${{ runner.os == 'macOS' }}
10341046 run : |
1047+ # Create case-sensitive workspace volume for macOS
1048+ WORKSPACE="/Volumes/Workspace"
1049+ hdiutil create ${RUNNER_TEMP}/Workspace.sparseimage \
1050+ -volname Workspace -type SPARSE -size 150g -fs HFSX
1051+ hdiutil mount ${RUNNER_TEMP}/Workspace.sparseimage -mountpoint ${WORKSPACE}
1052+
10351053 # Set environment variables
10361054 echo "TAR=gtar" >> $GITHUB_ENV
1055+ echo "WORKSPACE=${WORKSPACE}" >> $GITHUB_ENV
10371056
10381057 - name : Check out source code
10391058 if : ${{ github.event_name != 'pull_request_target' }}
@@ -1082,7 +1101,7 @@ jobs:
10821101 echo "SRC_CACHE_URI=${SRC_CACHE_URI}" >> $GITHUB_ENV
10831102 echo "POKY_DOWNLOADS=${POKY_DOWNLOADS}" >> $GITHUB_ENV
10841103
1085- - name : Build Linux host tools
1104+ - name : Build host tools (Linux)
10861105 if : startsWith(matrix.host.name, 'linux-')
10871106 run : |
10881107 POKY_BASE=${GITHUB_WORKSPACE}/meta-zephyr-sdk
@@ -1115,6 +1134,47 @@ jobs:
11151134 md5sum ${ARCHIVE_FILE} > md5.sum
11161135 sha256sum ${ARCHIVE_FILE} > sha256.sum
11171136
1137+ - name : Build host tools (non-Linux)
1138+ if : " !startsWith(matrix.host.name, 'linux-')"
1139+ run : |
1140+ # Create output directory
1141+ mkdir -p ${WORKSPACE}/hosttools
1142+
1143+ # Build QEMU
1144+ QEMU_BUILD="${WORKSPACE}/build/qemu"
1145+ QEMU_SOURCE="${GITHUB_WORKSPACE}/qemu"
1146+ QEMU_PREFIX="${WORKSPACE}/hosttools/qemu"
1147+
1148+ mkdir -p ${QEMU_BUILD}
1149+ pushd ${QEMU_BUILD}
1150+ ${GITHUB_WORKSPACE}/scripts/build_qemu.sh \
1151+ ${{ matrix.host.name }} \
1152+ ${GITHUB_WORKSPACE}/qemu \
1153+ ${QEMU_PREFIX}
1154+ popd
1155+
1156+ # TODO: Build ARC QEMU
1157+ # TODO: Build Xilinx QEMU
1158+ # TODO: Build OpenOCD
1159+
1160+ # Create archive
1161+ ARCHIVE_NAME=hosttools_${{ matrix.host.name }}
1162+ ARCHIVE_FILE=hosttools_${{ matrix.host.name }}.tar.xz
1163+
1164+ if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
1165+ XZ_OPT="-T0" \
1166+ ${TAR} -Jcvf ${ARCHIVE_FILE} \
1167+ --owner=0 --group=0 -C ${WORKSPACE} hosttools
1168+ elif [ "${{ matrix.host.archive }}" == "7z" ]; then
1169+ pushd ${WORKSPACE}
1170+ 7z a -t7z -l ${GITHUB_WORKSPACE}/${ARCHIVE_FILE} hosttools
1171+ popd
1172+ fi
1173+
1174+ # Compute checksum
1175+ md5sum ${ARCHIVE_FILE} > md5.sum
1176+ sha256sum ${ARCHIVE_FILE} > sha256.sum
1177+
11181178 - name : Setup debug session
11191179 if : always() && needs.setup.outputs.debug == 'hosttools'
11201180 uses : mxschmitt/action-tmate@v3
@@ -1132,7 +1192,6 @@ jobs:
11321192 popd
11331193
11341194 - name : Upload toolchain build artifact
1135- if : startsWith(matrix.host.name, 'linux-') # FIXME: Do for all
11361195 uses : actions/upload-artifact@v4
11371196 with :
11381197 name : hosttools_${{ matrix.host.name }}
@@ -1141,9 +1200,6 @@ jobs:
11411200 md5.sum
11421201 sha256.sum
11431202
1144- # TODO: Add host tool build process for macOS hosts.
1145- # TODO: Add host tool build process for Windows hosts.
1146-
11471203 # Build CMake package
11481204 build-cmake-pkg :
11491205 name : CMake Package (${{ matrix.host.name }})
0 commit comments