[Known Issue] MacBook M1: arm-trusted-firmware-rockchip failed to build

I'm trying to build OpenWrt on a MacBook with M1 processor. While I know this is not officially supported, I've decided to try it anyway since I've seen some reports it would be possible.

I've made some good progress, including installing multiple GNU tools via brew and some other build setup requirements.

However while trying to build for the NanoPi R4S target, I've faced the following error when doing a make download:

ERROR: package/boot/arm-trusted-firmware-rockchip failed to build (build variant: rk3399).

When running make download v=SC, I was able to pinpoint the error to the download of the file gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar which is not available in any of the mirrors (see more details at the end of this post):

https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar.xz
https://sources.cdn.openwrt.org/gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar.xz
https://sources.openwrt.org/gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar.xz
https://mirror2.openwrt.org/sources/gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar

None of the above mirrors is working. Is this in fact a build script error or is there something I should configure on my build environment to get the file gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tarfrom somewhere else?

Error details:

SHELL= flock /Volumes/case_sensitive_volume/src/openwrt/r4s-router-main/tmp/.gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar.xz.flock -c '  	/Volumes/case_sensitive_volume/src/openwrt/r4s-router-main/scripts/download.pl "/Volumes/case_sensitive_volume/src/openwrt/r4s-router-main/dl" "gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar.xz" "8c5acd5ae567c0100245b0556941c237369f210bceb196edfe5a2e7532c60326" "" "https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel"    '
+ curl -f --connect-timeout 20 --retry 5 --location https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   103    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
curl: (22) The requested URL returned error: 404
Download failed.
+ curl -f --connect-timeout 20 --retry 5 --location https://sources.cdn.openwrt.org/gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   169    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0
curl: (22) The requested URL returned error: 404
Download failed.
+ curl -f --connect-timeout 20 --retry 5 --location https://sources.openwrt.org/gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   169    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
Download failed.
+ curl -f --connect-timeout 20 --retry 5 --location https://mirror2.openwrt.org/sources/gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar.xz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   153    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
Download failed.
No more mirrors to try - giving up.
make[2]: *** [Makefile:73: /Volumes/case_sensitive_volume/src/openwrt/r4s-router-main/dl/gcc-arm-11.2-2022.02-arm64-arm-none-eabi.tar.xz] Error 2
make[2]: Leaving directory '/Volumes/case_sensitive_volume/src/openwrt/r4s-router-main/package/boot/arm-trusted-firmware-rockchip'
time: package/boot/arm-trusted-firmware-rockchip/rk3399/download#0.21#0.20#5.67
    ERROR: package/boot/arm-trusted-firmware-rockchip failed to build (build variant: rk3399).

It does not seems to be MacOS relevant. Based on this commit https://github.com/openwrt/openwrt/commit/186976c963f0b2484be81854b97c0d8ec6c6e7a7 , because this seems like issue, you should create issue here:

Also, it is possible to create pull request while you can go here, then scroll down and you will see Downloads: 11.2-2022.02.

It seems like only tarball was renamed to this one:
gcc-arm-11.2-2022.02-aarch64-arm-none-eabi.tar.xz instead of arm64-arm-none-eabi.

1 Like

Are you sure? I mean, I just did a build for the NanoPi R4S on a x86/64 (Ubuntu) environment and this error does not happen.

As I reported, I am seeing this error only when trying to build on a Mac M1 (ARM build environment).

So this issue seems to be specific to all ARM build environments and it does not affect x86/64 build setups.

Exactly, thats what I said above. If you are using aarch64 (thats what MacBook M1 has) to compile OpenWrt, you will be able to reproduce what are you saying.
This is due to upstream change, though.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.