AcoSailV2CrossArm64/README.md

56 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

# AcoSail V2 ARM64 CROSS build Dockerfile
Useing AcoSail V2 minibase rootfs with Debian-slim docker-base.
This Docker can be use for crossbuild AcoSail V2 C/C++ cli programs;
And testing the program inside the Docker without a real ARM64 hardware.
# How to build Docker
~~~bash
2023-08-24 21:26:16 +08:00
sudo docker build -t acosail_v2_cross:1.2 .
~~~
# How to RUN this docker for crossbuild
Of cause you need have some crossbuild experience before you using this tool.
You can learn crossbuild on google/github and maybe CSDN.
~~~bash
export PROJECT_DIR
2023-08-24 21:26:16 +08:00
sudo docker run -it --rm --privileged -v ${PROJECT_DIR}:/app acosail_v2_cross:1.2
# Do what ever you want to build an arm64 C/C++ cli program;
# Don't forget to make sure your have set FLAGS -isysroot=/rootfs;
~~~
## FAQ for crossbuild
You may find some projects complain about lacking packages ,like libzma-dev;
To fix it, you can do like following:
~~~bash
chroot /rootfs bash
apt update
#apt install lacking packages;
~~~
# How to RUN this docker for QEMU arm64 native & VERY SLOW build
~~~bash
export PROJECT_DIR
2023-08-24 21:26:16 +08:00
sudo docker run -it --rm --privileged -v ${PROJECT_DIR}:/rootfs/app acosail_v2_cross:1.2
#Inside docker
chroot /rootfs/app
# Do what you want to build a native arm64 program;
# It can & should be very slow;
~~~
# How to test builded app
We suppose you have build your progarms already.
~~~bash
export PROJECT_DIR
2023-08-24 21:26:16 +08:00
sudo docker run -it --rm --privileged -v ${PROJECT_DIR}:/rootfs/app acosail_v2_cross:1.2
#Insdile docker
chroot /rootfs/app
# Do anything you like to run a native program
~~~
## FAQ for run app
Your app is run as root user
You do not have any hardware, so you can't test kernel moudles
And it can be very slow.