Git Product home page Git Product logo

Comments (7)

danielcdh avatar danielcdh commented on April 28, 2024

from autofdo.

justanerd avatar justanerd commented on April 28, 2024

Yes I got all dependent projects with:
git clone --recursive https://github.com/google/autofdo.git
I did every step from the readme maybe it's related to the build order.
I started the build from the autofdo root that should be right ?

from autofdo.

danielcdh avatar danielcdh commented on April 28, 2024

from autofdo.

justanerd avatar justanerd commented on April 28, 2024

works with die fix from lannadorai

from autofdo.

sindrom91 avatar sindrom91 commented on April 28, 2024

After applying the fix from @lannadorai this error disappears, but I get a different ones.

I get this error when compiling with make -j4:

In file included from third_party/perf_data_converter/src/quipper/perf_parser.h:21:0,
                 from sample_reader.cc:23:
third_party/perf_data_converter/src/quipper/compat/proto.h:8:59: fatal error: google/protobuf/io/zero_copy_stream_impl_lite.h: No such file or directory
compilation terminated.
Makefile:1116: recipe for target 'create_llvm_prof-sample_reader.o' failed
make[1]: *** [create_llvm_prof-sample_reader.o] Error 1

But a different one when compiling with make:

g++ -std=gnu++11 -I./third_party/protobuf/src -g -O2 -std=gnu++11 -lpthread -lelf -lz  -o create_gcov addr2line.o gcov.o instruction_map.o module_grouper.o profile_creator.o profile_writer.o sample_reader.o source_info.o symbol_map.o profile.o create_gcov.o third_party/perf_data_converter/src/quipper/perf_data.pb.o third_party/perf_data_converter/src/quipper/perf_stat.pb.o libquipper.a libglog.a libsymbolize.a libgflags.a third_party/protobuf/src/.libs/libprotobuf.a -lz -lcrypto
libquipper.a(dso.o): In function `quipper::InitializeLibelf()':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:102: undefined reference to `elf_version'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:102: undefined reference to `elf_errmsg'
libquipper.a(dso.o): In function `quipper::(anonymous namespace)::GetBuildID(Elf*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:62: undefined reference to `elf_kind'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:64: undefined reference to `elf_errmsg'
libquipper.a(dso.o): In function `FindElfSection':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:31: undefined reference to `elf_getshdrstrndx'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:36: undefined reference to `elf_getscn'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:36: undefined reference to `elf_rawdata'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:41: undefined reference to `elf_nextscn'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:43: undefined reference to `gelf_getshdr'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:44: undefined reference to `elf_strptr'
libquipper.a(dso.o): In function `quipper::(anonymous namespace)::GetBuildID(Elf*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:76: undefined reference to `elf_getdata'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:83: undefined reference to `gelf_getnote'
libquipper.a(dso.o): In function `FindElfSection':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:32: undefined reference to `elf_errmsg'
libquipper.a(dso.o): In function `quipper::ReadElfBuildId(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:119: undefined reference to `elf_begin'
/proj/autofdo/third_party/perf_data_converter/src/quipper/dso.cc:128: undefined reference to `elf_end'
collect2: error: ld returned 1 exit status
Makefile:809: recipe for target 'create_gcov' failed
make[1]: *** [create_gcov] Error 1
make[1]: Leaving directory '/proj/autofdo'
Makefile:567: recipe for target 'all' failed
make: *** [all] Error 2

from autofdo.

kimphill avatar kimphill commented on April 28, 2024

I too am experiencing these bugs on Ubuntu/x86 after merging that fix on @lannadorai's master branch. I have libelf installed, and was able to hack a create_gcov binary together by cutting-and-pasting that g++ line and tacking on a ' -lelf' at the end, but the resulting binary just dumps core:

$ ./create_gcov 
terminate called after throwing an instance of 'std::system_error'
  what():  Unknown error -1
Aborted (core dumped)

I tried the single-threaded make on an Arm/Debian machine, and got:

g++ -DHAVE_CONFIG_H -I. -I./glog/src  -I. -I./glog/src -I./third_party/perf_data_converter/src/quipper   -DCREATE_LLVM_PROF -g -O2 -MT create_llvm_prof-sample_reader.o -MD -MP -MF .deps/create_llvm_prof-sample_reader.Tpo -c -o create_llvm_prof-sample_reader.o `test -f 'sample_reader.cc' || echo './'`sample_reader.cc
In file included from third_party/perf_data_converter/src/quipper/perf_parser.h:21:0,
                 from sample_reader.cc:23:
third_party/perf_data_converter/src/quipper/compat/proto.h:8:59: fatal error: google/protobuf/io/zero_copy_stream_impl_lite.h: No such file or directory
 #include "google/protobuf/io/zero_copy_stream_impl_lite.h"
                                                           ^
compilation terminated.

not sure how to proceed...

from autofdo.

rwalkr avatar rwalkr commented on April 28, 2024

The core dump from create_gcov is because the library isn't linked with -lpthread - for similar reasons as the -lelf failures - the libraries appear at the beginning of the command line, but are dropped by the linker before any of the other libraries that use them make a reference to them. The fix is the same: -lelf and -lpthread need to be moved to the end of the linker command line.

Also @lannadorai's fix to generate the proto buffer files needs a small change to stop it regenerating them and recompiling everything else every time make is invoked.

Will create a pull request with these fixes

from autofdo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.