GNOME Bugzilla – Bug 735114
build: fix library linker order
Last modified: 2016-03-31 13:22:07 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.
Created attachment 283986 [details] [review] build: fix library linker order Fixes build with -Wl,--as-needed
*** Bug 735118 has been marked as a duplicate of this bug. ***
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.
Created attachment 284124 [details] [review] Patch wth a reworded commit message Sure - rewording works for me.
Review of attachment 284124 [details] [review]: ack, thanks for fixing!
Comment on attachment 284124 [details] [review] Patch wth a reworded commit message Commited as https://git.gnome.org/browse/gnome-boxes/commit/?id=fcbfa2a1091d4c5e8e14a9927b2e7a5d3e072c0d
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.