JonathanSalwan / Triton

Triton is a dynamic binary analysis library. Build your own program analysis tools, automate your reverse engineering, perform software verification or just emulate code.
https://triton-library.github.io
Apache License 2.0
3.39k stars 524 forks source link

Build error : ‘BitwuzlaTermManager’ was not declared in this scope #1337

Closed 0xdeaddc0de closed 2 weeks ago

0xdeaddc0de commented 2 weeks ago

While following the provided build instructions on the master branch, the configuration step completes successfully. However, during the compilation process, an error occurs, it seems that there was some change in the Triton code related to bitwuzla

Build :

cmake -DLLVM_INTERFACE=ON -DCMAKE_PREFIX_PATH=$(llvm-config-16 --prefix) -DBITWUZLA_INTERFACE=ON -DCMAKE_INSTALL_PREFIX=/usr/ ..

output

-- Compiling with Python bindings
-- Python3 includes: /usr/include/python3.12
-- Python3 libraries: /usr/lib/libpython3.12.so
-- Compiling with Z3 SMT solver
-- Found Z3 include directory: /usr/include
-- Found Z3 library: /usr/lib/libz3.so
-- Z3 version: 4.13.0.0
-- Compiling with Bitwuzla SMT solver
-- Found BITWUZLA include directory: /usr/local/include
-- Found BITWUZLA library: /usr/local/lib/libbitwuzla.so
-- Compiling with LLVM
-- Found LLVM 16.0.6
-- Using LLVMConfig.cmake in: /usr/lib/llvm16/lib/cmake/llvm
-- Compiling with Capstone
-- Found CAPSTONE include directory: /usr/include
-- Found CAPSTONE library: /usr/lib/libcapstone.so
-- CAPSTONE version: 5.0.1
-- Compiling with Boost headers
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/deadc0de/Triton/build

then

make -j8

output the following :


[  1%] Building CXX object src/libtriton/CMakeFiles/triton.dir/ast/bitwuzla/tritonToBitwuzla.cpp.o
[  2%] Building CXX object src/libtriton/CMakeFiles/triton.dir/ast/llvm/tritonToLLVM.cpp.o
[  3%] Building CXX object src/libtriton/CMakeFiles/triton.dir/engines/solver/bitwuzla/bitwuzlaSolver.cpp.o
[  5%] Building CXX object src/libtriton/CMakeFiles/triton.dir/engines/lifters/liftingToLLVM.cpp.o
[  5%] Building CXX object src/libtriton/CMakeFiles/triton.dir/bindings/python/init.cpp.o
[  6%] Building CXX object src/libtriton/CMakeFiles/triton.dir/bindings/python/namespaces/initArchNamespace.cpp.o
[  7%] Building CXX object src/libtriton/CMakeFiles/triton.dir/bindings/python/namespaces/initAstNodeNamespace.cpp.o
[  7%] Building CXX object src/libtriton/CMakeFiles/triton.dir/bindings/python/modules/tritonCallbacks.cpp.o
[  8%] Building CXX object src/libtriton/CMakeFiles/triton.dir/bindings/python/namespaces/initAstRepresentationNamespace.cpp.o
/home/deadc0de/Triton/src/libtriton/ast/bitwuzla/tritonToBitwuzla.cpp: In member function ‘BitwuzlaTerm triton::ast::TritonToBitwuzla::translate(const triton::ast::SharedAbstractNode&, Bitwuzla*)’:
/home/deadc0de/Triton/src/libtriton/ast/bitwuzla/tritonToBitwuzla.cpp:64:7: error: ‘BitwuzlaTermManager’ was not declared in this scope; did you mean ‘BitwuzlaTerm’?
   64 |       BitwuzlaTermManager* tm = bitwuzla_get_term_mgr(bzla);
JonathanSalwan commented 2 weeks ago

Are you using Bitwuzla 0.4 ?

0xdeaddc0de commented 2 weeks ago

Hm i was on master branch of bitwuzla and the doc for building was refering to 0.4. I did a git checkout to 0.4.0 and now i can't build bitwuzla, so i think i was not using the good version.

JonathanSalwan commented 2 weeks ago

Maybe that can help: https://github.com/JonathanSalwan/Triton/blob/master/.github/workflows/linux.yml#L51-L60

0xdeaddc0de commented 2 weeks ago

Thks ! But it's not fixing my issue error: ‘abs’ is not a member of ‘std’ closing this issue and opening one on the Bitwuzla git.