GNOME Bugzilla – Bug 606388
mutter fails to build when using ld with --no-add-needed
Last modified: 2010-02-16 21:33:09 UTC
/usr/bin/ld.bfd: mutter-mag.31673.test: undefined reference to symbol 'rint@@GLIBC_2.0' /usr/bin/ld.bfd: note: 'rint@@GLIBC_2.0' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line /lib/libm.so.6: could not read symbols: Invalid operation *** /usr/bin/ld: ld behavior mismatch! *** *** /usr/bin/ld.bfd succeeeded *** *** /usr/bin/ld.bfd --no-add-needed exits 1 *** *** arguments: --eh-frame-hdr --build-id -m elf_i386 --hash-style=gnu -dynamic-linker /lib/ld-linux.so.2 -o mutter-mag /usr/lib/gcc/i686-redhat-linux/4.4.2/../../../crt1.o /usr/lib/gcc/i686-redhat-linux/4.4.2/../../../crti.o /usr/lib/gcc/i686-redhat-linux/4.4.2/crtbegin.o -L/usr/lib/gcc/i686-redhat-linux/4.4.2 -L/usr/lib/gcc/i686-redhat-linux/4.4.2 -L/usr/lib/gcc/i686-redhat-linux/4.4.2/../../.. mutter-mag.o -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lSM -lICE -lX11 -lXext -lXinerama -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i686-redhat-linux/4.4.2/crtend.o /usr/lib/gcc/i686-redhat-linux/4.4.2/../../../crtn.o collect2: ld returned 1 exit status Obvious fix is to append "-lm" to the end of the linker line in the Makefile, although I'm not sure -lm is portable to all UNIXs. Richard.
Created attachment 152993 [details] [review] new patch, please review This patch fixes the issue. Thanks.
Looks harmless anyways.. thanks for the patch!