gpt4 book ai didi

xcode4 - 使用 libav* 库在 xcode 4 中构建时出现非法文本重新定位到 non_lazy_ptr 错误

转载 作者:行者123 更新时间:2023-12-02 02:32:56 24 4
gpt4 key购买 nike

我正在尝试构建一个在 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 来解决此问题,但没有任何反应。另一件事:我的 libav* 库是胖二进制文件 (i386 + x86_64)。

有什么想法吗?

最佳答案

我也有同样的错误。最后,我得到了解决方案 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.

关于xcode4 - 使用 libav* 库在 xcode 4 中构建时出现非法文本重新定位到 non_lazy_ptr 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6650178/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com