I think something like
85% of it compiles now. I have no idea if it will work though, I could
be off by one in the assmebly somewhere as it will ruin the video. I
read all the background on the transforms being done and the math is not
trivial to say the least. (Made me dig up all my matrix learning from
school again.)
x86_64 uses a completely different (and actually easier) way of dealing
with -fPIC code, you reference everything relative to the %rip register.
Regular 32bit x86 code figures the reloc's out itself, but we have to
specifically tell it how to find the data its looking for.
Most of the 32bit stuff you can just dump straight over once you've got
this sorted out as long as you let gcc know how to send the function
parameters across, i.e. via the stack rather then using registers.
The stuff that catches you out straight away is the push/pop
instructions, you can't do 32 bit stack values, you have to change the
registers to their 64bit counterparts, i.e. rax instead of eax.
If you're interested in this I'd recommend downloading the chipset dev
docs from amd's site, you can get the pdf's for free.
If you want to play, I've put up the source tree that I was working on:
http://www.linuxtr.net/x86_64/xvid_20031115_x86_64.tgz
Be careful playing with configure, I had to manually change some of the
files to make it work. And you'll need to grab a copy of yasm too.
In the meantime, the box is so fast in 32bit mode, I'd just use the
32bit binaries and associated modules and go with that.
Mike