plasma-umass / coz

Coz: Causal Profiling
Other
4.06k stars 159 forks source link

libcoz.so has trouble finding a C++ mangled symbol #181

Open Rohit-Athavale opened 3 years ago

Rohit-Athavale commented 3 years ago

Small summary is I'm compiling ffmpeg(executable composed of various media/codec libraries) with coz. I'm on Ubuntu 18.04.5 LTS with gcc version 9.3.0

I installed coz by make install after cloning the master branch from here.

./ffmpeg: symbol lookup error: /usr/local/bin/../lib/libcoz.so: undefined symbol: _ZNK3elf3elf11get_sectionERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

  1. $ ./ffmpeg --help works fine (it shows the help options)
  2. $ coz run --- ./ffmpeg --help
    
    [coz_experiments/coz/libcoz/libcoz.cpp:100] bootstrapping coz
    [coz_experiments/coz/libcoz/libcoz.cpp:128] Including MAIN, which is /coz_experiments/sources/2021_05_14_11_44_48/ffmpeg/ffmpeg

./ffmpeg: symbol lookup error: /usr/local/bin/../lib/libcoz.so: undefined symbol: _ZNK3elf3elf11get_sectionERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE



I've created a C-wrapper for some custom C++ libraries (say libfoo.so) . At run time those libraries are loaded, and they may contain  other C++ references. However, ffmpeg is a pure C based executable.

Could someone tell me how to proceed.
Rohit-Athavale commented 3 years ago

ffmpeg (the executable is stripped of symbols, however ffmpeg_g contains symbols)

$ nm ffmpeg_g | grep __cxx1112basic_stringIcSt11char
               U _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_createERmm@@GLIBCXX_3.4.21