-mimplicit,它编译器标志不承认 [英] -mimplicit-it compiler flag not recognized

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

问题描述

我试图编译C ++库的Tegra的TK1。该库链接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]'

和谷歌搜索的位<一个href=\"http://stackoverflow.com/questions/32696870/assembler-messages-error-thumb-conditional-instruction-should-be-in-it-block\">this问题促使我尝试添加 -mimplicit-IT =拇指来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.

我编译与籽粒40年3月10日,圣诞怪杰 - 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-它是<一个href=\"https://www.sourceware.org/binutils/docs/as/ARM-Options.html#index-g_t_0040$c$c_007b_002dmimplicit_002dit_007d-command-line-option_002c-ARM-696\"相对=nofollow>一个选项,以汇编,而不是编译器。因此,在没有在你的makefile具体汇编标志(你可能没有,因为你似乎没有使用一个单独的汇编步骤),你需要使用的 -Wa 选项​​编译通过传递,即 -Wa,-mimplicit-IT =拇指

-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.

问题的根源几乎可以肯定是一些内联汇编 - 可能来自在头文件中的静态内联,如果你真的只连接pre-建库 - 其中包含有条件执行的指令(我要去猜测它有点像 CMPXCHG 实现)。由于您的工具链很可能被配置为编译Thumb指令集 - 的这需要一个preceding (IF-Then)指令设置条件指令 - 默认情况下,另一种选择可能是只是编译 -marm (和/或删除 -mthumb 如果合适的话),并通过不使用拇指都回避这个问题。

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屋!

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