Are there binutils for llvm?

The LLVM compiler compiler has gcc, which is compatible with regular gcc. The advantage of using llvm-gcc is that it goes to an arbitrary target, that is, normal gcc will not say any such goal when you try to compile a random architecture, say mips-apple-darwin. However, llvm-gcc will actually build the compiler for Mac OS X on the mips processor.

Here's the trick, however: to create a random target, you already need the binoculars created for this purpose. Therefore, if you have a target that llvm will compile but binutils cannot, you cannot make a compiler because GNU Binutils does not support this target.

So ... Here's the question: is there an equivalent llvm-binutils like llvm-gcc compatible with GNU Binutils? (which means that it is building an arbitrary goal, not one of the list.)

EDIT:

Arbitrary, I mean that I do not select the target when I run llvm-gcc, I choose the target when I compile llvm-gcc. Meaning: if I try to compile GCC for mips-apple-darwin, I get an unsupported target. But if I create llvm-gcc for mips-apple-darwin, it works as long as I have mips-apple-darwin-as and mips-apple-darwin-ld.

+4
source share
2 answers

As far as I can tell, LLVM does not compile for any purpose. You must have everything included and a definition so that it matches your goal and, as a rule, llvm has a background code to generate code for your target goal. Read "Can I compile C or C ++ code for platform-independent LLVM bit code?" from http://llvm.org/docs/FAQ.html .

To answer the question, llvm does not use GNU binutils, llvm has its own binutils for generating code (called the main LLVM project). The disassembler and debugger are part of the LLDB project.

Where LLVM brings some independence, it is at the language level. Your project can be encoded in C / C ++, Ada, Fortran, etc. Llvm has the ability to convert your code to an intermediate representation. This IR code will generate the code.

+2
source

llvm-gcc does not support arbitrary targets. llvm-gcc must be created specifically for any given purpose. clang + LLVM. I am trying to do just that with ellcc: http://ellcc.org . I use binutils for build and build.

+1
source

Source: https://habr.com/ru/post/1342901/


All Articles