backward-cpp icon indicating copy to clipboard operation
backward-cpp copied to clipboard

Fix libdwarf include paths

Open okeuday opened this issue 4 years ago • 3 comments

  • Ubuntu 20.04 and 18.04 use a libdwarf include directory (probably to avoid confusion with the separate dwarf.h file)

okeuday avatar Aug 18 '21 07:08 okeuday

But what happens on other/older distribution then?

bombela avatar Oct 29 '21 18:10 bombela

@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).

okeuday avatar Oct 29 '21 19:10 okeuday

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.

bombela avatar Oct 03 '22 20:10 bombela