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 782821 - build failure: undefined reference to symbol 'clutter_stage_view_get_layout'
build failure: undefined reference to symbol 'clutter_stage_view_get_layout'
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 781657 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2017-05-19 07:59 UTC by darkxst
Modified: 2017-05-24 17:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix build failure when linking with --as-needed (935 bytes, patch)
2017-05-20 11:23 UTC, darkxst
none Details | Review
Makefile-tests: ensure we link against libmutter-clutter (1001 bytes, patch)
2017-05-22 04:42 UTC, Marco Trevisan (Treviño)
none Details | Review
Makefile-tests: ensure we link against libmutter-clutter (998 bytes, patch)
2017-05-22 04:45 UTC, Marco Trevisan (Treviño)
none Details | Review
configure.ac: explicitly set link_all_deplibs=yes (1.05 KB, patch)
2017-05-22 06:04 UTC, Marco Trevisan (Treviño)
committed Details | Review

Description darkxst 2017-05-19 07:59: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
Comment 1 darkxst 2017-05-20 11:23:17 UTC
Created attachment 352219 [details] [review]
Fix build failure when linking with --as-needed
Comment 2 Marco Trevisan (Treviño) 2017-05-22 04:42:05 UTC
Created attachment 352333 [details] [review]
Makefile-tests: ensure we link against libmutter-clutter
Comment 3 Marco Trevisan (Treviño) 2017-05-22 04:43:21 UTC
I'm getting the same in jhbuild here... And I used the very same fix.

Attaching my patch here as I kept things multiline.
Comment 4 Marco Trevisan (Treviño) 2017-05-22 04:45:12 UTC
Created attachment 352334 [details] [review]
Makefile-tests: ensure we link against libmutter-clutter
Comment 5 Marco Trevisan (Treviño) 2017-05-22 06:04:16 UTC
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.
Comment 6 Jonas Ådahl 2017-05-22 06:06:46 UTC
Review of attachment 352336 [details] [review]:

Thanks for tracking this down. lgtm.
Comment 7 Marco Trevisan (Treviño) 2017-05-22 06:08:19 UTC
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 8 Jonas Ådahl 2017-05-22 06:59:14 UTC
Comment on attachment 352336 [details] [review]
configure.ac: explicitly set link_all_deplibs=yes

Landed on master, so marking as 'committed'.
Comment 9 Florian Müllner 2017-05-24 17:17:35 UTC
*** Bug 781657 has been marked as a duplicate of this bug. ***