Closed bigglasses93 closed 4 years ago
Did you get this resolved? If so, could you post your resolution for future users? I was going to look into this if it was still an issue.
From the docker image that I pulled, I still got the above issue and could not resolve. Then I tried to build from github source code and could see the generated output files.
So the solution was just that you needed to pull the latest source code? That is an expected step - the docker image only provides you the dependencies needed, but it's not practical for us to update the image on every commit.
yes, however I suppose docker should be a stable version, but it seems to contain some bugs.
Maybe you can use g++ -fno-inline -o triad-instrumented full.s -lm -lz -no-pie
to resolve it.
Hello, could you help me with this issue? I pulled the docker image and tried to run the triad test until step e, I put -no-pie into the command but got this error:
root@bddd47a827c8:/workspace/LLVM-Tracer/example/triad# gcc -fno-inline -o triad-instrumented full.s -no-pie /tmp/ccnhs4ab.o: In function, std::allocator >::c_str() const'
llvm-link:(.text+0x391b): undefined reference to , std::allocator >::c_str() const'
llvm-link:(.text+0x3a01): undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator >::operator=(char const)'
/tmp/ccnhs4ab.o: In function `log_or_not(bool, bool, int, char)':
llvm-link:(.text+0x3caf): undefined reference to , std::allocator >::c_str() const'
/tmp/ccnhs4ab.o: In function cxx11::basic_string<char, std::char_traits, std::allocator >::c_str() const'
llvm-link:(.text+0x3f18): undefined reference to `std:: cxx11::basic_string<char, std::char_traits, std::allocator >::c_str() const'
llvm-link:(.text+0x3f64): undefined reference to , std::allocator >::operator=(char const*)'
llvm-link:(.text+0x3fc2): undefined reference to `std:: cxx11::basic_string<char, std::char_traits, std::allocator >::operator=(char const)'
/tmp/ccnhs4ab.o: In function , std::allocator >::assign(char const , unsigned long)'
/tmp/ccnhs4ab.o: In function , std::allocator >::basic_string()'
/tmp/ccnhs4ab.o: In function cxx11::basic_string<char, std::char_traits, std::allocator >::~basic_string()'
/tmp/ccnhs4ab.o: In function , std::allocator > const, gzFile_s*> > >::deallocate(std::_Rb_tree_node<std::pair<std:: cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s> >, unsigned long)':
llvm-link:(.text._ZN9gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEEE10deallocateEPSD_m[_ZN9gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEEE10deallocateEPSD_m]+0x11): undefined reference to , std::allocator > const, gzFile_s>::~pair()':
llvm-link:(.text._ZNSt4pairIKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sED2Ev[_ZNSt4pairIKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sED2Ev]+0x6): undefined reference to , std::allocator >::basic_string(char const*, std::allocator const&)'
llvm-link:(.text._ZN10trace_infoC2EPKc[_ZN10trace_infoC2EPKc]+0x38): undefined reference to , std::allocator >::basic_string()'
llvm-link:(.text._ZN10trace_infoC2EPKc[_ZN10trace_infoC2EPKc]+0x70): undefined reference to cxx11::basic_string<char, std::char_traits, std::allocator >, gzFile_s, std::less<std::cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std:: cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s > > >::at(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)':
llvm-link:(.text._ZNSt3mapINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sSt4lessIS5_ESaISt4pairIKS5_S7EEE2atERSB[_ZNSt3mapINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sSt4lessIS5_ESaISt4pairIKS5_S7EEE2atERSB]+0x7a): undefined reference to `std:: throw_out_of_range(char const)'
/tmp/ccnhs4ab.o: In function `std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s > > std::_Rb_tree<std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::pair<std:: cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s > >, std::less<std::cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std:: cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s> > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<std::cxx11::basic_string<char, std::char_traits, std::allocator > const&>, std::tuple<> >(std::_Rb_tree_const_iterator<std::pair<std:: cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s > >, std::piecewise_construct_t const&, std::tuple<std::cxx11::basic_string<char, std::char_traits, std::allocator > const&>&&, std::tuple<>&&)':
llvm-link:(.text._ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEESt17_Rb_tree_iteratorISA_ESt23_Rb_tree_const_iteratorISAEDpOT[_ZNSt8_Rb_treeINSt7 cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEESt17_Rb_tree_iteratorISA_ESt23_Rb_tree_const_iteratorISAEDpOT]+0xbc): undefined reference to , std::allocator > const, gzFile_s > >::operator++()':
llvm-link:(.text._ZNSt17_Rb_tree_iteratorISt4pairIKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEEppEv[_ZNSt17_Rb_tree_iteratorISt4pairIKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEEppEv]+0x13): undefined reference to , std::allocator >, std::pair<std::cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s*>, std::_Select1st<std::pair<std:: cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s*> >, std::less<std:: cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s*> > >::_M_construct_node<std::piecewise_construct_t const&, std::tuple<std:: cxx11::basic_string<char, std::char_traits, std::allocator > const&>, std::tuple<> >(std::_Rb_tree_node<std::pair<std::cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s> >, std::piecewise_construct_t const&, std::tuple<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&>&&, std::tuple<>&&)':
llvm-link:(.text._ZNSt8_Rb_treeINSt7 cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE17_M_construct_nodeIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEEvPSt13_Rb_tree_nodeISAEDpOT[_ZNSt8_Rb_treeINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE17_M_construct_nodeIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEEvPSt13_Rb_tree_nodeISAEDpOT]+0x77): undefined reference to `cxa_begin_catch'
llvm-link:(.text._ZNSt8_Rb_treeINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE17_M_construct_nodeIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEEvPSt13_Rb_tree_nodeISAEDpOT[_ZNSt8_Rb_treeINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE17_M_construct_nodeIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEEvPSt13_Rb_tree_nodeISAEDpOT]+0x8d): undefined reference to `cxa_rethrow'
llvm-link:(.text._ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE17_M_construct_nodeIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEEvPSt13_Rb_tree_nodeISAEDpOT[_ZNSt8_Rb_treeINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE17_M_construct_nodeIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEEvPSt13_Rb_tree_nodeISAEDpOT]+0x9d): undefined reference to , std::allocator > const, gzFile_s*>::pair<std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, 0ul>(std::tuple<std:: cxx11::basic_string<char, std::char_traits, std::allocator > const&>&, std::tuple<>&, std::_Index_tuple<0ul>, std::_Index_tuple<>)':
llvm-link:(.text._ZNSt4pairIKNSt7 cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEC2IJRS6_EJLm0EEJEJEEERSt5tupleIJDpT_EERSC_IJDpT1_EESt12_Index_tupleIJXspT0_EEESL_IJXspT2_EEE[_ZNSt4pairIKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEC2IJRS6_EJLm0EEJEJEEERSt5tupleIJDpT_EERSC_IJDpT1_EESt12_Index_tupleIJXspT0_EEESL_IJXspT2_EEE]+0x28): undefined reference to `std::cxx11::basic_string<char, std::char_traits, std::allocator >::basic_string(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/tmp/ccnhs4ab.o: In function ` gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::cxx11::basic_string<char, std::char_traits, std::allocator > const, gzFile_s> > >::allocate(unsigned long, void const)':
llvm-link:(.text._ZN9 gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEEE8allocateEmPKv[_ZN9gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEEE8allocateEmPKv]+0x1f): undefined reference to `std::__throw_bad_alloc()'
llvm-link:(.text._ZN9gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEEE8allocateEmPKv[_ZN9gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEEE8allocateEmPKv]+0x35): undefined reference to , std::allocator >(std:: cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)':
llvm-link:(.text._ZStltIcSt11char_traitsIcESaIcEEbRKNSt7 cxx1112basic_stringIT_T0_T1EESA[_ZStltIcSt11char_traitsIcESaIcEEbRKNSt7cxx1112basic_stringIT_T0_T1EESA]+0x9): undefined reference to , std::allocator >::~basic_string()'
/tmp/ccnhs4ab.o:(.eh_frame+0x137): undefined reference to `__gxx_personality_v0'
collect2: error: ld returned 1 exit status
create_trace(char const*)': llvm-link:(.text+0x3867): undefined reference to
operator new(unsigned long)' llvm-link:(.text+0x38a0): undefined reference tooperator delete(void*)' /tmp/ccnhs4ab.o: In function
write_labelmap()': llvm-link:(.text+0x38f8): undefined reference togzwrite' llvm-link:(.text+0x390e): undefined reference to
std::cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::length() const' llvm-link:(.text+0x392c): undefined reference to
gzwrite' /tmp/ccnhs4ab.o: In functionopen_trace_file()': llvm-link:(.text+0x39ef): undefined reference to
std::cxx11::basic_string<char, std::char_traitsgzopen' /tmp/ccnhs4ab.o: In function
fin_main()': llvm-link:(.text+0x3b7e): undefined reference togzclose' /tmp/ccnhs4ab.o: In function
fin_toplevel()': llvm-link:(.text+0x3be8): undefined reference tooperator delete(void*)' /tmp/ccnhs4ab.o: In function
llvmtracer_set_trace_name': llvm-link:(.text+0x3c2f): undefined reference to `std::std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::length() const' llvm-link:(.text+0x3cf1): undefined reference to
std::cxx11::basic_string<char, std::char_traitstrace_logger_update_status': llvm-link:(.text+0x3ec3): undefined reference to
std::std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::length() const' llvm-link:(.text+0x3f90): undefined reference to
std::cxx11::basic_string<char, std::char_traitstrace_logger_log_entry': llvm-link:(.text+0x4075): undefined reference to
gzprintf' /tmp/ccnhs4ab.o: In functiontrace_logger_log0': llvm-link:(.text+0x4108): undefined reference to
gzprintf' /tmp/ccnhs4ab.o: In functiontrace_logger_log_int': llvm-link:(.text+0x41bc): undefined reference to
gzprintf' llvm-link:(.text+0x41e1): undefined reference togzprintf' llvm-link:(.text+0x4209): undefined reference to
gzprintf' /tmp/ccnhs4ab.o:llvm-link:(.text+0x422d): more undefined references togzprintf' follow /tmp/ccnhs4ab.o: In function
write_labelmap()': llvm-link:(.text+0x3949): undefined reference togzwrite' /tmp/ccnhs4ab.o: In function
trace_logger_register_labelmap': llvm-link:(.text+0x3aa3): undefined reference to `std::__cxx11::basic_string<char, std::char_traits__cxx_global_var_init.1': llvm-link:(.text.startup+0x3c): undefined reference to
std::cxx11::basic_string<char, std::char_traits__dtor__Z12labelmap_strB5cxx11': llvm-link:(.text.startup+0x5d): undefined reference to
std::__clang_call_terminate': llvm-link:(.text.__clang_call_terminate[__clang_call_terminate]+0x9): undefined reference to
cxa_begin_catch' llvm-link:(.text.clang_call_terminate[clang_call_terminate]+0x12): undefined reference tostd::terminate()' /tmp/ccnhs4ab.o: In function
gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::cxx11::basic_string<char, std::char_traitsoperator delete(void*)' /tmp/ccnhs4ab.o: In function
std::pair<std::cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' /tmp/ccnhs4ab.o: In function
trace_info::trace_info(char const)': llvm-link:(.text._ZN10trace_infoC2EPKc[_ZN10trace_infoC2EPKc]+0x1c): undefined reference tostd::allocator<char>::allocator()' llvm-link:(.text._ZN10trace_infoC2EPKc[_ZN10trace_infoC2EPKc]+0x2d): undefined reference to
std::cxx11::basic_string<char, std::char_traitsstd::allocator<char>::~allocator()' llvm-link:(.text._ZN10trace_infoC2EPKc[_ZN10trace_infoC2EPKc]+0x4d): undefined reference to
std::__cxx11::basic_string<char, std::char_traitsstd::allocator<char>::~allocator()' /tmp/ccnhs4ab.o: In function
std::map<std::__cxa_begin_catch' llvm-link:(.text._ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEESt17_Rb_tree_iteratorISA_ESt23_Rb_tree_const_iteratorISA_EDpOT_[_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEESt17_Rb_tree_iteratorISA_ESt23_Rb_tree_const_iteratorISA_EDpOT_]+0xd2): undefined reference to
cxa_rethrow' llvm-link:(.text._ZNSt8_Rb_treeINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEESt17_Rb_tree_iteratorISA_ESt23_Rb_tree_const_iteratorISAEDpOT[_ZNSt8_Rb_treeINSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE22_M_emplace_hint_uniqueIJRKSt21piecewise_construct_tSt5tupleIJRS7_EESL_IJEEEEESt17_Rb_tree_iteratorISA_ESt23_Rb_tree_const_iteratorISAEDpOT]+0x114): undefined reference to `cxa_end_catch' /tmp/ccnhs4ab.o: In functionstd::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, gzFile_s*>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, gzFile_s*> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, gzFile_s*> > >::_M_insert_node(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, gzFile_s*> >*)': llvm-link:(.text._ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE14_M_insert_nodeEPSt18_Rb_tree_node_baseSI_PSt13_Rb_tree_nodeISA_E[_ZNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P8gzFile_sESt10_Select1stISA_ESt4lessIS5_ESaISA_EE14_M_insert_nodeEPSt18_Rb_tree_node_baseSI_PSt13_Rb_tree_nodeISA_E]+0x78): undefined reference to
std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base, std::_Rb_tree_node_base, std::_Rb_tree_node_base&)' /tmp/ccnhs4ab.o: In functionstd::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, gzFile_s*> >::operator--()': llvm-link:(.text._ZNSt17_Rb_tree_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEEmmEv[_ZNSt17_Rb_tree_iteratorISt4pairIKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP8gzFile_sEEmmEv]+0x13): undefined reference to
std::_Rb_tree_decrement(std::_Rb_tree_node_base)' /tmp/ccnhs4ab.o: In function `std::_Rb_tree_iterator<std::pair<std::__cxx11::basic_string<char, std::char_traitsstd::_Rb_tree_increment(std::_Rb_tree_node_base*)' /tmp/ccnhs4ab.o: In function
void std::_Rb_tree<std::cxx11::basic_string<char, std::char_traits__cxa_end_catch' /tmp/ccnhs4ab.o: In function
std::pair<std::cxx11::basic_string<char, std::char_traitsoperator new(unsigned long)' /tmp/ccnhs4ab.o: In function
bool std::operator< <char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /tmp/ccnhs4ab.o: In function
trace_info::~trace_info()': llvm-link:(.text._ZN10trace_infoD2Ev[_ZN10trace_infoD2Ev]+0x17): undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' llvm-link:(.text._ZN10trace_infoD2Ev[_ZN10trace_infoD2Ev]+0x28): undefined reference to
std::cxx11::basic_string<char, std::char_traits