[LLVMdev] how to compile asm output for x86 with Micorsoft's ML

Jim Crafton jim.crafton at gmail.com
Thu Jan 21 12:26:39 PST 2010


I was recently trying to compile some bitcode generated like so:

llc --x86-asm-syntax=intel test.out

it generates a test.out.s file, and while I'm not much of an assembly
person, it looks OK. When I feed this to ML

ml test.out.s

I get tons of errors, most of which appear to be syntax errors. Stuff like:

test.out.s(2) : error A2008:syntax error : .
error A2008:syntax error : objc_class_name_Fraction

etc. Is it possible to generate X86 code that Microsoft's assembler
will accept? Is there another option that I missed? I looked around a
bit but couldn't find anything. The example on the llvm site mentions
being able to compile to C code, but when I try
llc -march=c test.out

it errors out with:
error: invalid target 'c'.

Checking the code (I built LLVM 2.7svn) it looks like the C target
isn't registered, and llc -version gives me:
llc -version
Low Level Virtual Machine (http://llvm.org/):
  llvm version 2.7svn
  DEBUG build with assertions.
  Built Jan 20 2010 (14:58:43).
  Host: i686-pc-win32
  Host CPU: core2

  Registered Targets:
    x86    - 32-bit X86: Pentium-Pro and above
    x86-64 - 64-bit X86: EM64T and AMD64

Cheers

Jim



More information about the llvm-dev mailing list