After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787578 - Can't compile gnome-builder if gdlib installed
Can't compile gnome-builder if gdlib installed
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: libide
3.26.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-09-12 09:29 UTC by Jura
Modified: 2017-11-19 21:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build.log (911.88 KB, text/x-log)
2017-09-12 09:29 UTC, Jura
  Details
build: tweak dependency ordering (2.22 KB, patch)
2017-11-09 08:21 UTC, Christian Hergert
committed Details | Review
build: vendor GdTaggedEntry as IdeTaggedEntry (58.91 KB, patch)
2017-11-19 21:57 UTC, Christian Hergert
committed Details | Review

Description Jura 2017-09-12 09:29:52 UTC
Created attachment 359588 [details]
build.log

g-ir-scanner: link: cc -o /var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/tmp-introspectwnrq0_90/Ide-1.0 -O2 -pipe -march=native -finline-functions -fomit-frame-pointer /var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/tmp-introspectwnrq0_90/Ide-1.0.o -L. -Wl,-rpath,. -Wl,--no-as-needed -lgd -lide-1.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lgtksourceview-3.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpeas-1.0 -lgmodule-2.0 -lgirepository-1.0 -ldazzle-1.0 -ltemplate_glib-1.0 -lxml2 -ljson-glib-1.0 -ljsonrpc_glib-1.0 -lwebkit2gtk-4.0 -lsoup-2.4 -ljavascriptcoregtk-4.0 -lm -L/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/libide -Wl,-rpath,/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/libide -L/usr/lib64/ -Wl,-rpath,/usr/lib64/ -L/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/subprojects/libgd/libgd -Wl,-rpath,/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/subprojects/libgd/libgd -L/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/libide -Wl,-rpath,/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/libide -L/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/subprojects/libgd/libgd -Wl,-rpath,/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/subprojects/libgd/libgd -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -Wl,-O1 -Wl,--as-needed
/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/libide/libide-1.0.so: undefined reference to `gd_tagged_entry_tag_set_style'
/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/libide/libide-1.0.so: undefined reference to `gd_tagged_entry_tag_set_label'
/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/libide/libide-1.0.so: undefined reference to `gd_tagged_entry_add_tag'
/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/libide/libide-1.0.so: undefined reference to `gd_tagged_entry_tag_new'
/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/libide/libide-1.0.so: undefined reference to `gd_tagged_entry_get_type'
/var/tmp/portage/gnome-extra/gnome-builder-3.26.0/work/gnome-builder-3.26.0-build/libide/libide-1.0.so: undefined reference to `gd_tagged_entry_remove_tag'
collect2: error: ld returned 1 exit status
Comment 1 Christian Hergert 2017-09-12 10:58:38 UTC
I wonder if it is related to https://github.com/mesonbuild/meson/issues/1181

Our build congiguration for this isn't that fancy:

  https://git.gnome.org/browse/gnome-builder/tree/libide/meson.build#n774
Comment 2 Christian Hergert 2017-09-12 23:26:33 UTC
Can you update your meson version to 0.42 and see if this is resovled? (You'll need to wipe your old build directory and recreate it).
Comment 3 Jura 2017-09-13 08:43:53 UTC
I compiled gnome-shell with meson-0.42.0
Comment 4 Jura 2017-09-13 08:46:57 UTC
*I compiled gnome and gnome-builder with meson-0.42.0
Comment 5 Jura 2017-09-13 08:47:48 UTC
After remove system gd gnome-builder compile successful
Comment 6 Jura 2017-09-13 09:55:02 UTC
Same problem with meson-0.42.1
Comment 7 Christian Hergert 2017-09-13 10:39:34 UTC
libgd certainly isn't intended to be installed system-wide. It's a library meant to be cribbed by projects and statically linked.

That said, there might be something that meson can do to help avoid the linker ordering issue, but I'm not sure that is something we can do much about on our side.
Comment 8 Nirbheek Chauhan 2017-09-13 17:36:52 UTC
(In reply to Christian Hergert from comment #7)
> libgd certainly isn't intended to be installed system-wide. It's a library
> meant to be cribbed by projects and statically linked.
> 
> That said, there might be something that meson can do to help avoid the
> linker ordering issue, but I'm not sure that is something we can do much
> about on our side.

FWIW this is not about libgd the copylib but libgd the graphics library: https://libgd.github.io/

The reason why only Gentoo users see this is because no other distro installs development files by default.
Comment 9 Antoine Jacoutot 2017-11-09 07:06:43 UTC
> The reason why only Gentoo users see this is because no other distro
> installs development files by default.

We see the same issue on BSDs. Building gnome-builder does not work if the libgd graphic library is installed on the system.
Comment 10 Christian Hergert 2017-11-09 08:21:14 UTC
Created attachment 363278 [details] [review]
build: tweak dependency ordering

In hopes that we increase our chances for proper paths into the
private directory before loading libgd from the public library
paths loaded from system libraries.
Comment 11 Christian Hergert 2017-11-09 08:22:25 UTC
Comment on attachment 363278 [details] [review]
build: tweak dependency ordering

If meson is altering the order, there isn't much more we can do. But this will
put libgd first in the list in hopes that we get it before the directories
containing other libraries are loaded with -L.

Attachment 363278 [details] pushed as 134b52a - build: tweak dependency ordering
Comment 12 Antoine Jacoutot 2017-11-09 09:00:36 UTC
Thanks for the patch Christian, unfortunately it doesn't seem to help :-/
Comment 13 Antoine Jacoutot 2017-11-09 09:15:20 UTC
As a workaround for the time being, prepending:
-L${PATH_TO_BUILDIR}/subprojects/libgd/libgd
to LDFLAGS seems to work fine.
Comment 14 Christian Hergert 2017-11-19 21:57:12 UTC
Created attachment 364014 [details] [review]
build: vendor GdTaggedEntry as IdeTaggedEntry

We were having a number of issues compiling on systems where libgd is
installed (and not the, typically static, libgd from GNOME). We only use
one widget from there anyway, which doesn't really change. So instead, we
can just vendor it and namespace it into libide. This also reduces the
number of private shared libraries we load by one.

Namespace was changed, and availability macros added using the tool at
https://github.com/chergert/add-availability-macros.
Comment 15 Christian Hergert 2017-11-19 21:58:07 UTC
This should work around the issue with libgd by just vendoring the one thing we
use into libide.

Attachment 364014 [details] pushed as d5b8677 - build: vendor GdTaggedEntry as IdeTaggedEntry