Protobuf linker errors - mcsema-lift-4.0 linker errors due to headers?

39 views
Skip to first unread message

mar...@because-security.com

unread,
Nov 20, 2017, 11:40:27 AM11/20/17
to mcsema-dev
Hey,

can someone please enlighten me regarding protobuf linker errors with mcsema builds?
I am working on building a Docker container to get the deps sorted out in an easier fashion.

So here is my Kung Fu so far, to test things:

-- ~/Source » ls                                                                       2 ↵
remill  remill-build
--- ~/Source »

--- ~/Source » ./remill/scripts/build.sh
[ ... ]
[ 96%] Building CXX object tools/mcsema/CMakeFiles/mcsema-lift-4.0.dir/mcsema/BC/Util.cpp.o
[ 98%] Building CXX object tools/mcsema/CMakeFiles/mcsema-lift-4.0.dir/tools/mcsema_lift/Lift.cpp.o
[100%] Linking CXX executable mcsema-lift-4.0
CMakeFiles/mcsema-lift-4.0.dir/CFG.pb.cc.o: In function `google::protobuf::internal::GetEmptyStringAlreadyInited[abi:cxx11]()':
/home/marius/Source/remill-build/libraries/protobuf/include/google/protobuf/generated_message_util.h:81: undefined reference to `google::protobuf::internal::empty_string_[abi:cxx11]'
/home/marius/Source/remill-build/libraries/protobuf/include/google/protobuf/generated_message_util.h:81: undefined reference to `google::protobuf::internal::empty_string_[abi:cxx11]'
[ ... ]

K, I didn't break it this time.
But from the endless backlogs of my Shells I can say I did what's in the readme docs:

Collecting protobuf==3.2.0
  Downloading protobuf-3.2.0-cp27-cp27mu-manylinux1_x86_64.whl (5.6MB)
    100% |████████████████████████████████| 5.6MB 125kB/s
Requirement already satisfied: six>=1.9 in /usr/local/lib/python2.7/dist-packages (from protobuf==3.2.0)
Requirement already satisfied: setuptools in /usr/lib/python2.7/dist-packages (from protobuf==3.2.0)
Installing collected packages: protobuf
Successfully installed protobuf-3.2.0

See.. so. protobuf 3.2.0. Check.

What do I do next? Is it fixing time or is it branch switching? Looks to me like some code was merged and the headers haven't been fixed. But I am not sure.

Best,
Marius

Artem Dinaburg

unread,
Nov 21, 2017, 12:28:08 PM11/21/17
to mar...@because-security.com, mcsema-dev
Hi Marius,

The readme may be wrong there. Sorry about that! Can you try removing the pip installed protobuf and using our cxx-common package (which has a lot of pre-built dependencies):

rm -rf libraries ; tar xzf libraries-llvm40-ubuntu1604-amd64.tar.gz
export TRAILOFBITS_LIBRARIES=`realpath libraries`
export PATH="${TRAILOFBITS_LIBRARIES}/cmake/bin:${TRAILOFBITS_LIBRARIES}/llvm/bin:${PATH}"
export CC="${TRAILOFBITS_LIBRARIES}/llvm/bin/clang"
export CXX="${TRAILOFBITS_LIBRARIES}/llvm/bin/clang++"
mkdir build && cd build && cmake ../remill
make -j `nproc`


Artem

--
You received this message because you are subscribed to the Google Groups "mcsema-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mcsema-dev+...@googlegroups.com.
To post to this group, send email to mcsem...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mcsema-dev/dc97f1c2-0045-470d-a398-0e417479da9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

signature.asc
Reply all
Reply to author
Forward
0 new messages