[mythtv] Enabling MMX on MacOS X Intel builds

Todd Ignasiak ignasiak at gmail.com
Thu Mar 23 01:23:20 UTC 2006


On 3/21/06, Todd Ignasiak <ignasiak at gmail.com> wrote:
> The steps for this process are documented here:
> http://www.mythtv.org/wiki/index.php/Myth_on_Mac_x86
>
> I'm getting an "Undefined symbols" error, but I have confirmed that
> the symbols in question are in the code which is being compiled &
> linked.  And, the patch & build process is basically the same as used
> on 0.20 svn, which compiled fine.

Okay, I finally got it to build successfully..  After messing around
with all the oddball options in the apple dev tools ( -flat_namespace,
-undefined suppress, -read_only_relocs warning, etc..)  nothing
worked.     And, changing how and where they were defined didn't help.
  I finally noticed that the commonality among all the symbols was
that they were used with the "MANGLE" macro in the MMX assembly code,
such as:

resample_mmx.c:         "movq "MANGLE(wm1010)", %%mm5   \n\t"
dsputil_mmx.c:        "pmullw "MANGLE(ff_pw_20)", %%mm1 \n\t" /* 20a */\
dsputil_mmx.c:        "pmullw "MANGLE(ff_pw_3)", %%mm3  \n\t" /* 3c - 6b */\
motion_est_mmx.c:        "movq "MANGLE(bone)", %%mm5     \n\t"

The apple tools were getting tripped up on this..  which is odd
because they handled it okay when I compiled the 0.20 SVN code..

After "mangling" them by hand, to eliminate the use of the macro, I
finally got the 0.19-fixes mythfrontend to compule, with MMX, on MacOS
x86.

The MANGLE macro just adds an underscore before the variable name.. such as:
 "movq _wm1010, %%mm5   \n\t"


> g++ -headerpad_max_install_names
> -Wl,-search_paths_first,-read_only_relocs,warning -prebind -dynamiclib
> -single_module -seg1addr 0xC3000000 -compatibility_version     0.19
> -current_version   0.19.0 -install_name   libmythavcodec-0.19.0.dylib
> -o libmythavcodec-0.19.0.19.0.dylib bitstream.o utils.o mem.o
> allcodecs.o mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o mpegaudio.o
> ac3enc.o mjpeg.o audresample.o resample2.o dsputil.o motion_est.o
> imgconvert.o imgresample.o mpeg12.o mpegaudiodec.o pcm.o simple_idct.o
> ratecontrol.o adpcm.o eval.o error_resilience.o fft.o mdct.o raw.o
> golomb.o cabac.o dpcm.o adx.o faandct.o parser.o g726.o vp3dsp.o
> h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o dvdsub.o
> dvbsub.o dvbsubdec.o dvdsubenc.o opt.o lzo.o myth_utils.o aasc.o
> alac.o asv1.o cinepak.o cook.o cljr.o cyuv.o dv.o 8bps.o ffv1.o flac.o
> flicvideo.o 4xm.o fraps.o h261.o h264.o huffyuv.o idcinvideo.o
> indeo2.o indeo3.o interplayvideo.o lcl.o loco.o mace.o msrle.o
> msvideo1.o png.o qdm2.o qdrw.o qpeg.o qtrle.o ra144.o ra288.o
> roqvideo.o rpza.o rv10.o shorten.o smc.o snow.o sonic.o svq1.o
> truemotion1.o truemotion2.o truespeech.o tscc.o cscd.o ulti.o vc9.o
> vcr1.o vmdav.o vorbis.o vp3.o vqavideo.o wmadec.o wnv1.o ws-snd1.o
> xan.o xl.o bmp.o a52dec.o bit_allocate.o a52_bitstream.o downmix.o
> imdct.o parse.o crc.o resample.o fdct_mmx.o cputest.o dsputil_mmx.o
> mpegvideo_mmx.o idct_mmx.o motion_est_mmx.o simple_idct_mmx.o
> fft_sse.o vp3dsp_mmx.o vp3dsp_sse2.o idct_mmx_xvid.o
> -L/Users/tji/Build/19f/.osx-packager/src/qt-mac-free-3.3.6-snapshot-20060321/lib
> -L/usr/lib -L/Users/tji/Build/19f/.osx-packager/build/lib
> -L../libavutil -lmythavutil-0.19 -lz -lqt-mt
> ld: warning -prebind ignored because MACOSX_DEPLOYMENT_TARGET
> environment variable greater or equal to 10.4
> ld: Undefined symbols:
> magicF2W
> wm0101
> wm1010
> wm1100
> ff_pw_20
> ff_pw_3
> bone
> d40000
> /usr/bin/libtool: internal link edit command failed
> make[2]: *** [libmythavcodec-0.19.0.19.0.dylib] Error 1
> make[1]: *** [sub-libavcodec] Error 2
> make: *** [sub-libs] Error 2
> [osx-pkg] Failed system call: " /usr/bin/make " with error code 2
>
>
>
> Notice that the mmx object files are listed in the g++ command, so
> those symbols should be there.  I verified all the MMX definitions
> were correct...
>
> Any suggestions for workarounds, linker options, other similar quirks
> in MacOS X x86?
>


More information about the mythtv-dev mailing list