但链接为独立建立的目标文件

但链接为独立建立的目标文件

本文介绍了为macOS构建,但链接为独立建立的目标文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建ffmpeg,并且几个文件出现以下错误。我不是专门用独立旗帜建立的,所以看不到为什么会这样。实际上是什么意思?有问题吗,还是可忽略的警告?如果有问题,是否有人知道如何解决?

I am building ffmpeg and I get the following error for several files. I am not specifically building with the free standing flag, so cannot see why this is happening. What does it actually mean? Is there a problem with it, or is it an ignorable warning? If there's a problem, does anyone have any idea how to fix it?

Building for macOS, but linking in object file (~/Git/FFmpeg/FFmpegXcode/lib/libavutil.a(imgutils.o)) built for free standing


推荐答案

问题出在FFmpeg构建中的.asm文件上。

The problem is with .asm files in the FFmpeg build.

Apple Clang在目标文件中嵌入了特殊的加载命令,从 -target -mmacosx-version-min 或其他版本获取的目标平台,系统版本和SDK版本

Apple Clang embeds a special load command in the object files with the target platform, system version and SDK version which it takes from -target or -mmacosx-version-min or some similar command line argument.

然后,链接程序将在所有链接的目标文件中检查此类加载命令,并警告其找不到此命令或检测到不兼容。

Linker then checks such load commands in all object files being linked and warns if it couldn't find such command or if it detects incompatibility.

大多数其他编译器都不知道该加载命令,也无法将其输出到目标文件中。至少在YASM中发现了问题(此问题已在本期中体现出来),在D and Go中,。

Most of other compilers don't know about that load command and give no way to output it in the object file. Problems were seen at least in YASM (it manifests in this issue), in D and Go compilers, in Crystal.

不幸的是,我找不到解决方法来为FFmpeg中的asm源构建良好的对象或禁用该警告。我已经为YASM创建了,但这是一个远景-首先,您需要这个YASM中的一项功能,那么您需要一种方法来将所需的参数传递给asm源的FFmpeg构建。

Unfortunately I couldn't find a workaround to build good objects for asm sources in FFmpeg or to disable that warnings. I've created an issue for YASM but this is a long shot - first you need this feature in YASM, then you need a way to pass the required argument to FFmpeg build for the asm sources.

这篇关于为macOS构建,但链接为独立建立的目标文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 05:09