2011-07-11 6 views
3

私はXcodeの4内のライブラリ* ffmpegのののLibavを使用する簡単なアプリケーションを構築しようとしていると、次のエラーを取得しています:違法なテキスト再配置*ライブラリ

LD:違法なテキストをi386アーキテクチャ

ため_ff_ac3_bit_alloc_calc_psdで/ffmpeg/temp/ffmpeg-0.8/builduni/lib/libavcodec.a(ac3.oからnon_lazy_ptrする再配置)私はすでにこの問題を解決するためにRANLIB -c libavcodec.aを実行しようとしました問題はあるが、何も起こらない。 もう1つ:私のlibav *ライブラリは、ファットバイナリ(i386 + x86_64)です。

何ができますか?

+0

をhttp://hi-im-shigerello.blogspot.com/2011 /04/transition-mayhem-xcode-4.html しかし、fvisibility = hiddenを追加してもdidn 'help too :( – Oleg

答えて

4

私は同じエラーがあります。最後に、私は他のリンクフラグを追加 http://lists.apple.com/archives/unix-porting/2008/Jan/msg00027.html

で溶液を得た:私はここに同様の問題を発見した

-read_only_relocs suppress 

* EXPLANATION * The two assembly commands load the absolutes address of _trail into R15. Doing so is fine if _trail is ultimately in the same linkage unit. _trail is in libmodule.dylib. For this to work, at runtime the dynamic loader (dyld) would have to rewrite the two instructions. Normally dyld only updates data pointers. One work around is to make libdyalog an archive (e.g. libdyalog.a) and link that with pere.s. Then all the code would be in the same linkage unit, so there would be no need for runtime text relocs. The runtime (dyld) does support text relocs (updating instructions) for i386, but you need to link with -read_only_relocs suppress.