[libcamera-devel] build error with libunwind-14-dev

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Aug 14 21:11:13 CEST 2022


Hi Christian,

On Sat, Aug 13, 2022 at 10:42:32PM +0200, Christian Rauch via libcamera-devel wrote:
> Am 13.08.22 um 18:26 schrieb Laurent Pinchart:
> > On Sat, Aug 13, 2022 at 01:38:10PM +0200, Christian Rauch via libcamera-devel wrote:
> >> Hello,
> >>
> >> tl;dr: On Ubuntu 22.04, "libunwind-14-dev" breaks the build process.
> >>
> >> When "libunwind-14-dev" is installed (sudo apt install libunwind-14-dev)
> >> meson will report "Library libunwind found: YES" but ninja will fail
> >> with "../src/libcamera/base/backtrace.cpp:26:10: fatal error:
> >> libunwind.h: Datei oder Verzeichnis nicht gefunden
> >> " (file not found).
> >>
> >> The header "libunwind.h" is indeed in multiple conflicting Ubuntu
> >> packages, and the build only works with "libunwind-dev". All versioned
> >> packages (libunwind-12-dev libunwind-13-dev, libunwind-14-dev) will show
> >> the issue above.
> >
> > That's quite messy. It seems to be a distribution-specific issue, I'm
> > tempted to say that Canonical should fix this.
> 
> I don't think it's a distribution issue. Looking at the meson.build I
> can see that it only searches for the library
> ("cc.find_library('libunwind')") but not for the pkg-config file. I
> think you are supposed to use "dependency('libunwind')" for this.
> 
> What happens is that meson finds the *.so file, sets "HAVE_UNWIND" but
> then does not know where the header is, because it did not check the
> *.pc file. If you compare the content of both packages:
> - https://packages.ubuntu.com/jammy/amd64/libunwind-dev/filelist
> - https://packages.ubuntu.com/jammy/amd64/libunwind-14-dev/filelist
> you will see that both contain the "libunwind.so", which is why both
> packages are exclusive, but only one contains a *.pc file.
> 
> In general, I believe that searching for build dependencies via
> "find_library" is not correct. "find_library" only searches for the
> library and not the headers.

You're absolutely right, my bad. I've sent a patch to fix this.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list