Closed RobertYCXu closed 2 years ago
Hey @RobertYCXu , can you confirm that Bear is installed to /usr/local
? Did it install the wrapper
and libexec.so
under /usr/local/lib64
or /usr/local/lib
? (Also, why is it /usr/local//lib64
? Note the double slash.)
Hey @RobertYCXu , can you confirm that Bear is installed to
/usr/local
? Did it install thewrapper
andlibexec.so
under/usr/local/lib64
or/usr/local/lib
? (Also, why is it/usr/local//lib64
? Note the double slash.)
Thanks for your response @rizsotto !
Yep Bear is in /usr/local/bin/bear
I don't see wrapper
and libexec.so
under either /usr/local/lib
or /usr/local/lib64
I think the double slash is because $LIB
env variable does not have anything set for it.
I should also note that I was having troubles building; mucked with the CMakeLists files as directed here: https://github.com/rizsotto/Bear/issues/305 in order to build properly. Not sure if this is relevant.
A couple of notes it might went wrong...
$LIB
symbol is only there if you enable multilib support. SUPPORT_MULTILIB
is OFF
by default. Read more about this here. I mention it because the $LIB
should not be resolved by the shell, it's nothing to do with environment variables.wrapper
or libexec.so
. If you run bear --help
it will list where the files should be installed.CFLAGS
, CXXFLAGS
and LDFLAGS
to pass extra flags, and try to avoid changing the CMake files. (The patch from that issue might be probably obsolete, and causing problems of the missing binaries.)I'm closing it, because it looks like an installation problem to me.
I am happy to help. Just the ticket got closed. :smile:
Hi @rizsotto ,
I've updated my gcc version to 10.2.1 but I'm still getting the same error...
[ 60%] Built target intercept_a
[ 62%] Linking CXX executable intercept
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/SessionLibrary.cc.o: in function `ic::LibraryPreloadSession::supervise(domain::Execution const&) const':
SessionLibrary.cc:(.text+0xae9): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/SessionLibrary.cc.o: in function `domain::Execution::Execution(domain::Execution&&)':
SessionLibrary.cc:(.text._ZN6domain9ExecutionC2EOS0_[_ZN6domain9ExecutionC5EOS0_]+0x78): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionLibrary.cc:(.text._ZN6domain9ExecutionC2EOS0_[_ZN6domain9ExecutionC5EOS0_]+0x148): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionLibrary.cc:(.text._ZN6domain9ExecutionC2EOS0_[_ZN6domain9ExecutionC5EOS0_]+0x1e4): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionLibrary.cc:(.text._ZN6domain9ExecutionC2EOS0_[_ZN6domain9ExecutionC5EOS0_]+0x1f5): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/Application.cc.o:Application.cc:(.text+0x48f): more undefined references to `std::filesystem::__cxx11::path::_M_split_cmpts()' follow
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/Session.cc.o: in function `ic::Session::keep_front_in_path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Session.cc:(.text+0x70b): undefined reference to `std::filesystem::__cxx11::path::compare(std::filesystem::__cxx11::path const&) const'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/Session.cc.o: in function `ic::Session::remove_from_path(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
Session.cc:(.text+0xdb4): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: Session.cc:(.text+0xdc6): undefined reference to `std::filesystem::__cxx11::path::compare(std::filesystem::__cxx11::path const&) const'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/SessionWrapper.cc.o: in function `std::_Function_handler<void (char const* const&), ic::WrapperSession::from(flags::Arguments const&, char const**)::{lambda(auto:1)#1}::operator()<std::__cxx11::list<std::filesystem::__cxx11::path, std::allocator<std::filesystem::__cxx11> > >(std::__cxx11::list<std::filesystem::__cxx11::path, std::allocator<std::filesystem::__cxx11> >) const::{lambda(auto:1)#1}>::_M_invoke(std::_Any_data const&, char const* const&)':
SessionWrapper.cc:(.text+0xc04): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionWrapper.cc:(.text+0xde5): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/SessionWrapper.cc.o: in function `std::_Function_handler<void (char const* const&), ic::WrapperSession::from(flags::Arguments const&, char const**)::{lambda(auto:1 const&)#2}::operator()<std::tuple<std::basic_string_view<char, std::char_traits<char> >, std::map<std::__cxx11::basic_string<char, std::char_traits, std::allocator<char> >, std::filesystem::__cxx11::path, std::less<std::allocator<char> >, std::allocator<std::pair<std::allocator<char> const, std::filesystem::__cxx11> > > > >(std::tuple<std::basic_string_view<char, std::char_traits<char> >, std::map<std::__cxx11::basic_string<char, std::char_traits, std::allocator<char> >, std::filesystem::__cxx11::path, std::less<std::allocator<char> >, std::allocator<std::pair<std::allocator<char> const, std::filesystem::__cxx11> > > > const&) const::{lambda(auto:1)#1}>::_M_invoke(std::_Any_data const&, char const* const&)':
SessionWrapper.cc:(.text+0x1077): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionWrapper.cc:(.text+0x11ad): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionWrapper.cc:(.text+0x12d2): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/SessionWrapper.cc.o:SessionWrapper.cc:(.text+0x140e): more undefined references to `std::filesystem::__cxx11::path::_M_split_cmpts()' follow
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/SessionWrapper.cc.o: in function `(anonymous namespace)::list_dir(std::filesystem::__cxx11::path const&)':
SessionWrapper.cc:(.text+0x4c4b): undefined reference to `std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&, std::filesystem::directory_options, std::error_code*)'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionWrapper.cc:(.text+0x4cd7): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionWrapper.cc:(.text+0x4d0c): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionWrapper.cc:(.text+0x5004): undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&)'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionWrapper.cc:(.text+0x5040): undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/SessionWrapper.cc.o: in function `ic::WrapperSession::resolve(std::filesystem::__cxx11::path const&) const':
SessionWrapper.cc:(.text+0x5396): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionWrapper.cc:(.text+0x5436): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionWrapper.cc:(.text+0x550d): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: SessionWrapper.cc:(.text+0x5529): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/SessionWrapper.cc.o: in function `ic::WrapperSession::resolve(domain::Execution const&) const':
SessionWrapper.cc:(.text+0x5962): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/intercept_a.dir/source/collect/SessionWrapper.cc.o:SessionWrapper.cc:(.text+0x5a91): more undefined references to `std::filesystem::__cxx11::path::_M_split_cmpts()' follow
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/domain_a.dir/source/Domain.cc.o: in function `domain::operator==(domain::Execution const&, domain::Execution const&)':
Domain.cc:(.text+0x15): undefined reference to `std::filesystem::__cxx11::path::compare(std::filesystem::__cxx11::path const&) const'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: Domain.cc:(.text+0x9b): undefined reference to `std::filesystem::__cxx11::path::compare(std::filesystem::__cxx11::path const&) const'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/domain_a.dir/source/Convert.cc.o: in function `domain::from(rpc::Execution const&)':
Convert.cc:(.text+0x142): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: Convert.cc:(.text+0x24a): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/events_db_a.dir/source/collect/db/EventsDatabaseReader.cc.o: in function `ic::collect::db::EventsDatabaseReader::from(std::filesystem::__cxx11::path const&)':
EventsDatabaseReader.cc:(.text+0x4b8): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: EventsDatabaseReader.cc:(.text+0x5be): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/events_db_a.dir/source/collect/db/EventsDatabaseReader.cc.o: in function `ic::collect::db::EventsDatabaseReader::EventsDatabaseReader(std::filesystem::__cxx11::path, std::unique_ptr<std::istream, std::default_delete<std::istream> >)':
EventsDatabaseReader.cc:(.text+0x6ec): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: CMakeFiles/events_db_a.dir/source/collect/db/EventsDatabaseReader.cc.o:EventsDatabaseReader.cc:(.text+0x70c): more undefined references to `std::filesystem::__cxx11::path::_M_split_cmpts()' follow
/opt/rh/gcc-toolset-10/root/usr/bin/ld: ../libsys/CMakeFiles/sys_a.dir/source/Path.cc.o: in function `sys::path::get_cwd[abi:cxx11]()':
Path.cc:(.text+0x4ac): undefined reference to `std::filesystem::current_path[abi:cxx11](std::error_code&)'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: Path.cc:(.text+0x642): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: Path.cc:(.text+0x6f7): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: Path.cc:(.text+0x797): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: Path.cc:(.text+0x864): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: Path.cc:(.text+0x881): undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/opt/rh/gcc-toolset-10/root/usr/bin/ld: ../libsys/CMakeFiles/sys_a.dir/source/Path.cc.o:Path.cc:(.text+0x896): more undefined references to `std::filesystem::__cxx11::path::_M_split_cmpts()' follow
collect2: error: ld returned 1 exit status
make[5]: *** [intercept/CMakeFiles/intercept.dir/build.make:204: intercept/intercept] Error 1
make[4]: *** [CMakeFiles/Makefile2:507: intercept/CMakeFiles/intercept.dir/all] Error 2
make[3]: *** [Makefile:136: all] Error 2
make[2]: *** [CMakeFiles/BearSource.dir/build.make:87: subprojects/Stamp/BearSource/BearSource-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:174: CMakeFiles/BearSource.dir/all] Error 2
make: *** [Makefile:156: all] Error 2
Here's the cmake command I'm using:
cmake -DENABLE_UNIT_TESTS=OFF -DENABLE_FUNC_TESTS=OFF -DCMAKE_INSTALL_LIBDIR=/lib64 -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ~/Bear
From the output, it's clear it's using the right gcc that I installed. I thought this should work with gcc 10.2 like you mentioned before?
I'm pretty confident this is not an issue with Bear. (I compile it on Arch, Fedora, Ubuntu, Alpine, macOS and FreeBSD. Plus there are many distro which has package from it.) Once you figure it out. Could you ask a packaging request for EPEL to include it as package? CentOS questions coming up every 3-4 months. A package would help for many people.
My tip here, you've might installed the right gcc, but it is not picking up the filesystem library. (If you still have the old compiler, the new compiler might just using the old compiler libraries and header files.)
Describe the bug Getting
when running
bear -- make
To Reproduce Steps to reproduce the behavior:
bear -- make
Environment:
Additional context Output of
bear --verbose -- make
:Before you send... Read the wiki, I can't find libexec.so and not sure how to get it...