! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfwm4 should add -lm when using composite
Status:
CLOSED: FIXED

Comments

Description Kevin Fenzi 2010-02-13 22:12:36 CET
xfwm4 should link to -lm when using composite, as it needs a symbol from there. 

This currently works fine, but newer linkers will complain about this. 
It's also good practice as if composite stops depending on libm it would leave xfwm4 not working. 

See: 
https://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking

Small patch to fix this (Although you likely want to change it in Makefile.am or the like): 

diff -Nur xfwm4-4.6.1.orig/src/Makefile.in xfwm4-4.6.1/src/Makefile.in
--- xfwm4-4.6.1.orig/src/Makefile.in	2009-04-15 01:59:55.000000000 -0600
+++ xfwm4-4.6.1/src/Makefile.in	2010-02-13 14:29:19.000000000 -0700
@@ -107,7 +107,7 @@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
 COMPOSITOR_CFLAGS = @COMPOSITOR_CFLAGS@
-COMPOSITOR_LIBS = @COMPOSITOR_LIBS@
+COMPOSITOR_LIBS = @COMPOSITOR_LIBS@ -lm
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CYGPATH_W = @CYGPATH_W@
Comment 1 Olivier Fourdan editbugs 2010-02-17 12:28:43 CET
Can you point me in what symbol used in xfwm4 compositor comes from libm?

I suspect the requirement for libm comes instead from one of the libs that in which case -lm should be added in the LDFLAGS from the corresponding lib, and not in xfwm4.

But I could be wrong, I might be missing the symbol used in my code which needs libm.
Comment 2 Kevin Fenzi 2010-02-17 16:40:12 CET
Sorry, I meant to include the symbol in any of these reports, but I failed here. ;( 

/usr/bin/ld: xfwm4-compositor.o: undefined reference to symbol 'exp@@GLIBC_2.2.5'
/usr/bin/ld: note: 'exp@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line

So, it looks like the compositor is using 'exp'.
Comment 3 Olivier Fourdan editbugs 2010-02-17 17:21:23 CET
(In reply to comment #2)
> So, it looks like the compositor is using 'exp'.

Oh yeah, right, that's exp(). thanks!
Comment 4 Mike Massonnet editbugs 2010-04-10 16:56:30 CEST
I builded latest git fine with -Wl,--no-add-needed.

Bug #6231

Reported by:
Kevin Fenzi
Reported on: 2010-02-13
Last modified on: 2011-11-11

People

Assignee:
Olivier Fourdan
CC List:
1 user

Version

Attachments

Additional information