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 664616 - girscanner dumper.py gives the arguments in wrong order to gcc when not using libtool
girscanner dumper.py gives the arguments in wrong order to gcc when not using...
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-11-23 09:05 UTC by Albert Astals Cid
Modified: 2015-02-07 16:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The said patch (978 bytes, patch)
2011-11-23 09:05 UTC, Albert Astals Cid
accepted-commit_now Details | Review
Updated patch in git am friendly format (1.73 KB, patch)
2011-11-29 18:49 UTC, Albert Astals Cid
none Details | Review

Description Albert Astals Cid 2011-11-23 09:05:50 UTC
Created attachment 201976 [details] [review]
The said patch

When using g-ir-scanner with --no-libtool it creates link command lines like

gcc -o /home/tsdgeos_work/poppler/build/glib/tmp-introspecty1uO45/Poppler-0.18 -L. -Wl,-rpath=. -lpoppler-glib -pthread -lgio-2.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 /home/tsdgeos_work/poppler/build/glib/tmp-introspecty1uO45/Poppler-0.18.o

This is wrong, as according to gcc manual:

**********************
-llibrary
   Search the library named library when linking.

   It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified.  Thus, foo.o -lz bar.o searches library z after file foo.o but before bar.o.  If bar.o refers to functions in z, those functions may not be loaded.
**********************

That is, given that /home/tsdgeos_work/poppler/build/glib/tmp-introspecty1uO45/Poppler-0.18.o is going to depend on all the libs, they should be after the .o, not before.

The attached patch fixes the linking problems i have in Ubuntu 11.10 by moving the addition of the libraries after the addition of the .o files.

I have tested when using libtool and build is unaffected (i.e. still works).
Comment 1 Colin Walters 2011-11-29 15:50:17 UTC
I prefer git format-patch style patches; see:

https://live.gnome.org/GnomeLove/SubmittingPatches
Comment 2 Johan (not receiving bugmail) Dahlin 2011-11-29 15:54:32 UTC
The change could also use some comment explaining why it's moved, preferably in a block of comments.
Comment 3 Colin Walters 2011-11-29 16:12:23 UTC
Review of attachment 201976 [details] [review]:

This patch looks safe; we're just reordering the libraries to be after the .o file.
Comment 4 Albert Astals Cid 2011-11-29 18:49:43 UTC
Created attachment 202389 [details] [review]
Updated patch in git am friendly format
Comment 5 André Klapper 2015-02-07 16:56:06 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]