GNOME Bugzilla – Bug 410963
Fails to build with -z defs
Last modified: 2007-02-24 20:16:43 UTC
Hi, /bin/sh ../../libtool --tag=CC --mode=link gcc -Os -Wl,-O1 -Wl,-z,defs -o libgstaudiotestsrc.la -rpath /home/lool/jhbuild-gnome-2.18/prefix/lib/gstreamer-0.10 -module -avoid-version -export-symbols-regex '^_*gst_plugin_desc$' -no-undefined libgstaudiotestsrc_la-gstaudiotestsrc.lo -pthread -L/home/lool/jhbuild-gnome-2.18/prefix/lib -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -ldl -lgthread-2.0 -lrt -lxml2 -lglib-2.0 -pthread -L/home/lool/jhbuild-gnome-2.18/prefix/lib -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -ldl -lgthread-2.0 -lrt -lxml2 -lglib-2.0 -pthread -L/home/lool/jhbuild-gnome-2.18/prefix/lib -lgstcontroller-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -ldl -lgthread-2.0 -lrt -lxml2 -lglib-2.0 rm -fr .libs/libgstaudiotestsrc.exp .libs/libgstaudiotestsrc.ver generating symbol list for `libgstaudiotestsrc.la' /usr/bin/nm -B .libs/libgstaudiotestsrc_la-gstaudiotestsrc.o | sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | /bin/sed 's/.* //' | sort | uniq > .libs/libgstaudiotestsrc.exp /bin/grep -E -e "^_*gst_plugin_desc$" ".libs/libgstaudiotestsrc.exp" > ".libs/libgstaudiotestsrc.expT" mv -f ".libs/libgstaudiotestsrc.expT" ".libs/libgstaudiotestsrc.exp" echo "{ global:" > .libs/libgstaudiotestsrc.ver cat .libs/libgstaudiotestsrc.exp | sed -e "s/\(.*\)/\1;/" >> .libs/libgstaudiotestsrc.ver echo "local: *; };" >> .libs/libgstaudiotestsrc.ver gcc -shared .libs/libgstaudiotestsrc_la-gstaudiotestsrc.o -Wl,--rpath -Wl,/home/lool/jhbuild-gnome-2.18/prefix/lib -Wl,--rpath -Wl,/home/lool/jhbuild-gnome-2.18/prefix/lib -L/home/lool/jhbuild-gnome-2.18/prefix/lib /home/lool/jhbuild-gnome-2.18/prefix/lib/libgstbase-0.10.so /home/lool/jhbuild-gnome-2.18/prefix/lib/libgstcontroller-0.10.so /home/lool/jhbuild-gnome-2.18/prefix/lib/libgstreamer-0.10.so /home/lool/jhbuild-gnome-2.18/prefix/lib/libgobject-2.0.so /home/lool/jhbuild-gnome-2.18/prefix/lib/libgmodule-2.0.so -ldl /home/lool/jhbuild-gnome-2.18/prefix/lib/libgthread-2.0.so -lrt /home/lool/jhbuild-gnome-2.18/prefix/lib/libxml2.so /home/lool/jhbuild-gnome-2.18/prefix/lib/libglib-2.0.so -Wl,-O1 -Wl,-z -Wl,defs -pthread -pthread -pthread -Wl,-soname -Wl,libgstaudiotestsrc.so -Wl,-version-script -Wl,.libs/libgstaudiotestsrc.ver -o .libs/libgstaudiotestsrc.so .libs/libgstaudiotestsrc_la-gstaudiotestsrc.o: In function `gst_audio_test_src_init_sine_table': /home/lool/jhbuild-gnome-2.18/checkout/gst-plugins-base/gst/audiotestsrc/gstaudiotestsrc.c:500: undefined reference to `sin' .libs/libgstaudiotestsrc_la-gstaudiotestsrc.o: In function `gst_audio_test_src_create_sine': /home/lool/jhbuild-gnome-2.18/checkout/gst-plugins-base/gst/audiotestsrc/gstaudiotestsrc.c:324: undefined reference to `sin' collect2: ld returned 1 exit status make[3]: *** [libgstaudiotestsrc.la] Erreur 1 make[3]: quittant le répertoire « /home/lool/jhbuild-gnome-2.18/checkout/gst-plugins-base/gst/audiotestsrc » make[2]: *** [all-recursive] Erreur 1 make[2]: quittant le répertoire « /home/lool/jhbuild-gnome-2.18/checkout/gst-plugins-base/gst » You might want to call AC_CHECK_LIBM in configure.ac. Bye,
Created attachment 83126 [details] [review] Link with libm and use AC_ISC_POSIX Here's a patch correctly adding libm here; it also uglily tries to add support for AC_ISC_POSIX which had a FIXME in the same chunk, but feel free to strip that part.
Created attachment 83128 [details] [review] Fix alsa link flags Build subsequently fails with: /bin/sh ../../libtool --tag=CC --mode=link gcc -Os -Wl,-O1 -Wl,-z,defs -o libgstalsa.la -rpath /home/lool/jhbuild-gnome-2.18/prefix/lib/gstreamer-0.10 -module -avoid-version -export-symbols-regex '^_*gst_plugin_desc$' -no-undefined libgstalsa_la-gstalsadeviceprobe.lo libgstalsa_la-gstalsamixer.lo libgstalsa_la-gstalsamixerelement.lo libgstalsa_la-gstalsamixertrack.lo libgstalsa_la-gstalsamixeroptions.lo libgstalsa_la-gstalsaplugin.lo libgstalsa_la-gstalsasink.lo libgstalsa_la-gstalsasrc.lo libgstalsa_la-gstalsa.lo -lasound -lm -ldl -lpthread ../../gst-libs/gst/interfaces/libgstinterfaces-0.10.la ../../gst-libs/gst/audio/libgstaudio-0.10.la rm -fr .libs/libgstalsa.exp .libs/libgstalsa.ver generating symbol list for `libgstalsa.la' /usr/bin/nm -B .libs/libgstalsa_la-gstalsadeviceprobe.o .libs/libgstalsa_la-gstalsamixer.o .libs/libgstalsa_la-gstalsamixerelement.o .libs/libgstalsa_la-gstalsamixertrack.o .libs/libgstalsa_la-gstalsamixeroptions.o .libs/libgstalsa_la-gstalsaplugin.o .libs/libgstalsa_la-gstalsasink.o .libs/libgstalsa_la-gstalsasrc.o .libs/libgstalsa_la-gstalsa.o | sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | /bin/sed 's/.* //' | sort | uniq > .libs/libgstalsa.exp /bin/grep -E -e "^_*gst_plugin_desc$" ".libs/libgstalsa.exp" > ".libs/libgstalsa.expT" mv -f ".libs/libgstalsa.expT" ".libs/libgstalsa.exp" echo "{ global:" > .libs/libgstalsa.ver cat .libs/libgstalsa.exp | sed -e "s/\(.*\)/\1;/" >> .libs/libgstalsa.ver echo "local: *; };" >> .libs/libgstalsa.ver gcc -shared .libs/libgstalsa_la-gstalsadeviceprobe.o .libs/libgstalsa_la-gstalsamixer.o .libs/libgstalsa_la-gstalsamixerelement.o .libs/libgstalsa_la-gstalsamixertrack.o .libs/libgstalsa_la-gstalsamixeroptions.o .libs/libgstalsa_la-gstalsaplugin.o .libs/libgstalsa_la-gstalsasink.o .libs/libgstalsa_la-gstalsasrc.o .libs/libgstalsa_la-gstalsa.o -Wl,--rpath -Wl,/home/lool/jhbuild-gnome-2.18/checkout/gst-plugins-base/gst-libs/gst/interfaces/.libs -Wl,--rpath -Wl,/home/lool/jhbuild-gnome-2.18/checkout/gst-plugins-base/gst-libs/gst/audio/.libs -Wl,--rpath -Wl,/home/lool/jhbuild-gnome-2.18/prefix/lib /usr/lib/libasound.so -lm -ldl -lpthread ../../gst-libs/gst/interfaces/.libs/libgstinterfaces-0.10.so ../../gst-libs/gst/audio/.libs/libgstaudio-0.10.so -Wl,-O1 -Wl,-z -Wl,defs -Wl,-soname -Wl,libgstalsa.so -Wl,-version-script -Wl,.libs/libgstalsa.ver -o .libs/libgstalsa.so .libs/libgstalsa_la-gstalsadeviceprobe.o: In function `gst_alsa_type_add_device_property_probe_interface': /home/lool/jhbuild-gnome-2.18/checkout/gst-plugins-base/ext/alsa/gstalsadeviceprobe.c:203: undefined reference to `g_type_add_interface_static' .libs/libgstalsa_la-gstalsadeviceprobe.o: In function `gst_alsa_device_property_probe_probe_property': /home/lool/jhbuild-gnome-2.18/checkout/gst-plugins-base/ext/alsa/gstalsadeviceprobe.c:121: undefined reference to `g_str_equal' /home/lool/jhbuild-gnome-2.18/checkout/gst-plugins-base/ext/alsa/gstalsadeviceprobe.c:122: undefined reference to `g_type_name' /home/lool/jhbuild-gnome-2.18/checkout/gst-plugins-base/ext/alsa/gstalsadeviceprobe.c:122: undefined reference to `g_type_name' /home/lool/jhbuild-gnome-2.18/checkout/gst-plugins-base/ext/alsa/gstalsadeviceprobe.c:122: undefined reference to `g_log' Attached patch adds missing glib and other link flags, I think the GPB link flags were simply forgotten in ALSA (the GST flags don't seem necessary though so I didn't add them).
Thanks for the patches, committed them with minor changes: 2007-02-24 Tim-Philipp Müller <tim at centricular dot net> Patch by: Loïc Minier <lool+gnome at via ecp fr> * configure.ac: * ext/alsa/Makefile.am: * gst/audiotestsrc/Makefile.am: Fix compilation with LDFLAGS='-Wl,-z,defs' (#410963). Didn't commit the AC_ISC_POSIX bit, since it's rather ugly (and no one has complained about anything in particular not working, so I'd prefer not to touch it).