question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GNOME projects using generate_gir fail to cross compile since 0.57.0

See original GitHub issue

Describe the bug Since 21897a10ca0295f65f158ed3cbac396bc5adbb54 (#7913), cross building GNOME applications which use generate_gir fails with cannot open shared object file: No such file or directory (tested gnome-desktop 40.3 and mutter 40.1) .

To Reproduce

from https://gitlab.gnome.org/GNOME/gnome-desktop/-/blob/master/libgnome-desktop/meson.build:

...
libgnome_desktop_dep = declare_dependency(
  dependencies: gnome_desktop_deps,
  link_with: libgnome_desktop
)

gnome.generate_gir(libgnome_desktop,
  sources: introspection_sources + libgnome_desktop_headers,
  export_packages: 'gnome-desktop-3.0',
  namespace: 'GnomeDesktop',
  nsversion: '3.0',
  includes: ['GObject-2.0', 'Gtk-3.0', 'GDesktopEnums-3.0'],
  extra_args: '-DGNOME_DESKTOP_USE_UNSTABLE_API',
  identifier_prefix: 'Gnome',
  symbol_prefix: 'gnome',
  install: true
)

desktop_pc = pkg.generate(
  libraries: libgnome_desktop,
...

cross compiling gnome-desktop 40.3 for armv7l with meson 0.58.1:

...
[15/43] Compiling C object libgnome-desktop/libgnome-desktop-3.so.19.1.4.p/gnome-pnp-ids.c.o
[16/43] Compiling C object libgnome-desktop/libgnome-desktop-3.so.19.1.4.p/gnome-wall-clock.c.o
[17/43] Compiling C object libgnome-desktop/libgnome-desktop-3.so.19.1.4.p/gnome-xkb-info.c.o
[18/43] Compiling C object libgnome-desktop/libgnome-desktop-3.so.19.1.4.p/gnome-idle-monitor.c.o
[19/43] Compiling C object libgnome-desktop/libgnome-desktop-3.so.19.1.4.p/gnome-languages.c.o
[20/43] Compiling C object libgnome-desktop/gnome-rr-debug.p/gnome-rr-debug.c.o
[21/43] Compiling C object libgnome-desktop/libgnome-desktop-3.so.19.1.4.p/gnome-datetime-source.c.o
[22/43] Compiling C object libgnome-desktop/libgnome-desktop-3.so.19.1.4.p/gnome-desktop-thumbnail-script.c.o
[23/43] Linking target libgnome-desktop/libgnome-desktop-3.so.19.1.4
[24/43] Generating GnomeDesktop-3.0.gir with a custom command
FAILED: libgnome-desktop/GnomeDesktop-3.0.gir 
/usr/armv7l-linux-gnueabihf/usr/bin/g-ir-scanner --no-libtool --namespace=GnomeDesktop --nsversion=3.0 --warn-all --output libgnome-desktop/GnomeDesktop-3.0.gir -DGNOME_DESKTOP_USE_UNSTABLE_API -I/builddir/gnome-desktop-40.2/libgnome-desktop -I/builddir/gnome-desktop-40.2/build/libgnome-desktop -I/builddir/gnome-desktop-40.2/build/. -I/builddir/gnome-desktop-40.2/. --filelist=/builddir/gnome-desktop-40.2/build/libgnome-desktop/libgnome-desktop-3.so.19.1.4.p/GnomeDesktop_3.0_gir_filelist --include=GObject-2.0 --include=Gtk-3.0 --include=GDesktopEnums-3.0 --symbol-prefix=gnome --identifier-prefix=Gnome --pkg-export=gnome-desktop-3.0 --cflags-begin -I/builddir/gnome-desktop-40.2/build/. -I/builddir/gnome-desktop-40.2/. -I/usr/armv7l-linux-gnueabihf/usr/include/gdk-pixbuf-2.0 -I/usr/armv7l-linux-gnueabihf/usr/include/libmount -I/usr/armv7l-linux-gnueabihf/usr/include/blkid -I/usr/armv7l-linux-gnueabihf/usr/include/glib-2.0 -I/usr/armv7l-linux-gnueabihf/usr/lib32/glib-2.0/include -I/usr/armv7l-linux-gnueabihf/usr/include/gtk-3.0 -I/usr/armv7l-linux-gnueabihf/usr/include/at-spi2-atk/2.0 -I/usr/armv7l-linux-gnueabihf/usr/include/at-spi-2.0 -I/usr/armv7l-linux-gnueabihf/usr/include/dbus-1.0 -I/usr/armv7l-linux-gnueabihf/usr/lib/dbus-1.0/include -I/usr/armv7l-linux-gnueabihf/usr/include/gio-unix-2.0 -I/usr/armv7l-linux-gnueabihf/usr/include/cairo -I/usr/armv7l-linux-gnueabihf/usr/include/pango-1.0 -I/usr/armv7l-linux-gnueabihf/usr/include/harfbuzz -I/usr/armv7l-linux-gnueabihf/usr/include/fribidi -I/usr/armv7l-linux-gnueabihf/usr/include/atk-1.0 -I/usr/armv7l-linux-gnueabihf/usr/include/pixman-1 -I/usr/armv7l-linux-gnueabihf/usr/include/uuid -I/usr/armv7l-linux-gnueabihf/usr/include/freetype2 -I/usr/armv7l-linux-gnueabihf/usr/include/libpng16 -I/usr/armv7l-linux-gnueabihf/usr/include/gsettings-desktop-schemas -I/usr/include/gobject-introspection-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -D_FORTIFY_SOURCE=2 -I/usr/armv7l-linux-gnueabihf/usr/include --cflags-end --add-include-path=///usr/share/gir-1.0 -L./libgnome-desktop --library gnome-desktop-3 -L/usr/armv7l-linux-gnueabihf/usr/lib32 -L/usr/armv7l-linux-gnueabihf/usr/lib -L/usr/armv7l-linux-gnueabihf/usr/lib32 --extra-library=gdk_pixbuf-2.0 --extra-library=gobject-2.0 --extra-library=glib-2.0 --extra-library=gtk-3 --extra-library=gdk-3 --extra-library=pangocairo-1.0 --extra-library=pango-1.0 --extra-library=harfbuzz --extra-library=atk-1.0 --extra-library=cairo-gobject --extra-library=cairo --extra-library=gio-2.0 --extra-library=udev --extra-library=seccomp --extra-library=m --extra-library=rt --extra-library=girepository-1.0 --sources-top-dirs /builddir/gnome-desktop-40.2/subprojects/ --sources-top-dirs /builddir/gnome-desktop-40.2/build/subprojects/
In file included from /usr/armv7l-linux-gnueabihf/usr/include/bits/libc-header-start.h:33,
                 from /usr/armv7l-linux-gnueabihf/usr/include/limits.h:26,
                 from /usr/lib/gcc/armv7l-linux-gnueabihf/10.2/include-fixed/limits.h:195,
                 from /usr/lib/gcc/armv7l-linux-gnueabihf/10.2/include-fixed/syslimits.h:7,
                 from /usr/lib/gcc/armv7l-linux-gnueabihf/10.2/include-fixed/limits.h:34,
                 from /usr/armv7l-linux-gnueabihf/usr/lib/glib-2.0/include/glibconfig.h:11,
                 from /usr/armv7l-linux-gnueabihf/usr/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/armv7l-linux-gnueabihf/usr/include/glib-2.0/glib/galloca.h:32,
                 from /usr/armv7l-linux-gnueabihf/usr/include/glib-2.0/glib.h:30,
                 from /usr/armv7l-linux-gnueabihf/usr/include/gtk-3.0/gdk/gdkconfig.h:13,
                 from /usr/armv7l-linux-gnueabihf/usr/include/gtk-3.0/gdk/gdk.h:30,
                 from /builddir/gnome-desktop-40.2/libgnome-desktop/gnome-bg.h:32,
                 from /builddir/gnome-desktop-40.2/build/g-ir-cpp-etfcy40f.c:4:
/usr/armv7l-linux-gnueabihf/usr/include/features.h:397:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  397 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
g-ir-scanner: link: armv7l-linux-gnueabihf-gcc -o /builddir/gnome-desktop-40.2/build/tmp-introspect2idzrh2v/GnomeDesktop-3.0 -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard -g -I/usr/armv7l-linux-gnueabihf/usr/include /builddir/gnome-desktop-40.2/build/tmp-introspect2idzrh2v/GnomeDesktop-3.0.o -L. -Wl,-rpath,. -Wl,--no-as-needed -L./libgnome-desktop -L/usr/armv7l-linux-gnueabihf/usr/lib32 -Wl,-rpath,/usr/armv7l-linux-gnueabihf/usr/lib32 -L/usr/armv7l-linux-gnueabihf/usr/lib -Wl,-rpath,/usr/armv7l-linux-gnueabihf/usr/lib -L/usr/armv7l-linux-gnueabihf/usr/lib32 -Wl,-rpath,/usr/armv7l-linux-gnueabihf/usr/lib32 -lgnome-desktop-3 -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgio-2.0 -ludev -lseccomp -lm -lrt -lgirepository-1.0 -L/usr/armv7l-linux-gnueabihf/usr/lib32 -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/armv7l-linux-gnueabihf/usr/lib
/builddir/gnome-desktop-40.2/build/tmp-introspect2idzrh2v/GnomeDesktop-3.0: error while loading shared libraries: libgnome-desktop-3.so.19: cannot open shared object file: No such file or directory
Command '['/usr/bin/g-ir-scanner-qemuwrapper', '/builddir/gnome-desktop-40.2/build/tmp-introspect2idzrh2v/GnomeDesktop-3.0', '--introspect-dump=/builddir/gnome-desktop-40.2/build/tmp-introspect2idzrh2v/functions.txt,/builddir/gnome-desktop-40.2/build/tmp-introspect2idzrh2v/dump.xml']' returned non-zero exit status 127.
ninja: build stopped: subcommand failed.

Expected behavior The cross build should not fail. Reverting commits 21897a10ca0295f65f158ed3cbac396bc5adbb54 and df4314c7b88998aa9e7a497b1da04efb77110f60 (because reverting the first commit reintroduces @PRIVATE_OUTDIR_(ABS)@ and the second commit removes it) fixes this issue.

system parameters

  • Is this a cross build or just a plain native build (for the same computer)?
    • cross
  • what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
    • Void Linux
  • what Python version are you using e.g. 3.8.0
    • 3.9.6
  • what meson --version
    • 0.58.1
  • what ninja --version if it’s a Ninja build
    • 1.10.2

cc @ssssam - the commit author

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dcbakercommented, Jul 18, 2021

We just merged a patch master related to this, can you see if this is still broken in master?

0reactions
paper42commented, Jul 18, 2021

It seems to be fixed now. Thanks everyone!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cross-compilation fails with a meson error about g-ir ... - GitLab
I'm trying to cross-compile a project using nix and it transitively depends on gobject-introspection. The build fails after meson is done ...
Read more >
GNOME module - The Meson Build system
GNOME module. This module provides helper tools for build operations needed when building Gnome/GLib programs. Note: the compilation commands here might not ...
Read more >
737888 – >=gnome-base/librsvg-2.48.8 - fails to cross compile ...
Bug 737888 - >=gnome-base/librsvg-2.48.8 - fails to cross compile with cross-emerge wrappers: error: Error loading target specification.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found