@@ -14,6 +14,9 @@ case "${TARGET_ARCH}" in
1414 armhf)
1515 ABI_NAME=" arm-linux-gnueabihf"
1616 ;;
17+ arm64)
18+ ABI_NAME=" aarch64-linux-gnu"
19+ ;;
1720 * )
1821 echo " Unsupported TARGET_ARCH ${TARGET_ARCH} "
1922 exit 1
@@ -37,7 +40,9 @@ setup_cross_compilation_apt_sources() {
3740 return
3841 fi
3942 sudo dpkg --add-architecture " ${TARGET_ARCH} "
43+ # Duplicate the original Ubuntu sources and modify them to refer to the TARGET_ARCH:
4044 sed -rne " s|^deb.*/ ([^ -]+(-updates)?) main.*|deb [arch=${TARGET_ARCH} ] http://ports.ubuntu.com/ubuntu-ports \1 main universe multiverse restricted|p" /etc/apt/sources.list | sudo dd of=/etc/apt/sources.list.d/" ${TARGET_ARCH} " .list
45+ # Now take the original Ubuntu sources and limit those to the build host (i.e. non-TARGET_ARCH) architectures:
4146 sudo sed -re ' s/^deb /deb [arch=amd64,i386] /' -i /etc/apt/sources.list
4247}
4348
@@ -50,10 +55,10 @@ setup_cross_compiler() {
5055 sudo update-alternatives --install " /usr/bin/${ABI_NAME} -g++" g++ " /usr/bin/${ABI_NAME} -g++-${GCC_VERSION} " 10
5156 sudo update-alternatives --install " /usr/bin/${ABI_NAME} -gcc" gcc " /usr/bin/${ABI_NAME} -gcc-${GCC_VERSION} " 10
5257
53- if [[ " ${TARGET_ARCH} " == armhf ]] ; then
54- # Ubuntu's Qt version only ships a profile for gnueabi, but not for gnueabihf. Therefore, build a custom one:
58+ # Ubuntu's Qt version only ships a profile for gnueabi, but not for gnueabihf or aarch64. Therefore, build a custom one:
59+ if [[ $ABI_NAME ]] ; then
5560 sudo cp -R " /usr/lib/${ABI_NAME} /qt5/mkspecs/linux-arm-gnueabi-g++/" " /usr/lib/${ABI_NAME} /qt5/mkspecs/${ABI_NAME} -g++/"
56- sudo sed -re ' s/- gnueabi/-gnueabihf/ ' -i " /usr/lib/${ABI_NAME} /qt5/mkspecs/${ABI_NAME} -g++/qmake.conf"
61+ sudo sed -re " s/arm-linux- gnueabi/${ABI_NAME} / " -i " /usr/lib/${ABI_NAME} /qt5/mkspecs/${ABI_NAME} -g++/qmake.conf"
5762 fi
5863}
5964
0 commit comments