Re: [klee-dev] error in Coreutils Case Study

2012-09-14 Thread Qiuping Yi
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 

> 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  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 
>>
>>> 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  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.
>>>

Re: [klee-dev] error in Coreutils Case Study

2012-09-14 Thread Delcypher
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  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 
>
>> 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  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 0x00b6edff
>>> 1  lli 0x00b6f309
>>> 2  l