aarch64 cross compile
-
I am building a cross-compilation environment using compilation for aarch64.
I installed ubuntu OS on the Raspberry Pi 4 board.Generally, I install cross-compilation on Raspbian OS, but my case doesn't have much data.
I don't think it's that much different from Raspbian cross-compiling.
I'll list the process I went through
*Target
sudo vi /etc/apt/sources.list
sudo apt update
sudo apt full-upgrade
sudo reboot
sudo rpi-update
sudo rebootsudo apt-get build-dep qt5-qmake -y
sudo apt-get build-dep libqt5webengine-data -ysudo apt-get install libboost1.58-all-dev libudev-dev libinput-dev libts-dev libmtdev-dev libjpeg-dev libfontconfig1-dev -y
sudo apt-get install libssl-dev libdbus-1-dev libglib2.0-dev libxkbcommon-dev libegl1-mesa-dev libgbm-dev libgles2-mesa-dev mesa-common-dev -y
sudo apt-get install libasound2-dev libpulse-dev gstreamer1.0-omx libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-alsa -y
sudo apt-get install libvpx-dev libsrtp0-dev libsnappy-dev libnss3-dev -y
sudo apt-get install "^libxcb.*" -y
sudo apt-get install flex bison libxslt-dev ruby gperf libbz2-dev libcups2-dev libatkmm-1.6-dev libxi6 libxcomposite1 -y
sudo apt-get install libfreetype6-dev libicu-dev libsqlite3-dev libxslt1-dev libavcodec-dev libavformat-dev libswscale-dev -y
sudo apt-get install libgstreamer0.10-dev gstreamer-tools libraspberrypi-dev libx11-dev libglib2.0-dev -y
sudo apt-get install freetds-dev libsqlite0-dev libpq-dev libiodbc2-dev firebird-dev libjpeg9-dev libgst-dev libxext-dev libxcb1 libxcb1-dev libx11-xcb1 -y
sudo apt-get install libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev -y
sudo apt-get install libxcb-sync1 libxcb-sync-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev -y
sudo apt-get install libxcb-glx0-dev libxi-dev libdrm-dev libssl-dev libxcb-xinerama0 libxcb-xinerama0-dev -y
sudo apt-get install libatspi-dev libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libfontconfig1-dev -y
sudo apt-get install libxss-dev libxtst-dev libpci-dev libcap-dev libsrtp0-dev libxrandr-dev libnss3-dev libdirectfb-dev libaudio-dev -ysudo mkdir /usr/local/qt5pi
sudo chown ubuntu:ubuntu /usr/local/qt5pi
*Host
mkdir /opt/qt5pi
chown devqt:devqt /opt/qt5pi_ubuntu
cd /opt/qt5pi_ubuntu/wget https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.xz
tar xf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.xz
export PATH=$PATH:/opt/qt5pi/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin
nano ~/.bashrcrsync -avz --rsync-path="sudo rsync" ubuntu@194.1.1.111:/usr/lib sysroot
rsync -avz --rsync-path="sudo rsync" ubuntu@194.1.1.111:/usr/include sysroot/usr
rsync -avz --rsync-path="sudo rsync" ubuntu@194.1.1.111:/usr/lib sysroot/usr
rsync -avz --rsync-path="sudo rsync" ubuntu@194.1.1.111:/opt/vc sysroot/opt- This is an error that occurred during opt/vc in the rsync process.
root@devqt-desktop:/opt/qt5pi_ubuntu# rsync -avz --rsync-path="sudo rsync" ubuntu@194.1.1.111:/opt/vc sysroot/opt
ubuntu@194.1.1.111's password:
receiving incremental file list
rsync: link_stat "/opt/vc" failed: No such file or directory (2)sent 8 bytes received 76 bytes 18.67 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1677) [Receiver=3.1.3]wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
chmod +x sysroot-relativelinks.py
./sysroot-relativelinks.py sysroot../qt-everywhere-src-5.15.2/configure -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/qt5pi_ubuntu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- -sysroot /opt/qt5pi_ubuntu/sysroot -prefix /usr/local/qt5pi_ubuntu -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtdatavis3d -nomake examples -make libs -pkg-config -no-use-gold-linker -v
An error occurs.
root@devqt-desktop:/opt/qt5pi_ubuntu/qt5build# ../qt-everywhere-src-5.15.2/configure -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/qt5pi_ubuntu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- -sysroot /opt/qt5pi_ubuntu/sysroot -prefix /usr/local/qt5pi_ubuntu -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtdatavis3d -nomake examples -make libs -pkg-config -no-use-gold-linker -v
- cd qtbase
- /opt/qt5pi_ubuntu/qt-everywhere-src-5.15.2/qtbase/configure -top-level -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/qt5pi_ubuntu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- -sysroot /opt/qt5pi_ubuntu/sysroot -prefix /usr/local/qt5pi_ubuntu -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtdatavis3d -nomake examples -make libs -pkg-config -no-use-gold-linker -v
Performing shadow build...
Preparing build tree...
Creating qmake...
make: 'first'을(를) 위해 할 일이 없습니다.
Command line: -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/qt5pi_ubuntu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- -sysroot /opt/qt5pi_ubuntu/sysroot -prefix /usr/local/qt5pi_ubuntu -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtdatavis3d -nomake examples -make libs -pkg-config -no-use-gold-linker -v
Project ERROR: Cannot run target compiler '/opt/qt5pi_ubuntu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++'. Output:
===================
Using built-in specs.
COLLECT_GCC=/opt/qt5pi_ubuntu/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++
aarch64-linux-gnu-g++: error: unrecognized command line option '-mfpu=crypto-neon-fp-armv8'
aarch64-linux-gnu-g++: error: unrecognized command line option '-mfloat-abi=hard'
Target: aarch64-linux-gnu
Configured with: '/home/tcwg-buildslave/workspace/tcwg-make-release_0/snapshots/gcc.git~linaro-7.5-2019.12/configure' SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto --enable-shared --without-included-gettext --enable-nls --with-system-zlib --disable-sjlj-exceptions --enable-gnu-unique-object --enable-linker-build-id --disable-libstdcxx-pch --enable-c99 --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 --with-arch=armv8-a --enable-threads=posix --enable-multiarch --enable-libstdcxx-time=yes --enable-gnu-indirect-function --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/sysroots/aarch64-linux-gnu --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu/aarch64-linux-gnu/libc --enable-checking=release --disable-bootstrap --enable-languages=c,c++,fortran,lto --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=aarch64-linux-gnu --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release_0/_build/builds/destdir/x86_64-unknown-linux-gnu
Thread model: posix
gcc version 7.5.0 (Linaro GCC 7.5-2019.12)
===================
Maybe you forgot to setup the environment?
It does not seem to be much different from the case of Raspbian cross-compilation, so I proceeded like this, but an error appears. Please let me know what I can do Thank you in advance.