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 735114 - build: fix library linker order
build: fix library linker order
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: 3.22
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
: 735118 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-08-20 18:36 UTC by Dominique Leuenberger
Modified: 2016-03-31 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: fix library linker order (892 bytes, patch)
2014-08-20 18:36 UTC, Dominique Leuenberger
needs-work Details | Review
Patch wth a reworded commit message (1007 bytes, patch)
2014-08-21 18:23 UTC, Dominique Leuenberger
committed Details | Review

Description Dominique Leuenberger 2014-08-20 18:36:36 UTC
When building gnome-boxes 3.13.90 with -Wl,--as-needed (as is default in openSUSE for example), the build fails with:

[   35s]   CCLD     gnome-boxes-search-provider
[   35s] libcommon.a(libcommon_a-util.o): In function `___lambda8_':
[   35s] /home/zeenix/checkout/gnome/gnome-boxes/src/util.vala:400: undefined reference to `archive_read_next_header'
[   35s] libcommon.a(libcommon_a-util.o): In function `boxes_execute_libarchive_function':
[   35s] /home/zeenix/checkout/gnome/gnome-boxes/src/util.vala:378: undefined reference to `archive_error_string'
[   35s] /home/zeenix/checkout/gnome/gnome-boxes/src/util.vala:385: undefined reference to `archive_error_string'
[   35s] collect2: error: ld returned 1 exit status
[   35s] Makefile:719: recipe for target 'gnome-boxes-search-provider' failed
[   35s] make[3]: *** [gnome-boxes-search-provider] Error 1
[   35s] make[3]: *** Waiting for unfinished jobs....
[   36s] make[3]: Leaving directory '/home/abuild/rpmbuild/BUILD/gnome-boxes-3.13.90/src'
[   36s] Makefile:573: recipe for target 'all' failed
[   36s] make[2]: *** [all] Error 2
[   36s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/gnome-boxes-3.13.90/src'

libcommon.a references functions from libarchive, so it must be listed before the same in the linker call.
Comment 1 Dominique Leuenberger 2014-08-20 18:36:38 UTC
Created attachment 283986 [details] [review]
build: fix library linker order

Fixes build with -Wl,--as-needed
Comment 2 Lasse Schuirmann 2014-08-21 07:41:59 UTC
*** Bug 735118 has been marked as a duplicate of this bug. ***
Comment 3 Lasse Schuirmann 2014-08-21 10:06:34 UTC
Review of attachment 283986 [details] [review]:

Thanks for fixing bugs I introduced :). Code looks good to me and it still compiles for me. Commit log could be a bit more verbose, I wouldnt be able to understand the change without the previous explanation. How about something like this

build: Fix library linker order

libcommon.a references functions from libarchive, so it must be listed
before the same in the linker call. This fixes build with
-Wl,--as-needed

Would be clearer to me. I'm sure zeenix has a comment on this too.
Comment 4 Dominique Leuenberger 2014-08-21 18:23:13 UTC
Created attachment 284124 [details] [review]
Patch wth a reworded commit message

Sure - rewording works for me.
Comment 5 Lasse Schuirmann 2014-08-21 18:40:09 UTC
Review of attachment 284124 [details] [review]:

ack, thanks for fixing!
Comment 6 Dominique Leuenberger 2014-08-21 18:48:33 UTC
Comment on attachment 284124 [details] [review]
Patch wth a reworded commit message

Commited as https://git.gnome.org/browse/gnome-boxes/commit/?id=fcbfa2a1091d4c5e8e14a9927b2e7a5d3e072c0d
Comment 7 Dominique Leuenberger 2014-08-21 18:48:54 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.