-mimplicit-it 编译器标志无法识别 [英] -mimplicit-it compiler flag not recognized

查看:102
本文介绍了-mimplicit-it 编译器标志无法识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为 Tegra TK1 编译 C++ 库.该库链接到我使用包管理器提取的 TBB.在编译过程中出现以下错误

I am attempting to compile a C++ library for a Tegra TK1. The library links to TBB, which I pulled using the package manager. During compilation I got the following error

/tmp/cc4iLbKz.s: Assembler messages:
/tmp/cc4iLbKz.s:9541: Error: thumb conditional instruction should be in IT block -- `strexeq r2,r3,[r4]'

有点谷歌搜索和这个问题 引导我尝试将 -mimplicit-it=thumb 添加到 CMAKE_CXX_FLAGS,但编译器无法识别.

A bit of googling and this question led me to try adding -mimplicit-it=thumb to CMAKE_CXX_FLAGS, but the compiler doesn't recognize it.

我正在使用内核 3.10.40-grinch-21.3.4 在 tegra 上进行编译,并使用 gcc 4.8.4 编译器(这是我键入 c++ -v 时返回的内容)

I am compiling on the tegra with kernal 3.10.40-grinch-21.3.4, and using gcc 4.8.4 compiler (thats what comes back when I type c++ -v)

我不确定最初的错误消息是什么意思,但我认为它与 TBB 链接库有关,而不是我正在编译的源.修复的问题也很神秘.任何人都可以对此有所了解吗?

I'm not sure what the initial error message means, though I think it has something to do with the TBB linked library rather than the source I'm compiling. The problem with the fix is also mysterious. Can anyone shed some light on this?

推荐答案

-mimplicit-it汇编器的选项,而不是编译器.因此,如果你的 makefile 中没有特定的汇编器标志(你可能没有,因为你似乎没有使用单独的汇编器步骤),你需要使用 编译器的-Wa 选项 传递它,即 -Wa,-mimplicit-it=thumb.

-mimplicit-it is an option to the assembler, not to the compiler. Thus, in the absence of specific assembler flags in your makefile (which you probably don't have, given that you don't appear to be using a separate assembler step), you'll need to use the -Wa option to the compiler to pass it through, i.e. -Wa,-mimplicit-it=thumb.

问题的根源几乎肯定是一些内联程序集——可能来自头文件中的静态内联,如果你真的只是链接预建库——其中包含有条件执行的指令(我猜它是类似于 cmpxchg 实现).由于您的工具链可以很好地配置为编译到 Thumb 指令集 - 这需要前面的 it (If-Then) 指令来设置条件指令 - 默认情况下,另一种选择可能是使用 -marm 进行编译(和/或删除 -mthumb 如果合适)并通过完全不使用 Thumb 来回避问题.

The source of the issue is almost certainly some inline assembly - possibly from a static inline in a header file if you're really only linking pre-built libraries - which contains conditionally-executed instructions (I'm going to guess its something like a cmpxchg implementation). Since your toolchain could well be configured to compile to the Thumb instruction set - which requires a preceding it (If-Then) instruction to set up conditional instructions - by default, another alternative might be to just compile with -marm (and/or remove -mthumb if appropriate) and sidestep the issue by not using Thumb at all.

这篇关于-mimplicit-it 编译器标志无法识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆