[FFmpeg-devel] Patch for Mac OS X assembly-language support in trunk/libavcodec/fft_altivec_s.S

Måns Rullgård mans
Mon Jul 19 08:30:37 CEST 2010

Paul Sterne <make4ppc at gmail.com> writes:

> 2010/7/18 M?ns Rullg?rd <mans at mansr.com>
>> Don't top-post.
>> Paul Sterne <make4ppc at gmail.com> writes:
>> > The following features of the current fft_altivec_s.S code are
>> > incompatible with Mac OS X:
>> >
>> > -- attempt to load r6 with address of locally defined symbol fft_data
>> > through the global offset table.
>> > -- attempt to load r12 with address of externally defined symbol ff_cos_tabs
>> > through the global offset table.
>> Are you forcing PIC or using ppc64?  I couldn't find a ppc64 osx
>> machine to test on, and 32-bit doesn't use PIC (and hence not the GOT)
>> by default.
> I build for both ppc and ppc64, using --disable-static --enable-shared.
> Shared objects (dynamic libraries) must use PIC for Mac OS X.

Not on 32-bit.  On ppc64 a fix for the got references is of course required.

>> > gas-preprocessor.pl doesn't address these issues, and they can't easily be
>> > addressed by gas-preprocessor.pl because the mach-o binary format requires
>> > section-difference calculations instead of using the global offset table.
>> Can you point me at some documentation for how this should be done?
> I included an extensive explanation of section-difference calculation in my
> first post on this topic.

I want official documentation, not some random ramblings that may or
may not be correct.

> Apple's assembly language reference is here: Apple's
> Assembler<http://developer.apple.com/mac/library/documentation/DeveloperTools/Reference/Assembler/000-Introduction/introduction.html>
> Apple's detailed explanation of their PIC is here:  Mach-O
> dynamic_code<http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/MachOTopics/1-Articles/dynamic_code.html>

Thanks, I'll have a look.

> The code generated by gas-preprocessor.pl is attached to this post.

That really wasn't necessary.  I can generate it myself if I need it.

> My code does not currently support non-PIC references... maybe I
> need to add it.

Please don't try to blame us for your problems.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list