[LLVMdev] Unable to compile .s files generated with llc.

Van Dijck, Tom tvandijck at ea.com
Sat Feb 13 20:10:49 PST 2010


Hey,

I've been trying this for a couple days now, finding different assemblers and trying different options but I can't figure it out..
I must be missing something very obvious.

I got a simple "hello world" app in llvm, making the .bc file using 'llvm-as test.llvm -o=test.bc' works fine.
then I can use llvm-ld to make an executable which then runs fine (although not native), and I can use llc to build the .bc file into a .s file.
So far I'm all good...

But neither masm, yasm, tasm, fasm, gcc, as, or nasm take the .s file.

I only found one other post about this where it was mentioned that only 'GAS" can compile it, so I tried this in both Cygwin and Ubuntu, but to no avail.
In cygwin I get:

$ gcc /cygdrive/d/test.s
/cygdrive/d/test.s: Assembler messages:
/cygdrive/d/test.s:4: Error: no such instruction: `align 16'
/cygdrive/d/test.s:6: Error: invalid character '@' in mnemonic
/cygdrive/d/test.s:7: Error: junk at end of line, first unrecognized character is `%'
/cygdrive/d/test.s:15: Error: invalid character '@' in mnemonic
/cygdrive/d/test.s:16: Error: no such instruction: `db "Hello, World!\000"'

using 'as' I get the same error (I guess gcc just forwards to 'as').

I've tried specifying -x86-asm-syntax=intel, and the att option, neither work with any of the above mentioned assemblers...
I'm sort of completely lost now...

Using the following:
- LLVM 2.6
- GCC 4.4.3
- Cygwin 1.7

Tom.



More information about the llvm-dev mailing list