[LLVMdev] LLVM compile with -emit-llvm
Dale Johannesen
dalej at apple.com
Thu Feb 26 10:39:22 PST 2009
On Feb 26, 2009, at 10:16 AMPST, Brice Lin wrote:
> Is it possible to add any flags to this command so that the resulting
> compile runs perfectly fine (-c builds, but does not work)?
>
> llvm-gcc -o conftest -g -O2 -Wall -Wpointer-arith -Wuninitialized
> -Wsign-compare -Wno-pointer-sign -Wformat-security -fno-builtin-memset
> -emit-llvm <filename.c>
>
> where <filename.c> contains
>
> #include <stdio.h>
>
> int main() {
> exit(0);
> }
The line you have works fine for me. There have been a lot of changes
related to debug info recently so make sure you are up to date.
Beyond that we'd need information about your environment to help.
Note that -emit-llvm asks for LLVM intermediate representation as
output; but it has no effect without -c or -S. Combined with -c it
produces binary format LLVM IR; you should not expect this to be
executable.
More information about the llvm-dev
mailing list