简体   繁体   English

-mimplicit-it 编译器标志无法识别

[英]-mimplicit-it compiler flag not recognized

I am attempting to compile a C++ library for a Tegra TK1.我正在尝试为 Tegra TK1 编译 C++ 库。 The library links to TBB, which I pulled using the package manager.该库链接到我使用包管理器拉取的 TBB。 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]'

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.有点谷歌搜索, 这个问题使我尝试将-mimplicit-it=thumb添加到 CMAKE_CXX_FLAGS,但编译器无法识别它。

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)我正在使用内核 3.10.40-grinch-21.3.4 在 tegra 上编译,并使用 gcc 4.8.4 编译器(这是我输入 c++ -v 时返回的内容)

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.我不确定最初的错误消息是什么意思,但我认为它与 TBB 链接库而不是我正在编译的源有关。 The problem with the fix is also mysterious.修复的问题也很神秘。 Can anyone shed some light on this?任何人都可以对此有所了解吗?

-mimplicit-it is an option to the assembler , not to the compiler. -mimplicit-itassembler 的一个选项,而不是编译器。 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, ie -Wa,-mimplicit-it=thumb .因此,如果您的 makefile 中没有特定的汇编程序标志(您可能没有,因为您似乎没有使用单独的汇编程序步骤),您需要对编译器使用-Wa选项传递它,即-Wa,-mimplicit-it=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).问题的根源几乎可以肯定是一些内联程序集——可能来自头文件中的静态内联,如果你真的只是链接预建库——它包含有条件执行的指令(我猜它像cmpxchg实现)。 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.由于您的工具链可以很好地配置为编译为 Thumb 指令集 - 这需要一个前面的it (If-Then) 指令来设置条件指令- 默认情况下,另一种选择可能是使用-marm编译(和/或删除-mthumb如果合适)并通过根本不使用 Thumb 来回避问题。

Adding compiler option:添加编译器选项:

-wa -wa

should solve the problem.应该可以解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM