GNOME Bugzilla – Bug 636134
deinterlace plugin does not build universal on Mac OS
Last modified: 2013-09-30 20:10:53 UTC
The problem is that you're using configure-time checks for architecture rather than compile-time checks. In addition to the attached patch, you should probably move checks for SIMD out of configure as well using __MMX__ , __SSE__, __SSE2__, __SSE3__, etc --- make -C deinterlace make all-am CC libgstdeinterlace_la-tomsmocomp.lo /bin/sh ../../libtool --silent --tag=CC --tag=disable-static --mode=compile /usr/bin/gcc-4.2 -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I/opt/local/include -D_REENTRANT -I/opt/local/include/gstreamer-0.10 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/libxml2 -D_REENTRANT -I/opt/local/include/gstreamer-0.10 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/libxml2 -I../../gst-libs -D_REENTRANT -I/opt/local/include/gstreamer-0.10 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/libxml2 -DG_THREADS_MANDATORY -DG_DISABLE_CAST_CHECKS -Wall -Wdeclaration-after-statement -Wpointer-arith -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wwrite-strings -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Wno-multichar -Wnested-externs -g -I/opt/local/include/orc-0.4 -O2 -arch x86_64 -arch i386 -c -o libgstdeinterlace_la-tomsmocomp.lo `test -f 'tvtime/tomsmocomp.c' || echo './'`tvtime/tomsmocomp.c /var/tmp//ccdRgmRy.s:11200:bad register name `%rbx' /var/tmp//ccdRgmRy.s:11201:bad register name `%rbx' /var/tmp//ccdRgmRy.s:11202:bad register name `%rcx' /var/tmp//ccdRgmRy.s:11203:bad register name `%rbx)' /var/tmp//ccdRgmRy.s:11204:bad register name `%rbx, %rcx)' /var/tmp//ccdRgmRy.s:11205:bad register name `%rdi' /var/tmp//ccdRgmRy.s:11206:bad register name `%rdi)' /var/tmp//ccdRgmRy.s:11207:bad register name `%rdx' /var/tmp//ccdRgmRy.s:11208:bad register name `%rbx, %rdx)' /var/tmp//ccdRgmRy.s:11209:bad register name `%rsi)' /var/tmp//ccdRgmRy.s:11210:bad register name `%rsi, %rcx)' /var/tmp//ccdRgmRy.s:11211:bad register name `%rdi,%rdx)' /var/tmp//ccdRgmRy.s:11212:bad register name `%rsi' /var/tmp//ccdRgmRy.s:11213:bad register name `%rdi' /var/tmp//ccdRgmRy.s:11214:bad register name `%rdx'
Created attachment 175535 [details] [review] tvtime-universal.patch
Comment on attachment 175535 [details] [review] tvtime-universal.patch please ignore, this is not the correct diff.
Created attachment 175538 [details] [review] universal.patch This patch fixes cpu (and some SIMD) detection. Endian checks should be removed from configure.ac as well.
Erm, no. There are configure time checks for these things for the simple reason that the preprocessor defines are in no way standardized and that you need different checks for different architectures. Instead of removing the configure checks it would be better to improve them to correctly work everywhere. What exactly do you mean by "build universal" btw?
Well, if I'm not mistaken our configure stuff is quite broken in many respects - e.g. for some things we check we assume host system == target or assume if kernel is 64bit user space is 64 bit etc.
"Universal build" means compiling the code for multiple architectures into a single .dylib file. It's a hack that OS/X does to compile for, say, x86_64 and x86, or previously, x86 and powerpc. It's really not possible to do this generically on something as big and complex as GStreamer. Notably, it fails on assembly code. It also fails for things like glibconfig.h, which is a different header on different architectures. Since it is fairly straightforward to combine the .dylib/.so files created by two separate builds (there's a tool on OS/X specifically for this), I have never considered it a reasonable goal to support universal building at the compiler level.
Well your configure time checks are *WRONG* then because they only check one architecture.
Those types of checks should be done at built time rather than configure time. Plenty of other autoconf based projects (pixman, cairo, X.org, ...) do these at build time rather than configure time.
And it doesn't fail on assembly code. You just need to properly #ifdef your code. Closing a bug and ignoring it does not make the problem go away.
True, but it really isn't that hard to do two builds and use lipo. There are lots of examples, e.g. http://adium.im/pipermail/commits_adium.im/2009-August/000835.html gstreamer-sdk does it this way, too.