Libtool: warning: library was moved

I am trying to build a snap of vainfo (libva-utils) that has one library dependency: libva.

The pair builds just fine with autotools as non-snap. But with snapcraft I am having issues.

The snapcraft.yaml that I came up with:

name: vainfo
summary: Snap for libva utility.
description: |
 Show libva information.
confinement: strict
base: core20
version: '0.1'

apps:
  vainfo:
    command: usr/bin/vainfo

parts:

  libva:
    source: https://github.com/intel/libva/archive/refs/tags/2.15.0.tar.gz
    build-attributes:
      - debug
    plugin: autotools
    build-packages:
      - pkg-config
      - libdrm-dev
      - libwayland-dev
    autotools-configure-parameters:
      - --prefix=/usr
      - --libdir=/usr/lib/$SNAPCRAFT_ARCH_TRIPLET
    prime:
      - usr/**/*.so*

  va-utils:
    source: https://github.com/intel/libva-utils/releases/download/2.15.0/libva-utils-2.15.0.tar.bz2
    after: [libva]
    build-attributes:
      - debug
    plugin: autotools
    autotools-configure-parameters:
      - --prefix=/usr
    prime:
      - usr/bin/vainfo

During the configuration step of va-utils, the va library is found without issue:

checking for LIBVA_DRM... yes
checking for DRM... yes
checking for LIBVA... yes

But when linking, libtool will complain about the library having been moved:

  CCLD     libva-display.la
libtool: warning: library '/root/stage/usr/lib/x86_64-linux-gnu/libva-drm.la' was moved.
libtool: warning: library '/root/stage/usr/lib/x86_64-linux-gnu/libva-wayland.la' was moved.
libtool: warning: library '/root/stage/usr/lib/x86_64-linux-gnu/libva.la' was moved.

And subsequently fails:

libtool: error: cannot find the library '/usr/lib/x86_64-linux-gnu/libva.la' or unhandled argument '/usr/lib/x86_64-linux-gnu/libva.la'

How come there is no /root/stage/ prefix for the link argument? And why does libtool give these warnings?

None of these warnings and errors occur if I do a regular autotools build.

Thanks!

1 Like

I made some progress on this.

So, the /root/stage part was missing, because of the hard override of --libdir= to configure.

However, without it, autotools will not use the debian multiarch directory /usr/lib/x86_64-linux-gnu and just installs in /usr/lib causing other problems.

I am not sure how autotools decides whether to use multiarch dir, or not?

The va-utils build is somewhat troublesome, because it also builds a static noinst library that ends up pointing to absolute paths without the /root/stage prefix.

But then I noticed that libva actually has two build systems: one is autotools, and the other is meson.

By using plugin: meson over plugin: autotools I get a lot further, and managed to create the snap file. So it probably makes sense to abandon the autotools approach for now.

3 Likes