From ccb48ea963fe9861b4e6de0eaec74c7fdd0cc94b Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Thu, 25 Aug 2022 12:14:51 +0100 Subject: Add AArch64 --- md/notes/undefined_c/titles.md | 61 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) (limited to 'md/notes') diff --git a/md/notes/undefined_c/titles.md b/md/notes/undefined_c/titles.md index 18fcdec..85a8456 100644 --- a/md/notes/undefined_c/titles.md +++ b/md/notes/undefined_c/titles.md @@ -1632,10 +1632,69 @@ rustc main.rs -l lib -L . -o hello -C link-arg="-Wl,-rpath=./" ## Multiplatform ### Cross compile + + + + + ### Different flags + + ### Check architecture -### ARMv8 + + +### AArch64 + +https://snapshots.linaro.org/gnu-toolchain/13.0-2022.08-1/aarch64-linux-gnu/ + +download any of the version of gcc and extract + +Add bin directory location to env variable PATH + +``` +export PATH=$PATH:`pwd` +``` + +___main.c__ +```c +#include + +int main() { + printf("Hello world arm64\n"); +} +``` + +``` +$ arch64-linux-gnu-gcc main.c -o main +$ ./main +qemu-aarch64: Could not open '/lib/ld-linux-aarch64.so.1': No such file or directory +$ file ./main +./main: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=12448d90030e2ad23dbe6b7bc82a4fa7b7de9659, for GNU/Linux 3.7.0, with debug_info, not stripped +``` + +Download sysroot image from linaro page. +With running + +``` +strace ./main +``` + +It showed that searched path for libraries are in + +``` +/usr/gnemul/qemu-aarch64/lib/ +``` + +Found missing libc and ld-linux-aarch64 inside sysroot archive and copied at searched location amd now AArch64 binary is running. + +``` +$ ./main +Hello world arm64 +``` + ### AVR8 + + ### Emscripten [/writeup/web_assembly_sdl_example.md](/writeup/web_assembly_sdl_example.md) -- cgit v1.2.3