Emil Mikulic
2006-Aug-24 02:00 UTC
[LLVMdev] updating the "Getting Started" page with more info about the gcc4 frontend
On Wed, Aug 23, 2006 at 06:38:36PM -0700, Scott Michel wrote:> There should also be a large notice in 40 point font and bold that says, > "gcc4 does not produce byte code by default: you must use the -emit-llvm > flag to get LLVM byte code."=) Where -is- that documented? The only reason I know about it is because of how many times it's come up on the list. =) (Which doesn't help people who don't read the list) --Emil
Devang Patel
2006-Aug-24 02:12 UTC
[LLVMdev] updating the "Getting Started" page with more info about the gcc4 frontend
On Aug 23, 2006, at 7:00 PM, Emil Mikulic wrote:> Where -is- that documented? > > The only reason I know about it is because of how many times it's come > up on the list. =)http://llvm.org/docs/GettingStarted.html ? ... Example with llvm-gcc4 First, create a simple C file, name it 'hello.c': #include <stdio.h> int main() { printf("hello world\n"); return 0; } Next, compile the C file into a native executable: % llvm-gcc hello.c -o hello Note that llvm-gcc works just like GCC by default. The standard -S and -c arguments work as usual (producing a native .s or .o file, respectively). Next, compile the C file into a LLVM bytecode file: % llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc The -emit-llvm option can be used with the -S or -c options to emit an LLVM ".ll" or ".bc" file (respectively) for the code. This allows you to use the standard LLVM tools on the bytecode file. Unlike llvm-gcc3, llvm-gcc4 correctly responds to -O[0123] arguments. ...
Scott Michel
2006-Aug-25 00:22 UTC
[LLVMdev] updating the "Getting Started" page with more info about the gcc4 frontend
Devang Patel wrote:> > On Aug 23, 2006, at 7:00 PM, Emil Mikulic wrote: > >> Where -is- that documented? >> >> The only reason I know about it is because of how many times it's come >> up on the list. =) > > http://llvm.org/docs/GettingStarted.html ? > > ... > Example with llvm-gcc4 > First, create a simple C file, name it 'hello.c': > #include <stdio.h> > int main() { > printf("hello world\n"); > return 0; > } > > Next, compile the C file into a native executable:That part about "native" -- yeah, it's there. The existence predicate returns true. IT'S SOMETHING THAT IS EASILY SKIPPED OVER WHEN SKIMMING THE DOCUMENT BECAUSE, HECK, THE GCC3 DRIVER COMPILES DIRECTLY TO BYTECODE SO WHY DOESNT GCC4? It's a "least surprise" issue. If gcc3 produces bytecode directly, why did the gcc4 driver create such a large departure from original, expected functionality? It's a rhetorical question, BTW.
Possibly Parallel Threads
- [LLVMdev] updating the "Getting Started" page with more info about the gcc4 frontend
- [LLVMdev] updating the "Getting Started" page with more info about the gcc4 frontend
- [LLVMdev] updating the "Getting Started" page with more info about the gcc4 frontend
- [LLVMdev] updating the "Getting Started" page with more info about the gcc4 frontend
- [LLVMdev] updating the "Getting Started" page with more info about the gcc4 frontend