Hi Haiho, Good so now llvm-gcc is in your path.
The reason you're still having problems is because when you built llvm-2.9 the program llvm-gcc was NOT in your path. The reason that is a problem is because the build system for the klee version of uclibc is HORRIBLE and does not look for llvm-gcc in your path. Instead it uses the location of the llvm-gcc executable that was found during the configure step of building llvm-2.9. If llvm-gcc was not in your PATH at configure time for llvm-2.9 then the LLVMGCC variables will not be set... Check the file "Makefile.config" in your llvm-2.9 build directory. Look at around line 190 in this file... I have # Full pathnames of LLVM C/C++ front-end 'cc1' and 'cc1plus' binaries: LLVMGCC := /opt/llvm-gcc/bin/llvm-gcc LLVMGXX := /opt/llvm-gcc/bin/llvm-g++ LLVMCC1 := /opt/llvm-gcc/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.2.1/cc1 LLVMCC1PLUS := /opt/llvm-gcc/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.2.1/cc1plus LLVMGCC_LANGS := c,c++,fortran LLVMGCC_DRAGONEGG := no # Information on Clang, if configured. CLANGPATH := CLANGXXPATH := ENABLE_BUILT_CLANG := 0 # The LLVM capable compiler to use. LLVMCC_OPTION := llvm-gcc You're seeing problems because those variables are not set to anything in your Makefile.config file. These variables are used in the build process of the klee version of uclibc. The easiest way to fix this is to do the following 1. Open /path/to/llvm-2.9/build/config.log . Just after "Invocation command line was" you'll see the command you used. Copy it and paste it in to a terminal in your llvm-2.9 build directory. This will perform a full reconfigure. During this configure you should see some lines similar too... checking for llvm-gcc... /opt/llvm-gcc/bin/llvm-gcc checking for llvm-g++... /opt/llvm-gcc/bin/llvm-g++ checking LLVM capable compiler... llvm-gcc checking tool compatibility... ok This indicates that the configure step of the llvm-2.9 build process has found your version of llvm-gcc and llvm-g++. 2. Run $make clean 3. Now we'll recompile llvm-2.9 by running (replace 4 with the number of CPU cores you have in your machine). $ make -j4 4. Now try to compile the KLEE version of uclibc. Hope this helps, Dan. On 17 August 2012 22:19, haihao shen <[email protected]> wrote: > Hi Dan, > > Sorry to bother you again. I tried again, and set the env. However, the > issue still exists when building uclibc (llvm-gcc -v is okay): > > Shell options: > -irsD or -c command or -O shopt_option (invocation only) > -abefhkmnptuvxBCHP or -o option > make: --emit-llvm: Command not found > make: --emit-llvm: Command not found > make: *** No rule to make target > `/home/haihao/proj/llvm-gcc/bin///Makefile.config'. Stop. > > Thanks, > Haihao > > > On Sat, Aug 18, 2012 at 12:52 AM, Delcypher <[email protected]> wrote: > >> The binary name should be llvm-gcc. It's path relative to the root of the >> lvm-gcc4.2-2.9-x86_64-linux.tar.bz2<http://llvm.org/releases/2.9/llvm-gcc4.2-2.9-x86_64-linux.tar.bz2> >> file >> is llvm-gcc4.2-2.9-x86_64-linux/bin/llvm-gcc >> >> I just re-downloaded the tar.bz2 file and checked that llvm-gcc is in >> there. It is so I don't know where you got "llvmc" from. >> >> You are also using PATH incorrectly. PATH is a list of >> colon separated directories not a list of executable names so it should be >> PATH=$PATH:${LLVM_GCC}/bin/ >> >> for example on my system llvm-gcc is located at /opt/llvm-gcc/bin/llvm-gcc >> so I add to my path like so >> PATH=$PATH:/opt/llvm-gcc/bin >> >> Once llvm-gcc is in your path you should be able to run >> $ llvm-gcc -v >> Using built-in specs. >> Target: x86_64-unknown-linux-gnu >> Configured with: >> /home/duncan/llvm-2.9/64/llvmgcc42-2.9-release.src/configure >> --prefix=/home/duncan/llvm-2.9/64/Phase2/Release/llvmgcc42-2.9-release.install >> --program-prefix=llvm- >> --enable-llvm=/home/duncan/llvm-2.9/64/Phase2/Release/llvmCore-2.9-release.obj >> --enable-languages=c,c++,fortran >> Thread model: posix >> gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2.9) >> >> >> Regards, >> Dan. >> >> On 17 August 2012 17:41, haihao shen <[email protected]> wrote: >> >>> Thanks Dan. Actually, I added the llvm-gcc to the path: export >>> PATH=$PATH:${LLVM_GCC}/bin/llvmc >>> >>> I downloaded LLVM-GCC from >>> http://llvm.org/releases/2.9/llvm-gcc4.2-2.9-x86_64-linux.tar.bz2 and >>> extracted. The strange thing is the binary nameis llvmc, not llvm-gcc. Is >>> it right? >>> >>> --Haihao >>> On Fri, Aug 17, 2012 at 6:59 PM, Delcypher <[email protected]> wrote: >>> >>>> Hi, >>>> >>>> You have not followed the build instructions correctly. "*Forgetting >>>> to add llvm-gcc to your PATH at this point is by far the most common source >>>> of build errors reported by new users."* >>>> >>>> Your problem comes from the fact that when you built LLVM-2.9 the >>>> program "llvm-gcc" was not in your PATH variable. >>>> >>>> If you look at the file "Rules.mak" in your uclibc-klee build directory >>>> you will see the line... >>>> >>>> CC = $(LLVMGCC) --emit-llvm $(KLEE_CFLAGS) >>>> >>>> In your case $(LLVMGCC) is empty because it is set to nothing in >>>> "Makefile.config" file in the your LLVM build directory. >>>> >>>> Make sure llvm-gcc is in your PATH and then rebuild LLVM-2.9 and then >>>> uclibc-klee should compile correctly. >>>> >>>> Regards, >>>> Dan. >>>> >>>> >>>> >>>> >>>> On 16 August 2012 19:03, haihao shen <[email protected]> wrote: >>>> >>>>> Hi, >>>>> >>>>> When I build uClibc and got the following errors: >>>>> >>>>> extra/scripts/gen_bits_syscall_h.sh: line 30: --emit-llvm: command not >>>>> found >>>>> extra/scripts/gen_bits_syscall_h.sh: line 26: --emit-llvm: command not >>>>> found >>>>> CC libcrypt/crypt.os >>>>> /bin/sh: --emit-llvm: command not found >>>>> make: *** [libcrypt/crypt.os] Error 127 >>>>> >>>>> Actually, I can successfully compile LLVM-2.9. Does anyone know how to >>>>> solve it? >>>>> >>>>> Thanks, >>>>> Haihao >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> klee-dev mailing list >>>>> [email protected] >>>>> http://keeda.Stanford.EDU/mailman/listinfo/klee-dev<http://keeda.stanford.edu/mailman/listinfo/klee-dev> >>>>> >>>>> >>>> >>> >> >
_______________________________________________ klee-dev mailing list [email protected] http://keeda.Stanford.EDU/mailman/listinfo/klee-dev
