summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2022-08-25 12:14:51 +0100
committerFreeArtMan <dos21h@gmail.com>2022-08-25 12:14:51 +0100
commitccb48ea963fe9861b4e6de0eaec74c7fdd0cc94b (patch)
treee4601ef072c9eba48fa1310a3746420b123e08c7
parent07304d7e1135009cb7073a9bcc295168ba9675b3 (diff)
downloadmd-content-ccb48ea963fe9861b4e6de0eaec74c7fdd0cc94b.tar.gz
md-content-ccb48ea963fe9861b4e6de0eaec74c7fdd0cc94b.zip
Add AArch64
-rw-r--r--md/notes/undefined_c/titles.md61
1 files changed, 60 insertions, 1 deletions
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 <stdio.h>
+
+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)