I’m a Linux newbie working with x86_64 Manjaro and I’m learning compilation related stuff. Am trying to build an arm cross compilation environment but I am confused about some packages.I would like to ask for your help to tell me which packages I should choose to install more easily.
After searching a lot and reading the arch wiki about Cross-compiling tools packages, then I followed the wiki tutorials Cross-compiling tools package guidelines and installed those all packages arm-none-eabi-*.
pacman -S arm-none-eabi-binutils arm-none-eabi-gcc arm-none-eabi-gdb arm-none-eabi-newlib
It worked, but I wasn’t quite sure if I was doing it correctly, and then I successfully compiled the program without errors. I tested and compiled the program successfully. Since there are more tutorials on the subject under ubuntu, it was easy for me to get support and build the environment I wanted to work in. What toolchain or packages do I need to install to cross-compile an arm program under x86_64 arch / manjaro?
that doesn’t make sense to me
Can’t you test it?
Now yes, I tested it and was able to compile my program. I just wanted a way to easily install the arm cross-compile toolchain correctly.
There are a number of tools available to crosscompile.
Dockcross (in Docker containers), Crosstool-NG and Clang is supposed to be able to do it.
Running the program “file <–filename–>” will probably tell you if the crosscompile was successful. So you don’t even have to move the file off your system and test on the target system. I just remember when trying to X-compile for RPI, if it returned ELF 64-bit, it failed.
EDIT: Had some network issues, couldn’t check RPI. But “file” returns “ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV)…” So clearly it is for Arm, and 32-bit at that. A fast way to check if compiling succeeded for target platform. Should be able to run it on the “artifact” files.
For comparison, on my main PC: “ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV)…”. I just did a “file ls” on main PC and RPI.
“strings” could be helpful too. Doesn’t give me much info on RPI but on main it returns GCC 13.2.1. I used the strings command when I was trying to compile kernel with clang/LLVM. Wanted to make sure it wasn’t compiled with GCC. Because that happened a couple times…
The package manjaro-arm-tools is in the repo - for x86_64 you need to sync qemu-user-static-binfmt as well
pamac info manjaro-arm-tools