Hi, yes, you are right!
I rebuilt my llvm and klee, now it's OK. Thank you very much! -------------------------------------------- Qiuping Yi Institute Of Software Chinese Academy of Sciences 2012/9/14 Delcypher <[email protected]> > Hi, > > I'm not sure if the fact that your target triple i386-pc-linux-gnu is a > problem as x86_64 as far as I know is a super set of i386. However it is > surprising that your version of llvm-gcc is doing this which leads me to > believe you might of downloaded the 32-bit version of llvm-gcc by mistake. > > If you run > > $ llvm-gcc -dumpmachine > x86_64-unknown-linux-gnu > > And don't get x86_64-unknown-linux-gnu you know you have the wrong version > (you can also run "llvm-gcc --verbose" to find out what options your > compiler was built with too). The x86_64 version of llvm-gcc is here... > http://llvm.org/releases/2.9/llvm-gcc4.2-2.9-x86_64-linux.tar.bz2 > > If it is the case that you had the 32-bit version of llvm-gcc I would > advise rebuilding uclibc, llvm and KLEE from scratch using your 64-bit > llvm-gcc compiler just to be sure nothing gets messed up. > > Hope that helps, > > Regards, > Dan Liew. > > > On 14 September 2012 03:28, Qiuping Yi <[email protected]> wrote: > >> Dear Dan Liew, >> >> Thanks for your detailed info. >> I followed you instructions, but I still have the error. And I got the >> next information. >> >> $ llvm-ld --version >> Low Level Virtual Machine (http://llvm.org/): >> llvm version 2.9 >> Optimized build with assertions. >> Built Aug 12 2012 (10:31:59). >> Host: x86_64-unknown-linux-gnu >> Host CPU: penryn >> >> Registered Targets: >> (none) >> >> $ lli --version >> Low Level Virtual Machine (http://llvm.org/): >> llvm version 2.9 >> Optimized build with assertions. >> Built Aug 12 2012 (10:31:59). >> Host: x86_64-unknown-linux-gnu >> Host CPU: penryn >> >> Registered Targets: >> x86 - 32-bit X86: Pentium-Pro and above >> x86-64 - 64-bit X86: EM64T and AMD64 >> >> *I checked the readable form of cat.bc, and I found the target triple is >> "i386-pc-linux-gnu" not "**x86_64-unknown-linux-gnu"*. I think it is the >> problem, how can I generate cat whose target triple is "* >> x86_64-unknown-linux-gnu*"? >> >> $ file /sbin/init >> /sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), >> dynamically linked (uses shared libs), for GNU/Linux 2.6.24, >> BuildID[sha1]=0x029d6e45c81ad4eee2627f676b7580c9ed5fde47, stripped >> >> -------------------------------------------- >> Qiuping Yi >> Institute Of Software >> Chinese Academy of Sciences >> >> >> 2012/9/12 Delcypher <[email protected]> >> >>> Hi, >>> Could you make sure you reply to the mailing rather than just me, else >>> no one else but me will see your problem! >>> >>> I'm sorry but I don't know why you're getting this new error message. I >>> never had that problem but you could try the following >>> >>> 0. Verify that you don't have multiple versions of LLVM installed. So >>> verify that your output is similar to this... >>> $ llvm-gcc --version >>> llvm-gcc (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2.9) >>> >>> $ llvm-ldd --version >>> Low Level Virtual Machine (http://llvm.org/): >>> llvm version 2.9 >>> Optimized build with assertions. >>> >>> $ lli --version >>> Low Level Virtual Machine (http://llvm.org/): >>> llvm version 2.9 >>> Optimized build with assertions. >>> Built Jul 20 2012 (11:49:59). >>> Host: x86_64-unknown-linux-gnu >>> Host CPU: penryn >>> >>> Registered Targets: >>> x86 - 32-bit X86: Pentium-Pro and above >>> x86-64 - 64-bit X86: EM64T and AMD64 >>> >>> If "lli" doesn't have any registered targets then you will have >>> problems! You will also have problems if your machines architecture is not >>> listed. >>> >>> 1. delete the "obj-llvm" directory >>> 2. Make sure LLVM_LIB_SEARCH_PATH is set >>> 3. Now make the "obj-llvm" directory. Make sure this folder is NOT in >>> the source tree for core-utils, in the instructions it seems to be. I >>> prefer having something like core-utils/src and core-utils/obj-llvm as the >>> source code and build directories respectively. >>> $ mkdir obj-llvm >>> $ cd obj-llvm/ >>> $ ../src/configure --disable-nls CFLAGS="-g" >>> 4. Run make >>> $ make CC=/path/to/klee-gcc >>> 5. Now try again running cat again. >>> >>> If that fails inspect the produced bit code files (*.bc) >>> >>> $ llvm-dis cat.bc >>> >>> This will produce a "cat.ll" file. Which is the Bitcode file in human >>> readable form, take a look and check your target triple is something like " >>> x86_64-unknown-linux-gnu" >>> >>> Other than that I have nothing more to suggest because I don't know much >>> about LLVM. >>> >>> Thanks, >>> Dan Liew. >>> >>> >>> On 11 September 2012 15:28, Qiuping Yi <[email protected]> wrote: >>> >>>> yes, you are right. But after I executed "*make >>>> CC=/full/path/to/klee/scripts/klee-gcc*" successfully, I cannot >>>> successfully execute "*/cat --version*" following the guide, and I got >>>> the next error information. >>>> >>>> qiu@qiu:~/installed/coreutils-6.11/obj-llvm/src$ ./cat --version >>>> lli: JITEmitter.cpp:1141: void >>>> {anonymous}::JITEmitter::emitJumpTableInfo(llvm::MachineJumpTableInfo*): >>>> Assertion `MJTI->getEntrySize(*TheJIT->getTargetData()) == sizeof(void*) && >>>> "Cross JIT'ing?"' failed. >>>> 0 lli 0x0000000000b6edff >>>> 1 lli 0x0000000000b6f309 >>>> 2 libpthread.so.0 0x00007f3595437cb0 >>>> 3 libc.so.6 0x00007f359468d445 gsignal + 53 >>>> 4 libc.so.6 0x00007f3594690bab abort + 379 >>>> 5 libc.so.6 0x00007f359468610e >>>> 6 libc.so.6 0x00007f35946861b2 >>>> 7 lli 0x000000000078e8a6 >>>> 8 lli 0x000000000054dfc0 >>>> 9 lli 0x0000000000b00acf >>>> llvm::FPPassManager::runOnFunction(llvm::Function&) + 591 >>>> 10 lli 0x0000000000b0150d >>>> llvm::FunctionPassManagerImpl::run(llvm::Function&) + 141 >>>> 11 lli 0x0000000000b016cd >>>> llvm::FunctionPassManager::run(llvm::Function&) + 173 >>>> 12 lli 0x0000000000780d8e >>>> llvm::JIT::jitTheFunction(llvm::Function*, llvm::MutexGuard const&) + 46 >>>> 13 lli 0x000000000078114c >>>> llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard >>>> const&) + 28 >>>> 14 lli 0x0000000000781440 >>>> llvm::JIT::getPointerToFunction(llvm::Function*) + 576 >>>> 15 lli 0x000000000077f677 >>>> llvm::JIT::runFunction(llvm::Function*, std::vector<llvm::GenericValue, >>>> std::allocator<llvm::GenericValue> > const&) + 71 >>>> 16 lli 0x0000000000a0f292 >>>> llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, >>>> std::vector<std::string, std::allocator<std::string> > const&, char const* >>>> const*) + 722 >>>> 17 lli 0x0000000000504665 main + 1829 >>>> 18 libc.so.6 0x00007f359467876d __libc_start_main + 237 >>>> 19 lli 0x000000000050b6c9 >>>> Stack dump: >>>> 0. Program arguments: lli cat.bc --version >>>> 1. Running pass 'X86 Machine Code Emitter' on function '@main' >>>> >>>> >>>> -------------------------------------------- >>>> Qiuping Yi >>>> Institute Of Software >>>> Chinese Academy of Sciences >>>> >>>> >>>> 2012/9/11 Delcypher <[email protected]> >>>> >>>>> LLVM-LD can't find the libraries it needs to link with. In the is case >>>>> librt (the realtime library). >>>>> >>>>> Find the location of librt.a on your system and set the >>>>> LLVM_LIB_SEARCH_PATH variable before you run make. >>>>> >>>>> For example on my system librt is in /usr/lib/ so I would run in my >>>>> shell >>>>> >>>>> $ export LLVM_LIB_SEARCH_PATH=/usr/lib >>>>> >>>>> Read the manpage of llvm-ld for more information. >>>>> >>>>> That should fix your problem. >>>>> >>>>> Regards, >>>>> Dan Liew. >>>>> >>>>> On 11 September 2012 10:02, Qiuping Yi <[email protected]> wrote: >>>>> >>>>>> Dear everyone, >>>>>> >>>>>> I am a new user of klee, today I began to test the "coreutils case >>>>>> study" following the >>>>>> instructions in klee.llvm.org/TestingCoreutils.html. In the second >>>>>> step (build coreutils with llvm), >>>>>> I got the next error information when I executed "*obj-llvm$ make >>>>>> CC=/full/path/to/klee/scripts/klee-gcc*" . >>>>>> What should I do to correct the error? Thank you all very much! >>>>>> >>>>>> /home/yq/installed/klee/scripts/klee-gcc -g -Wl,--as-needed -o >>>>>> chmod chmod.o ../lib/libcoreutils.a ../lib/libcoreutils.a >>>>>> /home/yq/installed/klee/scripts/klee-gcc -I. -I../../src -I../lib >>>>>> -I../../lib -g -MT cp.o -MD -MP -MF .deps/cp.Tpo -c -o cp.o >>>>>> ../../src/cp.c >>>>>> mv -f .deps/cp.Tpo .deps/cp.Po >>>>>> /home/yq/installed/klee/scripts/klee-gcc -I. -I../../src -I../lib >>>>>> -I../../lib -g -MT copy.o -MD -MP -MF .deps/copy.Tpo -c -o copy.o >>>>>> ../../src/copy.c >>>>>> mv -f .deps/copy.Tpo .deps/copy.Po >>>>>> /home/yq/installed/klee/scripts/klee-gcc -I. -I../../src -I../lib >>>>>> -I../../lib -g -MT cp-hash.o -MD -MP -MF .deps/cp-hash.Tpo -c -o >>>>>> cp-hash.o ../../src/cp-hash.c >>>>>> mv -f .deps/cp-hash.Tpo .deps/cp-hash.Po >>>>>> /home/yq/installed/klee/scripts/klee-gcc -g -Wl,--as-needed -o cp >>>>>> cp.o copy.o cp-hash.o ../lib/libcoreutils.a ../lib/libcoreutils.a >>>>>> /home/yq/installed/klee/scripts/klee-gcc -I. -I../../src -I../lib >>>>>> -I../../lib -g -MT dd.o -MD -MP -MF .deps/dd.Tpo -c -o dd.o >>>>>> ../../src/dd.c >>>>>> mv -f .deps/dd.Tpo .deps/dd.Po >>>>>> /home/yq/installed/klee/scripts/klee-gcc -g -Wl,--as-needed -o dd >>>>>> dd.o ../lib/libcoreutils.a ../lib/libcoreutils.a -lrt >>>>>> llvm-ld: error: Cannot find library 'rt' >>>>>> make[3]: *** [dd] Error 1 >>>>>> make[3]: Leaving directory >>>>>> `/home/qiu/installed/coreutils-6.11/obj-llvm/src' >>>>>> make[2]: *** [all] Error 2 >>>>>> make[2]: Leaving directory >>>>>> `/home/qiu/installed/coreutils-6.11/obj-llvm/src' >>>>>> make[1]: *** [all-recursive] Error 1 >>>>>> make[1]: Leaving directory >>>>>> `/home/qiu/installed/coreutils-6.11/obj-llvm' >>>>>> -------------------------------------------- >>>>>> Qiuping Yi >>>>>> Institute Of Software >>>>>> Chinese Academy of Sciences >>>>>> >>>>>> _______________________________________________ >>>>>> klee-dev mailing list >>>>>> [email protected] >>>>>> http://keeda.Stanford.EDU/mailman/listinfo/klee-dev >>>>>> >>>>>> >>>>> >>>> >>> >> >
_______________________________________________ klee-dev mailing list [email protected] http://keeda.Stanford.EDU/mailman/listinfo/klee-dev
