[LLVMdev] Compiling error in 64bit machines
Anthony Danalis
adanalis at eecs.utk.edu
Mon Mar 16 06:46:15 PDT 2009
The code generated is 32 bit, so your assembler does not like it. You
have two options.
a) tell llvm-gcc to call the assembler and linker for 32 bit binaries.
b) tell llvm-gcc to emit llvm code (llvm-gcc --emit-llvm -c -o foo.bc
foo.c) and then compile the bitcode to 64bit binary with llc (llc -
march=x86-64 -o foo foo.bc)
Anthony
On Mar 16, 2009, at 3:28 AM, bq chan wrote:
> Dear all, sorry to bother you.
> I am new to llvm, and have a trivial question. When I compile the
> original source code to llvm-IR, there is an error as follows:
>
> $ llvm-gcc hello.c -o hello
> /tmp/cc1vOzRT.s: Assembler messages:
> /tmp/cc1vOzRT.s:9: Error: suffix or operands invalid for `push'
> /tmp/cc1vOzRT.s:21: Error: suffix or operands invalid for `pop'
>
> --------------------------------------------
> #include <stdio.h>
>
> int main() {
> printf("hello world\n");
> return 0;
> }
> ------------------------------------------
> $ uname -a
> Linux localhost.localdomain 2.6.25.11-97.fc9.x86_64 #1 SMP Mon Jul 21
> 01:09:10 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux
>
>
> THANK YOU!
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list