undefined reference to `ffi_call@LIBFFI_BASE_7.0'

Hi all,

Automatic builds on fails since I’ve switched to core20 and GNOME 3.38.

I’ve a gitlab pipeline that snaps Remmina using the core20 without troubles, but the daily builds on launchpad, are failing with these errors:

/snap/gnome-3-38-2004-sdk/current/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/ undefined reference to `ffi_type_uint32@LIBFFI_BASE_7.0'
/snap/gnome-3-38-2004-sdk/current/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/ undefined reference to `ffi_type_sint32@LIBFFI_BASE_7.0'
/snap/gnome-3-38-2004-sdk/current/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/ undefined reference to `ffi_type_pointer@LIBFFI_BASE_7.0'
/snap/gnome-3-38-2004-sdk/current/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/ undefined reference to `ffi_type_void@LIBFFI_BASE_7.0'
/snap/gnome-3-38-2004-sdk/current/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/ undefined reference to `ffi_prep_cif@LIBFFI_BASE_7.0'
/snap/gnome-3-38-2004-sdk/current/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/ undefined reference to `ffi_call@LIBFFI_BASE_7.0'

I think the main issue is that, to use the core20, we need a recent Ubuntu to have the underlying required libs.

Furthermore, I’ve no idea how I can solve or address this issue as, I think, I don’t have any controls over those builds.

One of the logs is , and the yaml file is

While the log shared is for amd64, I really don’t care much about this architecture as it’s build by our Gitlab instance without issues, but the others related to ARM would be amazing if I could fix them.

Any idea where should I have a look and how to fix it (or where to ask)?

Thanks in advance!

EDIT: I see that the builds are defined at and that it uses Ubuntu Core 16

i guess you simply should add libffi7 to your stage-packages.

your build-packages list libffi-dev but neither gnome-3-38 nor your snapcraft.yaml provide the binaries, so the linker wont find the required symbols anywhere …

@ogra thanks a lot! Yes, you are right, I didn’t think about this because the image I use in GitLab ( ubuntudesktop/gnome-3-38-2004 by @kenvandine ) already includes libffi7.

Now the problem is that I’ll have to stage a package that it won’t be needed by the official amd64 snap, making the final package even bigger.

Shouldn’t Ubuntu Core 16 already include it? My understanding is that it’s a requirement for Wayland.

this actually sounds like a bug in the gnome-3-38 extension then … it should ship this lib on all arches …

I’m not sure if I’ve well explained what happens.

On we have a CI that works perfectly with the @kenvandine ubuntudesktop/gnome-3-38-2004 image. The snap is built and published on, only amd64 as we don’t have a CI for ARM.

The problem is only with the builds at 0a7a53eca59070c64282d56ac91a00df : Snap packages : automatic builds and this started when I’ve switched to the core20 and gnome-3-38 extension.

I’m not sure if the Ubuntu image includes or not that library, probably it does, before to submit a bug somewhere I’d like the opinion of Ken.

Thanks @ogra for your help :slight_smile:

1 Like

Nope, I still have the same issue, except if I staged libffi7 in the wrong place. I’ve staged it exactly in the same part where libffi-dev is listed as build-packages.

Actually, the problem is you have lots of build-packages that are included in gnome-3-38-2004-sdk (build-snap included with the gnome-3-38 extension). So these build packages are providing different versions of libs and headers than we should be building with. Same problem with the stage-packages. I’ll take a look at trimming that down for you.


Tank you @kenvandine!