google / bloaty

Bloaty: a size profiler for binaries
Apache License 2.0
4.79k stars 346 forks source link

bloaty 1.1: building with external libs but bundled abseil results in broken linking (master builds fine) #380

Open barracuda156 opened 3 months ago

barracuda156 commented 3 months ago
[100%] Linking CXX executable bloaty
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/bloaty.dir/link.txt --verbose=ON
/opt/local/bin/g++-mp-14 -std=c++11 -W -Wall -Wno-sign-compare -fdiagnostics-color=always -pipe -Os -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport CMakeFiles/bloaty.dir/src/main.cc.o -o bloaty  -Wl,-rpath,/opt/local/lib liblibbloaty.a -lprotobuf -lre2 -lcapstone
Undefined symbols:
  "__ZN3re23RE27ExtractEN4absl11string_viewERKS0_S2_PSs", referenced from:
      __ZNK6bloaty10NameMunger5MungeEN4absl11string_viewE in liblibbloaty.a(bloaty.cc.o)
  "__ZN3re23RE27ReplaceEPSsRKS0_N4absl11string_viewE", referenced from:
      __ZN6bloaty19DisassembleFunctionERKNS_15DisassemblyInfoE in liblibbloaty.a(disassemble.cc.o)
  "__ZN3re23RE213PartialMatchNEN4absl11string_viewERKS0_PKPKNS0_3ArgEi", referenced from:
      __ZN6bloaty6Rollup11AddInternalERKSt6vectorISsSaISsEEmyb in liblibbloaty.a(bloaty.cc.o)
      __ZN6bloaty19DisassembleFunctionERKNS_15DisassemblyInfoE in liblibbloaty.a(disassemble.cc.o)
  "__ZN3re23RE213GlobalReplaceEPSsRKS0_N4absl11string_viewE", referenced from:
      __ZN6bloaty19DisassembleFunctionERKNS_15DisassemblyInfoE in liblibbloaty.a(disassemble.cc.o)
      __ZN6bloaty19DisassembleFunctionERKNS_15DisassemblyInfoE in liblibbloaty.a(disassemble.cc.o)
ld: symbol(s) not found
collect2: error: ld returned 1 exit status

Why is there no option to choose an external abseil? Bundled one is apparently outdated, and fails to work with the current re2.

barracuda156 commented 3 months ago

UPD. Okay, only release (v1.1) fails, the master builds fine:

[100%] Linking CXX executable bloaty
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/bloaty.dir/link.txt --verbose=ON
/opt/local/bin/g++-mp-14 -W -Wall -Wno-sign-compare -fdiagnostics-color=always -pipe -Os -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/include -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport CMakeFiles/bloaty.dir/src/main.cc.o -o bloaty  -Wl,-rpath,/opt/local/lib liblibbloaty.a -lprotobuf -lre2 -lcapstone /opt/local/lib/libz.dylib
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_bloaty/bloaty/work/build'
[100%] Built target bloaty
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_bloaty/bloaty/work/build'
/opt/local/bin/cmake -E cmake_progress_start /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_bloaty/bloaty/work/build/CMakeFiles 0
make: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_bloaty/bloaty/work/build'