Skip to content
Snippets Groups Projects
Name Last commit Last update
README.md

2024-04-10 - Milo

Install cross compiler

To run the programs we need on ARM we need to setup a cross compiler for AArch64. This is actually not too bad.

First download the binaries from ARM: wget https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz

Then extract them: tar xv gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz

Then we move them to an easier path mv gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu aarch

Now we can use the cross compiler toolchain to compiler our programs.

Build programs

We need to use the cross compiler, and regular compiler to build out programs. For both architectures, we need to make sure our binaries are static by using the -static command line option. This is for gem5 to work.

For AArch64 we need to decide what optimization level we want from gcc. Regardless of optimization level we can turn on auto-vectorization with -ftree-vectorize

For X86 we need to include an additional flag -msse (or -msse2 not sure).

We can get more info from the compiler by passing in the -ftree-vectorize-verbose=LEVEL flag.

For more info go to here