bombela / backward-cpp

A beautiful stack trace pretty printer for C++
MIT License
3.73k stars 471 forks source link

Fix libdwarf include paths #237

Open okeuday opened 3 years ago

okeuday commented 3 years ago
bombela commented 2 years ago

But what happens on other/older distribution then?

okeuday commented 2 years ago

@bombela While libdwarf doesn't enforce an installation directory (based on this) it looks like installation is expected to have its own libdwarf directory because it needs to avoid any potential conflict with libdw (e.g., Alpine does the same).

bombela commented 1 year ago

You can always add /usr/include/libdwarf to your compiler flags. But I take note the libdwarf1 on Ubuntu is not listed in pkg-config.

And indeed these two packages have both "dwarf.h"! Ubuntu 22.04 LTS:

$ apt-file show libdwarf-dev | grep '\.h$'
libdwarf-dev: /usr/include/libdwarf/dwarf.h
libdwarf-dev: /usr/include/libdwarf/libdwarf.h

$ apt-file show libdw-dev | grep '\.h$'
libdw-dev: /usr/include/dwarf.h
libdw-dev: /usr/include/elfutils/known-dwarf.h
libdw-dev: /usr/include/elfutils/libdw.h
libdw-dev: /usr/include/elfutils/libdwelf.h
libdw-dev: /usr/include/elfutils/libdwfl.h

I am not sure what to do here. C++ headers are not namespaced. Well at least not until modules come to C++, and even that will take time to be available everywhere. So maybe your proposal is reasonable.