zhangyz / llvm-slicing

Symbolic Program Slicing with LLVM
Apache License 2.0
74 stars 13 forks source link

"symbol lookup error" while running pre-built binary #6

Open sazzad114 opened 6 years ago

sazzad114 commented 6 years ago

I am trying to run the pre-built binary in my Ubuntu 16.04 machine.

I built LLVM 3.3 and set LD_LIBRARY_PATH like below before running "llvm-slicing" binary.

export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:~/llvm/llvm-3.3/Release+Asserts/lib

After that, I run the following command, ./llvm-slicing sum3.c

And get the following error: ./llvm-slicing: symbol lookup error: ./llvm-slicing: undefined symbol: _ZN4llvm11ParseIRFileERKSsRNS_12SMDiagnosticERNS_11LLVMContextE

If I run c++filt I get the following. c++filt _ZN4llvm11ParseIRFileERKSsRNS_12SMDiagnosticERNS_11LLVMContextE llvm::ParseIRFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, llvm::SMDiagnostic&, llvm::LLVMContext&)

The ldd command returns the following,

ldd llvm-slicing

        linux-vdso.so.1 =>  (0x00007effcb04e000)
    libLLVM-3.3.so.1 => ~/llvm/llvm-3.3/Release+Asserts/lib/libLLVM-3.3.so.1 (0x00007effc9031000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007effc8caf000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007effc8aa7000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007effc88a4000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007effc86a0000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007effc8483000)
    libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007effc8203000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007effc7efa000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007effc7ce4000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007effc791a000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007effc7700000)
    /lib64/ld-linux-x86-64.so.2 (0x00007effcae2b000)

Thanks in advance for your help!

zhangyz commented 6 years ago

Thanks a lot for your attention to our project. The pre-built binary file was built in Ubuntu 12.04 with pre-built llvm-3.3 for Ubuntu-12.04. Is your question is related to this? I am not sure.

sazzad114 commented 6 years ago

My question is what I need to do to run it in Latest Ubuntu versions (e.g., 16.04)? How can I get around the "symbol lookup error"?

Thanks a lot for your reply!