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 461838 - Fails to build on Mac OS X i686 with multiply defined symbols
Fails to build on Mac OS X i686 with multiply defined symbols
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-python
git master
Other Mac OS
: Normal major
: 0.10.13
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-07-30 15:36 UTC by Brodie Rao
Modified: 2008-06-26 14:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
./configure, without -multiply_defined suppress (5.94 KB, text/plain)
2007-07-30 15:38 UTC, Brodie Rao
  Details
make, without -multiply_defined suppress (21.68 KB, text/plain)
2007-07-30 15:39 UTC, Brodie Rao
  Details
./configure, with -multiply_defined suppress (5.94 KB, text/plain)
2007-07-30 15:39 UTC, Brodie Rao
  Details
make, with -multiply_defined suppress (20.60 KB, text/plain)
2007-07-30 15:39 UTC, Brodie Rao
  Details
Partial fix for build issues on Mac OS X (320 bytes, patch)
2007-12-13 17:07 UTC, Branko Čibej
committed Details | Review
./configure with GStreamer 0.10.14 (6.85 KB, text/plain)
2008-01-20 20:58 UTC, Michael Gardner
  Details
make with GStreamer 0.10.14 (14.52 KB, text/plain)
2008-01-20 21:00 UTC, Michael Gardner
  Details

Description Brodie Rao 2007-07-30 15:36:39 UTC
Using Apple's GCC and MacPort's gstreamer:

$ gcc -v
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5367.obj~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-arch=nocona --with-tune=generic --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5367)

$ port installed
[...]
  gstreamer @0.10.13_0
[...]

building fails with the following:

gcc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/_gst.so -bundle  .libs/_gst_la-gst-argtypes.o .libs/_gst_la-gstmodule.o .libs/_gst_la-pygstiterator.o .libs/_gst_la-pygstminiobject.o .libs/_gst_la-pygstvalue.o .libs/_gst_la-pygstexception.o .libs/_gst_la-gst.o  -L/opt/local/lib /opt/local/lib/libgstcontroller-0.10.dylib /opt/local/lib/libz.dylib /opt/local/lib/libgstnet-0.10.dylib /opt/local/lib/libgstdataprotocol-0.10.dylib /opt/local/lib/libgstbase-0.10.dylib /opt/local/lib/libgstreamer-0.10.dylib /opt/local/lib/libgobject-2.0.dylib /opt/local/lib/libgmodule-2.0.dylib /opt/local/lib/libgthread-2.0.dylib /opt/local/lib/libxml2.dylib -lpthread -lz -lm /opt/local/lib/libglib-2.0.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib
/usr/bin/ld: multiple definitions of symbol _PyGstIterator_Type
.libs/_gst_la-gst-argtypes.o definition of _PyGstIterator_Type in section (__DATA,__common)
.libs/_gst_la-gstmodule.o definition of _PyGstIterator_Type in section (__DATA,__common)
/usr/bin/ld: multiple definitions of symbol __PyGObject_API
.libs/_gst_la-gst-argtypes.o definition of __PyGObject_API in section (__DATA,__common)
.libs/_gst_la-gstmodule.o definition of __PyGObject_API in section (__DATA,__common)
.libs/_gst_la-pygstiterator.o definition of _PyGstIterator_Type in section (__DATA,__data)
.libs/_gst_la-pygstiterator.o definition of __PyGObject_API in section (__DATA,__common)
.libs/_gst_la-pygstminiobject.o definition of _PyGstIterator_Type in section (__DATA,__common)
.libs/_gst_la-pygstminiobject.o definition of __PyGObject_API in section (__DATA,__common)
.libs/_gst_la-pygstvalue.o definition of _PyGstIterator_Type in section (__DATA,__common)
.libs/_gst_la-pygstvalue.o definition of __PyGObject_API in section (__DATA,__common)
.libs/_gst_la-gst.o definition of _PyGstIterator_Type in section (__DATA,__common)
.libs/_gst_la-gst.o definition of __PyGObject_API in section (__DATA,__common)
collect2: ld returned 1 exit status
make[3]: *** [_gst.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

If I add "-multiply_defined suppress" to LDFLAGS, building fails with the following:

gcc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/_gst.so -bundle  .libs/_gst_la-gst-argtypes.o .libs/_gst_la-gstmodule.o .libs/_gst_la-pygstiterator.o .libs/_gst_la-pygstminiobject.o .libs/_gst_la-pygstvalue.o .libs/_gst_la-pygstexception.o .libs/_gst_la-gst.o  -L/opt/local/lib /opt/local/lib/libgstcontroller-0.10.dylib /opt/local/lib/libz.dylib /opt/local/lib/libgstnet-0.10.dylib /opt/local/lib/libgstdataprotocol-0.10.dylib /opt/local/lib/libgstbase-0.10.dylib /opt/local/lib/libgstreamer-0.10.dylib /opt/local/lib/libgobject-2.0.dylib /opt/local/lib/libgmodule-2.0.dylib /opt/local/lib/libgthread-2.0.dylib /opt/local/lib/libxml2.dylib -lpthread -lz -lm /opt/local/lib/libglib-2.0.dylib /opt/local/lib/libintl.dylib /opt/local/lib/libiconv.dylib -multiply_defined
i686-apple-darwin8-gcc-4.0.1: .libs/_gst.so: No such file or directory
make[3]: *** [_gst.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I assume a "./configure && make" would suffice to build most libraries, but that doesn't seem to be the case here. I'm not entirely sure if it's an error in gst-python, or an error in how I'm building gst-python.

In any case, I'll attach logs for "./configure" and "make", for both with and without using "-multiply_defined suppress"

Also, this is with gst-python-0.10.7, but the exact same errors occur with the version in CVS -- if I let it build despite compiler warnings, that is.
Comment 1 Brodie Rao 2007-07-30 15:38:36 UTC
Created attachment 92716 [details]
./configure, without -multiply_defined suppress
Comment 2 Brodie Rao 2007-07-30 15:39:12 UTC
Created attachment 92717 [details]
make, without -multiply_defined suppress
Comment 3 Brodie Rao 2007-07-30 15:39:40 UTC
Created attachment 92718 [details]
./configure, with -multiply_defined suppress
Comment 4 Brodie Rao 2007-07-30 15:39:58 UTC
Created attachment 92719 [details]
make, with -multiply_defined suppress
Comment 5 nex 2007-09-08 16:15:02 UTC
If you look at the configure script, you'll see that how it treats multiply defined symbols depends on the environment variable MACOSX_DEPLOYMENT_TARGET. Try setting that to 10.2 or 10.3. If it isn't set, you can end up with configure assuming an inappropriate default value there.
Comment 6 Branko Čibej 2007-12-13 17:05:13 UTC
I can confirm the same thing happens with gst-python 0.10.9 built against gstreamer 0.10.15, the latter built from stock sources (not a MacPort).

I can solve the multiple references to PyGstIterator_Type with a simple patch (attached), that symbol really is defined multiple times and the build probably works on ELF targets only because of some libtool magic.
Comment 7 Branko Čibej 2007-12-13 17:07:52 UTC
Created attachment 100897 [details] [review]
Partial fix for build issues on Mac OS X
Comment 8 Michael Gardner 2008-01-20 20:50:47 UTC
I can confirm this on Mac OS X 10.5.1, also with GStreamer from MacPorts. The build error is a little different: it only reports __PyGObject_API as a duplicate symbol. Relevant version info:

Mac OS X 10.5.1
GCC 4.0.1 (Apple Inc. build 5465)
Python 2.5.1_4+darwin_9 (MacPorts)
GStreamer 0.10.14_0 (MacPorts)

Comment 9 Michael Gardner 2008-01-20 20:58:57 UTC
Created attachment 103278 [details]
./configure with GStreamer 0.10.14

Output of './configure --prefix=/opt/local'
Comment 10 Michael Gardner 2008-01-20 21:00:05 UTC
Created attachment 103279 [details]
make with GStreamer 0.10.14

Output of 'make'
Comment 11 Tim-Philipp Müller 2008-01-20 21:31:37 UTC
> Created an attachment (id=100897) [edit]
> Partial fix for build issues on Mac OS X

I tried this with my uninstalled gstreamer CVS tree (on ubuntu gutsy). Even though this patch looks right, it seems to make one of the unit tests fail. No idea why though (haven't looked into it futher).


Comment 12 Edward Hervey 2008-05-08 14:14:57 UTC
just marking the patch as already commited.
Comment 13 Edward Hervey 2008-06-26 14:57:33 UTC
Tricky one to find but very few lines in the end.

2008-06-26  Edward Hervey  <edward.hervey@collabora.co.uk>

	* gst/common.h:
	* gst/gstmodule.c:
	* gst/interfaces.override:
	* gst/pbutils.override:
	* gst/pygstiterator.c:
	* gst/pygstminiobject.c:
	* gst/pygstminiobject.h:
	Fix double-import issues on macosx.
	Fixes #461838