I am following a website ( http://wiki.osdev.org/GCC_Cross-Compiler ) to learn how to cross compile some code for different architectures. So, the first step is to download and compile Binutils for a specific target.
The site say to assign the varible TARGET with i686-elf because then the binutils will be able to handle code in the format specified by $TARGET.
export PREFIX="$HOME/opt/cross"
export TARGET=i686-elf
export PATH="$PREFIX/bin:$PATH"
So, my question is that
Can i get a list of targets that is supported by Binutils?
If the variable TARGET can contain anything or must be something that is supported by Binutils i.e would there be an error during compiling the source code of binutils, if the TARGET is something that binutils doesnt understand?
Contents of Binutils. Binutils is a collection of software development tools containing a linker, assembler and other tools to work with object files and archives.
So the binutils package is a required dependency for the gcc package (with many other dependencies, probably including libc and libc-devel , but if you really want you could use some other libc like MUSL libc; the libc is generally providing the dynamic linker like /lib/ld-linux.so* ).
Never saw an answer for this question, so I'll give it the ol college attempt for those coming from various search engines. If one downloads or clones binutils from sourceware
git clone git://sourceware.org/git/binutils-gdb.git
And then reads this explanation of binutils
https://sourceware.org/binutils/binutils-porting-guide.txt
You will find the answer.
TL;DR
Read the contents of config.bfd within the bfd directory
All the supported targets are listed within
cd /path/to/git/clone/of/binutils/bfd
Notice the files with elf32-[SOME_NAME].c and elf64-[SOME_NAME].c in the above mentioned directory, those are your supported targets.
Ex
elf32-cr16.c
would translate to,
--target=cr16-elf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With