GNOME Bugzilla – Bug 782821
build failure: undefined reference to symbol 'clutter_stage_view_get_layout'
Last modified: 2017-05-24 17:17:35 UTC
This is likely due to Ubuntu linking with --as-needed. /usr/bin/ld: tests/monitor-unit-tests.o: undefined reference to symbol 'clutter_stage_view_get_layout' //home/darkness/.cache/jhbuild/build/mutter/clutter/clutter/.libs/libmutter-clutter-0.so: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status GISCAN Meta-0.gir Makefile:1965: recipe for target 'mutter-test-unit-tests' failed
Created attachment 352219 [details] [review] Fix build failure when linking with --as-needed
Created attachment 352333 [details] [review] Makefile-tests: ensure we link against libmutter-clutter
I'm getting the same in jhbuild here... And I used the very same fix. Attaching my patch here as I kept things multiline.
Created attachment 352334 [details] [review] Makefile-tests: ensure we link against libmutter-clutter
Created attachment 352336 [details] [review] configure.ac: explicitly set link_all_deplibs=yes Some distros such as Ubuntu and Debian set it to 'no', while others might keep it to 'unknown' (which defaults to 'yes'). And this causes troubles when linking with mutter-clutter in some tests.
Review of attachment 352336 [details] [review]: Thanks for tracking this down. lgtm.
Ok, so the cause of this is not --as-needed, but the fact that libtool's default value for link_all_deplibs is 'no' in debian and Ubuntu. As per discussion with Jonas, we default this to 'yes', to avoid such errors also in other distros that have this or to ensure that the current 'unknown' in others (currently falling back to 'yes') won't cause troubles in future.
Comment on attachment 352336 [details] [review] configure.ac: explicitly set link_all_deplibs=yes Landed on master, so marking as 'committed'.
*** Bug 781657 has been marked as a duplicate of this bug. ***