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

Paul Sterne make4ppc
Mon Jul 19 05:07:59 CEST 2010


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 reference external symbol ff_cos_tab without a leading
> > underscore.
>
> It does not


> > -- 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.

> 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.

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>

The code generated by gas-preprocessor.pl is attached to this post.
My modified version of gas-preprocessor-debug.pl used to save the generated
output is also attached to this post.

The assembler error messages look like this:

libavcodec/ppc/fft_altivec_s.S:1329:Parameter syntax error (parameter 2)
libavcodec/ppc/fft_altivec_s.S:1329:Invalid mnemonic 'got(r2)'

The lines that cause assembler errors are:

    lwz r6, fft_data at got(r2)

    lwz r12, _ff_cos_tabs at got(r2)

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

--
> M?ns Rullg?rd
> mans at mansr.com
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas-preprocessor-debug.pl
Type: application/octet-stream
Size: 11887 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100718/46073c52/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gas-preprocessed-fft_altivec_s.S
Type: application/octet-stream
Size: 23819 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100718/46073c52/attachment-0001.obj>



More information about the ffmpeg-devel mailing list