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 755428 - [PATCH] explicitly link to all required libraries to avoid failure
[PATCH] explicitly link to all required libraries to avoid failure
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: gcalctool maintainers
gcalctool maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-22 17:21 UTC by Andreas Henriksson
Modified: 2015-10-20 11:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix linking problems (1.01 KB, patch)
2015-09-22 17:21 UTC, Andreas Henriksson
committed Details | Review

Description Andreas Henriksson 2015-09-22 17:21:02 UTC
Created attachment 311892 [details] [review]
fix linking problems

Hello.

While updating the gnome-calculator packages on Debian to 3.18.0 I ran into issues with linking the program... For example:

[...]
libtool: link: gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wl,-z -Wl,relro -Wl,-z -Wl,defs -Wl,-O1 -Wl,--as-needed -o .libs/gnome-calculator gnome_calculator-gnome-calculator.o gnome_calculator-math-buttons.o gnome_calculator-math-converter.o gnome_calculator-math-display.o gnome_calculator-math-preferences.o gnome_calculator-math-variable-popup.o gnome_calculator-math-window.o gnome_calculator-math-function-popup.o gnome_calculator-math-history.o gnome_calculator-resources.o -Wl,--export-dynamic -pthread  -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 ../lib/.libs/libcalculator.so -pthread -Wl,-rpath -Wl,/usr/lib/gnome-calculator
/usr/bin/ld: gnome_calculator-math-display.o: undefined reference to symbol 'gtk_source_completion_provider_get_type'
//usr/lib/x86_64-linux-gnu/libgtksourceview-3.0.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
[...]

(After fixing that, there was also a problem with gcalccmd referencing g_object_unref without linking to gobject-2.0.)

The attached patch fixes the build for me.
Comment 1 Alberto Ruiz 2015-10-19 11:55:14 UTC
Patch looks fine but I would not call that variable GCALCCMD instead I would call it GOBJECT.
Comment 2 Andreas Henriksson 2015-10-20 11:31:40 UTC
(In reply to Alberto Ruiz from comment #1)
> Patch looks fine but I would not call that variable GCALCCMD instead I would
> call it GOBJECT.

Not sure why you think GOBJECT is a better name for gcalccmds dependencies. It would be pretty inconsistent with everything else in configure.ac/Makefile.am, eg. gnome_calculator -> GNOME_CALCULATOR. But feel free to go with whatever name you feel is right! Thanks for looking into this bug report!
Comment 3 Alberto Ruiz 2015-10-20 11:47:09 UTC
(In reply to Andreas Henriksson from comment #2)
> (In reply to Alberto Ruiz from comment #1)
> > Patch looks fine but I would not call that variable GCALCCMD instead I would
> > call it GOBJECT.
> 
> Not sure why you think GOBJECT is a better name for gcalccmds dependencies.
> It would be pretty inconsistent with everything else in
> configure.ac/Makefile.am, eg. gnome_calculator -> GNOME_CALCULATOR. But feel
> free to go with whatever name you feel is right! Thanks for looking into
> this bug report!

Good point. The convention in other modules is to use separate variables per each module, I didn't notice we're not doing this here so yes your patch is consistent.

Patch has been pushed to master and backported to the 3.18 branch.
Comment 4 Alberto Ruiz 2015-10-20 11:47:26 UTC
Review of attachment 311892 [details] [review]:

Looks good.