Hi all, I'm trying to compile projects into LLVM Bitcode files instead of executable binaries, without needing to change the Makefile and the configure script. What is the simplest way of doing that ? Thanks Julien
You can use Clang to compile source to bitcode: clang -c hello.c -emit-llvm -o hello.bc Hope that helps, Philip -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Julien Henry Sent: Friday, May 20, 2011 10:42 AM To: LLVM Developers Mailing List Subject: [LLVMdev] Compile a project into LLVM Bitcode Hi all, I'm trying to compile projects into LLVM Bitcode files instead of executable binaries, without needing to change the Makefile and the configure script. What is the simplest way of doing that ? Thanks Julien _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> You can use Clang to compile source to bitcode: > > clang -c hello.c -emit-llvm -o hello.bc >Yes. My problem is to automatically create .bc files with ./configure && make. Ideally, when compiling a project like "grep", I'd like to obtain a single .bc file containing all the project's functions, instead of the grep binary executable. I already tried things like CC=clang CFLAGS=-emit-llvm ./configure But the ./configure fails (indeed, .bc files are not executable, so configure says the C compiler doesn't work) checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for gawk... (cached) gawk checking for gcc... clang checking whether the C compiler works... no configure: error: in `/local/jhenry/examples/grep-2.8': configure: error: C compiler cannot create executables See `config.log' for more details