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.53k stars 539 forks source link

compile error in ast.cpp #1014

Closed Ma5ker closed 3 years ago

Ma5ker commented 3 years ago

Hi, I build Triton on WSL2(ubuntu 20.04LTS) and get error in ast.cpp

Cmake info

sec@fun:~/apps$ cd Triton/
sec@fun:~/apps/Triton$ ls
CMakeLists.txt  CMakeModules  Dockerfile  LICENSE.txt  README.md  doc  publications  src
sec@fun:~/apps/Triton$ mkdir build
sec@fun:~/apps/Triton$ cd build/
sec@fun:~/apps/Triton/build$ cmake ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.5", minimum required is "3.6")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.8.so (found suitable version "3.8.5", minimum required is "3.6")
-- Found Z3 include directory: /usr/include
-- Found Z3 library: /usr/lib/libz3.so
-- Found CAPSTONE include directory: /usr/include
-- Found CAPSTONE library: /usr/lib/libcapstone.so
-- Found Boost: /usr/local/lib/cmake/Boost-1.76.0/BoostConfig.cmake (found suitable version "1.76.0", minimum required is "1.55.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sec/apps/Triton/build

Then build and get the following error message. It's too long, so I just copy part of it.

sec@fun:~/apps/Triton/build$ sudo make -j2 install
Scanning dependencies of target gen-syscall64
Scanning dependencies of target gen-syscall32
[  1%] Generating os/unix/syscalls32.cpp
[  2%] Generating os/unix/syscalls64.cpp
[  2%] Built target gen-syscall32
[  2%] Built target gen-syscall64
Scanning dependencies of target triton
[  4%] Building CXX object src/libtriton/CMakeFiles/triton.dir/api/api.cpp.o
[  4%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/architecture.cpp.o
[  5%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/arm/aarch64/aarch64Cpu.cpp.o
[  6%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/arm/aarch64/aarch64Semantics.cpp.o
[  7%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/arm/aarch64/aarch64Specifications.cpp.o
[  8%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/arm/arm32/arm32Cpu.cpp.o
[  9%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/arm/arm32/arm32Semantics.cpp.o
[ 10%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/arm/arm32/arm32Specifications.cpp.o
[ 11%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/arm/armOperandProperties.cpp.o
[ 12%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/bitsVector.cpp.o
[ 13%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/immediate.cpp.o
[ 15%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/instruction.cpp.o
[ 16%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/irBuilder.cpp.o
[ 17%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/memoryAccess.cpp.o
[ 18%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/operandWrapper.cpp.o
[ 19%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/register.cpp.o
[ 20%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/x86/x8664Cpu.cpp.o
[ 21%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/x86/x86Cpu.cpp.o
[ 22%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/x86/x86Semantics.cpp.o
[ 23%] Building CXX object src/libtriton/CMakeFiles/triton.dir/arch/x86/x86Specifications.cpp.o
[ 24%] Building CXX object src/libtriton/CMakeFiles/triton.dir/ast/ast.cpp.o
/home/sec/apps/Triton/src/libtriton/ast/ast.cpp: In member function ‘virtual void triton::ast::AssertNode::initHash()’:
/home/sec/apps/Triton/src/libtriton/ast/ast.cpp:303:26: error: no match for ‘operator=’ (operand types are ‘triton::uint512’ {aka ‘boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >’} and
triton::ast::ast_e’)
  303 |       this->hash = this->type;
      |                          ^~~~
In file included from /usr/local/include/boost/multiprecision/cpp_int.hpp:12,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/tritonTypes.hpp:12,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/cpuSize.hpp:11,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/ast.hpp:21,
                 from /home/sec/apps/Triton/src/libtriton/ast/ast.cpp:17:
/usr/local/include/boost/multiprecision/number.hpp:183:178: note: candidate: ‘template<class tag, class Arg1, class Arg2, class Arg3, class Arg4> typename std::enable_if<std::is_convertible<typename boost::multiprecision::detail::expression<tag, Arg1, Arg2, Arg3, Arg4>::result_type, boost::multiprecision::number<Backend, ExpressionTemplates> >::value, boost::multiprecision::number<Backend, ExpressionTemplates>&>::type boost::multiprecision::number<Backend, ExpressionTemplates>::operator=(const boost::multiprecision::detail::expression<tag, Arg1, Arg2, Arg3, Arg4>&) [with tag = tag; Arg1 = Arg1; Arg2 = Arg2; Arg3 = Arg3; Arg4 = Arg4; Backend = boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>; boost::multiprecision::expression_template_option ExpressionTemplates = boost::multiprecision::et_off]’
  183 |    BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<std::is_convertible<typename detail::expression<tag, Arg1, Arg2, Arg3, Arg4>::result_type, self_type>::value, number&>::type operator=(const detail::expression<tag, Arg1, Arg2, Arg3, Arg4>& e)
      |
                             ^~~~~~~~
/usr/local/include/boost/multiprecision/number.hpp:183:178: note:   template argument deduction/substitution failed:
/home/sec/apps/Triton/src/libtriton/ast/ast.cpp:303:26: note:   mismatched types ‘const boost::multiprecision::detail::expression<tag, Arg1, Arg2, Arg3, Arg4>’ and ‘triton::ast::ast_e’
  303 |       this->hash = this->type;
      |                          ^~~~
In file included from /usr/local/include/boost/multiprecision/cpp_int.hpp:12,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/tritonTypes.hpp:12,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/cpuSize.hpp:11,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/ast.hpp:21,
                 from /home/sec/apps/Triton/src/libtriton/ast/ast.cpp:17:
/usr/local/include/boost/multiprecision/number.hpp:230:58: note: candidate: ‘boost::multiprecision::number<Backend, ExpressionTemplates>& boost::multiprecision::number<Backend, ExpressionTemplates>::operator=(const boost::multiprecision::number<Backend, ExpressionTemplates>&) [with Backend = boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>; boost::multiprecision::expression_template_option ExpressionTemplates = boost::multiprecision::et_off]’
  230 |    BOOST_MP_FORCEINLINE BOOST_MP_CXX14_CONSTEXPR number& operator=(const number& e)
      |                                                          ^~~~~~~~
/usr/local/include/boost/multiprecision/number.hpp:230:82: note:   no known conversion for argument 1 from ‘triton::ast::ast_e’ to ‘const boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >
’
  230 |    BOOST_MP_FORCEINLINE BOOST_MP_CXX14_CONSTEXPR number& operator=(const number& e)
      |                                                                    ~~~~~~~~~~~~~~^
/usr/local/include/boost/multiprecision/number.hpp:239:4: note: candidate: ‘template<class V> typename std::enable_if<std::is_convertible<V, boost::multiprecision::number<Backend, ExpressionTemplates> >::value, boost::multiprecision::number<Backend, ExpressionTemplates>&>::type boost::multiprecision::number<Backend, ExpressionTemplates>::operator=(const V&) [with V = V; Backend = boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>; boost::multiprecision::expression_template_option ExpressionTemplates = boost::multiprecision::et_off]’
  239 |    operator=(const V& v)
      |    ^~~~~~~~
/usr/local/include/boost/multiprecision/number.hpp:239:4: note:   template argument deduction/substitution failed:
/usr/local/include/boost/multiprecision/number.hpp: In substitution of ‘template<class V> typename std::enable_if<std::is_convertible<V, boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> > >::value, boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >&>::type boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >::operator=<V>(const V&) [with V = triton::ast::ast_e]’:
/home/sec/apps/Triton/src/libtriton/ast/ast.cpp:303:26:   required from here
/usr/local/include/boost/multiprecision/number.hpp:239:4: error: no type named ‘type’ in ‘struct std::enable_if<false, boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >&>’
/usr/local/include/boost/multiprecision/number.hpp:311:58: note: candidate: ‘boost::multiprecision::number<Backend, ExpressionTemplates>& boost::multiprecision::number<Backend, ExpressionTemplates>::operator=(boost::multiprecision::number<Backend, ExpressionTemplates>&&) [with Backend = boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>; boost::multiprecision::expression_template_option ExpressionTemplates = boost::multiprecision::et_off]’
  311 |    BOOST_MP_FORCEINLINE BOOST_MP_CXX14_CONSTEXPR number& operator=(number&& r) noexcept(noexcept(std::declval<Backend&>() = std::declval<Backend>()))
      |                                                          ^~~~~~~~
/usr/local/include/boost/multiprecision/number.hpp:311:77: note:   no known conversion for argument 1 from ‘triton::ast::ast_e’ to ‘boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >&&’
  311 |    BOOST_MP_FORCEINLINE BOOST_MP_CXX14_CONSTEXPR number& operator=(number&& r) noexcept(noexcept(std::declval<Backend&>() = std::declval<Backend>()))
      |                                                                    ~~~~~~~~~^
/usr/local/include/boost/multiprecision/number.hpp:323:10: note: candidate: ‘template<class Other, boost::multiprecision::expression_template_option ET> typename std::enable_if<(std::is_convertible<Other, Backend>::value && (! boost::multiprecision::detail::is_restricted_conversion<Other, Backend>::value)), boost::multiprecision::number<Backend, ExpressionTemplates>&>::type boost::multiprecision::number<Backend, ExpressionTemplates>::operator=(boost::multiprecision::number<Other, ET>&&) [with Other = Other; boost::multiprecision::expression_template_option ET = ET; Backend = boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>; boost::multiprecision::expression_template_option ExpressionTemplates = boost::multiprecision::et_off]’
  323 |          operator=(number<Other, ET>&& val)
      |          ^~~~~~~~
/usr/local/include/boost/multiprecision/number.hpp:323:10: note:   template argument deduction/substitution failed:
/home/sec/apps/Triton/src/libtriton/ast/ast.cpp:303:26: note:   mismatched types ‘boost::multiprecision::number<Backend, ExpressionTemplates>’ and ‘triton::ast::ast_e’
  303 |       this->hash = this->type;
      |                          ^~~~
/home/sec/apps/Triton/src/libtriton/ast/ast.cpp: In member function ‘virtual void triton::ast::BvaddNode::initHash()’:
/home/sec/apps/Triton/src/libtriton/ast/ast.cpp:354:26: error: no match for ‘operator=’ (operand types are ‘triton::uint512’ {aka ‘boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >’} and
triton::ast::ast_e’)
  354 |       this->hash = this->type;
      |                          ^~~~
In file included from /usr/local/include/boost/multiprecision/cpp_int.hpp:12,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/tritonTypes.hpp:12,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/cpuSize.hpp:11,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/ast.hpp:21,
                 from /home/sec/apps/Triton/src/libtriton/ast/ast.cpp:17:
/usr/local/include/boost/multiprecision/number.hpp:183:178: note: candidate: ‘template<class tag, class Arg1, class Arg2, class Arg3, class Arg4> typename std::enable_if<std::is_convertible<typename boost::multiprecision::detail::expression<tag, Arg1, Arg2, Arg3, Arg4>::result_type, boost::multiprecision::number<Backend, ExpressionTemplates> >::value, boost::multiprecision::number<Backend, ExpressionTemplates>&>::type boost::multiprecision::number<Backend, ExpressionTemplates>::operator=(const boost::multiprecision::detail::expression<tag, Arg1, Arg2, Arg3, Arg4>&) [with tag = tag; Arg1 = Arg1; Arg2 = Arg2; Arg3 = Arg3; Arg4 = Arg4; Backend = boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>; boost::multiprecision::expression_template_option ExpressionTemplates = boost::multiprecision::et_off]’
  183 |    BOOST_MP_CXX14_CONSTEXPR typename std::enable_if<std::is_convertible<typename detail::expression<tag, Arg1, Arg2, Arg3, Arg4>::result_type, self_type>::value, number&>::type operator=(const detail::expression<tag, Arg1, Arg2, Arg3, Arg4>& e)
      |
                             ^~~~~~~~
/usr/local/include/boost/multiprecision/number.hpp:183:178: note:   template argument deduction/substitution failed:
/home/sec/apps/Triton/src/libtriton/ast/ast.cpp:354:26: note:   mismatched types ‘const boost::multiprecision::detail::expression<tag, Arg1, Arg2, Arg3, Arg4>’ and ‘triton::ast::ast_e’
  354 |       this->hash = this->type;
      |                          ^~~~
In file included from /usr/local/include/boost/multiprecision/cpp_int.hpp:12,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/tritonTypes.hpp:12,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/cpuSize.hpp:11,
                 from /home/sec/apps/Triton/src/libtriton/includes/triton/ast.hpp:21,
                 from /home/sec/apps/Triton/src/libtriton/ast/ast.cpp:17:
/usr/local/include/boost/multiprecision/number.hpp:230:58: note: candidate: ‘boost::multiprecision::number<Backend, ExpressionTemplates>& boost::multiprecision::number<Backend, ExpressionTemplates>::operator=(const boost::multiprecision::number<Backend, ExpressionTemplates>&) [with Backend = boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void>; boost::multiprecision::expression_template_option ExpressionTemplates = boost::multiprecision::et_off]’
  230 |    BOOST_MP_FORCEINLINE BOOST_MP_CXX14_CONSTEXPR number& operator=(const number& e)
      |                                                          ^~~~~~~~
/usr/local/include/boost/multiprecision/number.hpp:230:82: note:   no known conversion for argument 1 from ‘triton::ast::ast_e’ to ‘const boost::multiprecision::number<boost::multiprecision::backends::cpp_int_backend<512, 512, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void> >
’
Ma5ker commented 3 years ago

All right, I build success when I change the boost version from 1.76.0 to 1.68.0