[Theora-dev] patch to build theora-mmx on AMD64

Dan Lenski dlenski at gmail.com
Wed May 3 15:31:45 PDT 2006

On 5/3/06, j at v2v.cc <j at v2v.cc> wrote:
> On Wed, 2006-05-03 at 11:37 -0400, Dan Lenski wrote:
> > I think the old mmx code is needed for x86_32 processors such as
> > Pentium MMX, P2, K62, K63 etc., where there is MMX support but no SSE
> > support.
> its more that if mmx is supported mmx functions are used and
> if mmxext is supported too, some, but not all, functions are replaced
> with faster mmxext functions.
> attached is a version of your patch with ralph's buildsystem changes
> and the missing mmx functions.
> im able to build it with

j, it builds fine as a static lib.  Decoding gives same md5sums, and
encoding passes the eyeball test.

>  ./configure --disable-shared
> otherwise getting an error right now:
> /usr/bin/ld: .libs/libtheora_la-dsp_mmx.o: relocation R_X86_64_32S
> against `a local symbol' can not be used when making a shared object;
> recompile with -fPIC
> .libs/libtheora_la-dsp_mmx.o: could not read symbols: Bad value
> will look into that and apply the patch once i figured that out.

I had the exact same problem.  I found this on Usenet:
It seems that the deal is that PIC and non-PIC code don't play nice on
x86_64, but you can get away w/it on x86_32 (I need easier
abbreviations!!!) so lots of libs have this problem.

I tried to fix this quick and dirty by adding -fPIC -DPIC to
libtheora_la_CFLAGS in lib/Makefile.am, and rebuilding.  That didn't
do it, and on closer inspection I see that libtheora_la-dsp_mmx.o was
ALREADY compiled with -fPIC -DPIC.

Then I checked out the theora trunk and built that, no problems
building a shared lib.  And the Makefile.am's differ only in the
inclusion of the mmx code.

So then I thought maybe the problem was with x86_64/dsp_mmx.c, which
is just a blank file.  So I chopped that out of lib/Makefile.am.  Then
it started giving the same error, but with regards to the recon_mmx

So I'm stumped.  Anyone have experience building shared libs on x86_64?


> thanks, j

More information about the Theora-dev mailing list