List of targets supported by binutils
Asked Answered
E

2

8

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?

Eudoca answered 23/3, 2017 at 20:39 Comment(0)
D
6

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
Debauch answered 20/8, 2018 at 22:35 Comment(0)
F
0

I just cloned binutils and found gdb/README has the most useful hint (link):

The configure' script accompanying GDB does not provide any query facility to list all supported host and target names or aliases. configure' calls the Bourne shell script `config.sub' to map abbreviations to full names; you can read the script, if you wish, or you can use it to test your guesses on abbreviations--for example:

Now good luck crafting your triplet.

Fulvous answered 25/11, 2023 at 0:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.