Toolchain » History » Version 1
Alexander Protsenko, 03/21/2023 06:19 PM
1 | 1 | Alexander Protsenko | h1. Toolchain |
---|---|---|---|
2 | |||
3 | h2. ARMv8 programs compilation |
||
4 | |||
5 | To compile ARMv8 assembler programs do the following: |
||
6 | |||
7 | # Download the toolchain either from this page (see below) or from "here":http://releases.linaro.org/components/toolchain/binaries |
||
8 | # Unpack the gcc-linaro-...tar.xz archive into some "<toolchain>" folder |
||
9 | # Add "<toolchain>/bin" to the PATH environment variable. |
||
10 | # Supposing that you are compiling a @sample.s@ ARMv8 assembler program, do the following: |
||
11 | |||
12 | <pre> |
||
13 | aarch64-linux-gnu-as sample.s -march=armv8.2-a -o sample.o |
||
14 | aarch64-linux-gnu-ld --entry 0x0 sample.o -o sample.elf |
||
15 | aarch64-linux-gnu-objcopy -O binary sample.elf sample.bin |
||
16 | </pre> |
||
17 | |||
18 | h2. ARMv8 programs simulation |
||
19 | |||
20 | To simulate ARMv8 assembler programs do the following: |
||
21 | |||
22 | # Install the "QEMU4V":https://forge.ispras.ru/projects/qemu4v/wiki/Installation emulator. |
||
23 | # Supposing that you have compiled your sample program into @sample.bin@ binary do the following: |
||
24 | |||
25 | <pre> |
||
26 | qemu-system-aarch64 -M virt -cpu cortex-a57 -bios sample.bin -nographic |
||
27 | </pre> |
||
28 | |||
29 | For every @*.bin@ binary file it's own log file will be generated. |
||
30 | You may generate output log file in a Tarmac format by executing the QEMU4V emulator with the following parameters: |
||
31 | <pre> |
||
32 | qemu-system-aarch64 -M virt -cpu cortex-a57 -bios sample.bin -d unimp,nochain,in_asm -singlestep -nographic -trace-log -D full-name-of-log-file.log |
||
33 | </pre> |