Von: email@example.com, LLVM Developers Mailing List <firstname.lastname@example.org>
Gesendet: 13.06.07 23:13:08
An: LLVM Developers Mailing List <email@example.com>
Betreff: Re: [LLVMdev] LLVM binaries for Windows and more
> It seems that the generated ASM code cannot be assembled with GCC (wrong output format I guess).
Yes, it seems, that intel-style assembler is emitted.
> Maybe this fails because it calls the MingW gcc.exe and not llvm-gcc.exe?
No. LLVM autodetects platform you're running tools on. So, the problem
actually is that you're trying to "mix" binaries built with microsoft
tools with gcc. The first will force LLVM tools to emit intel-style
assembler (in fact, masm-dialect), but second will assume, that you're
providing AT&T style assembler on input.
1. Either build LLVM with gcc on mingw32 platform
2. Select assembler flavour "by hands" (look into llc --help to find,
how to do this)
I tried solution 2 and it works! Thank you!
3. Implement necessary functionality in llvm-ld (calling microsoft
tools, if intel-style assembler is emitted).
> However, is the name "a.out.s" a bug?
Ok, but it remains strange :-).
> Is it planed to include binary writers?
Maybe. Patches are welcome In fact, there are MachO and ELF writers.
Both misses many important things.
> (So that the step to go through an external assembler wouldn't be necessary.)
This isn't totally right: consider you have the source with inline
Hm, either the assembler parser could be integrated (GCC seems to be doing this with cryptic ways to specify which registers get changed or only those files could be assembled by an external assembler. Am I the only one who thinks emitting huge ASM files is a bad idea for compile-time performance?
Targetting LLVM as a backend currently seems to imply the following "pipeline":
Programming language (needs to be parsed) --> LLVM code (textual; needs to be parsed) --> Assembler (textual; needs to be parsed) --> Executable
I don't want to be offensive here; just curious how you see it. (Yes, I know one could output LLVM's bitcode directly. However, I wouldn't dare; probably for the same reasons LLVM does output textual assembly.)