@@ -228,63 +228,6 @@ function setup_vulkan_sdk() {
228
228
fi
229
229
}
230
230
231
- function select_toolchain() {
232
- if [[ " ${ARCH} " == " x86_64" ]]; then
233
- if [[ " ${OS} " == " Linux" ]]; then
234
- if [[ " ${target_toolchain} " == " zephyr" ]]; then
235
- # TODO can include support for zephyr toolchain for other host platforms later
236
- toolchain_url=" https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.2/toolchain_linux-x86_64_arm-zephyr-eabi.tar.xz"
237
- toolchain_dir=" arm-zephyr-eabi"
238
- toolchain_md5_checksum=" 93128be0235cf5cf5f1ee561aa6eac5f"
239
- else
240
- toolchain_url=" https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz"
241
- toolchain_dir=" arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi"
242
- toolchain_md5_checksum=" 0601a9588bc5b9c99ad2b56133b7f118"
243
- fi
244
- else
245
- echo " [main] Error: only Linux is currently supported for x86-64 architecture now!" ; exit 1;
246
- fi
247
- elif [[ " ${ARCH} " == " aarch64" ]] || [[ " ${ARCH} " == " arm64" ]]; then
248
- if [[ " ${OS} " == " Darwin" ]]; then
249
- if [[ " ${target_toolchain} " == " zephyr" ]]; then
250
- echo " [main] Error: only Linux OS is currently supported for aarch64 architecture targeting Zephyr now!" ; exit 1;
251
- else
252
- toolchain_url=" https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-darwin-arm64-arm-none-eabi.tar.xz"
253
- toolchain_dir=" arm-gnu-toolchain-13.3.rel1-darwin-arm64-arm-none-eabi"
254
- toolchain_md5_checksum=" f1c18320bb3121fa89dca11399273f4e"
255
- fi
256
- elif [[ " ${OS} " == " Linux" ]]; then
257
- if [[ " ${target_toolchain} " == " zephyr" ]]; then
258
- toolchain_url=" https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.2/toolchain_linux-aarch64_arm-zephyr-eabi.tar.xz"
259
- toolchain_dir=" arm-zephyr-eabi"
260
- toolchain_md5_checksum=" ef4ca56786204439a75270ba800cc64b"
261
- else
262
- toolchain_url=" https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-aarch64-arm-none-eabi.tar.xz"
263
- toolchain_dir=" arm-gnu-toolchain-13.3.rel1-aarch64-arm-none-eabi"
264
- toolchain_md5_checksum=" 303102d97b877ebbeb36b3158994b218"
265
- fi
266
- fi
267
- else
268
- echo " [main] Error: only x86-64 & aarch64/arm64 architecture is supported for now!" ; exit 1;
269
- fi
270
- echo " [main] Info selected ${toolchain_dir} for ${ARCH} - ${OS} platform"
271
- }
272
-
273
- function setup_toolchain() {
274
- # Download and install the arm toolchain (default is arm-none-eabi)
275
- # setting --target-toolchain to zephyr sets this to arm-zephyr-eabi
276
- cd " ${root_dir} "
277
- if [[ ! -e " ${toolchain_dir} .tar.xz" ]]; then
278
- echo " [${FUNCNAME[0]} ] Downloading ${toolchain_dir} toolchain ..."
279
- curl --output " ${toolchain_dir} .tar.xz" -L " ${toolchain_url} "
280
- verify_md5 ${toolchain_md5_checksum} " ${toolchain_dir} .tar.xz" || exit 1
281
- fi
282
-
283
- echo " [${FUNCNAME[0]} ] Installing ${toolchain_dir} toolchain ..."
284
- rm -rf " ${toolchain_dir} "
285
- tar xf " ${toolchain_dir} .tar.xz"
286
- }
287
-
288
231
function setup_ethos_u_tools() {
289
232
CMAKE_POLICY_VERSION_MINIMUM=3.5 BUILD_PYBIND=1 pip install --no-dependencies -r $et_dir /backends/arm/requirements-arm-ethos-u.txt
290
233
}
@@ -361,6 +304,7 @@ if [[ $is_script_sourced -eq 0 ]]; then
361
304
# Import utils
362
305
source $et_dir /backends/arm/scripts/utils.sh
363
306
source $et_dir /backends/arm/scripts/fvp_utils.sh
307
+ source $et_dir /backends/arm/scripts/toolchain_utils.sh
364
308
365
309
echo " [main]: Checking platform and os"
366
310
check_platform_support
@@ -382,11 +326,11 @@ if [[ $is_script_sourced -eq 0 ]]; then
382
326
echo " enable-vela=${enable_vela} "
383
327
echo " mlsdk-manifest-url=${mlsdk_manifest_url} "
384
328
385
- # Select appropriate toolchain
386
- select_toolchain
387
329
388
330
# Setup toolchain
389
331
if [[ " ${enable_baremetal_toolchain} " -eq 1 ]]; then
332
+ # Select appropriate toolchain
333
+ select_toolchain
390
334
setup_toolchain
391
335
fi
392
336
0 commit comments