简体   繁体   English

Android NDK工具链内部编译器错误

[英]Android NDK toolchain internal compiler error

I'm trying to use the NDK toolchain to build some native library I have for ARM. 我正在尝试使用NDK工具链来为ARM建立一些本机库。 I'm also using the ARMv7 NEON intrinsics in part of my code. 我还在代码的一部分中使用了ARMv7 NEON内部函数。 Unfortunately I get the following type of error in several places in my code: 不幸的是,我的代码在多个地方出现了以下类型的错误:

internal compiler error: in write_builtin_type, at cp/mangle.c:1855

The error seems to be triggered by using the float32_t type defined in the arm_neon.h - eg I get the compiler crash when using a std::vector<float32_t> . 该错误似乎通过触发float32_t在定义类型arm_neon.h -例如,我使用的时候让编译器崩溃std::vector<float32_t>

For Android ARM the single precision floating point type is a typedef for an internal compiler builtin type whereas for Linaro Linux for example is just a typedef of the C/C++ float - see arm_neon.h in the case of both compilers(I can build the same sources with the Linaro Linux toolchain without any problem). 对于Android ARM,单精度浮点类型是内部编译器内置类型的typedef,而对于Linaro Linux,例如,仅是C / C ++ float的arm_neon.h对于两个编译器,请参见arm_neon.h (我可以构建与Linaro Linux工具链完全相同的来源)。

I also found an old post in the android NDK Google group that seems to describe the same problem but unfortunately it did not present any solution: Some old post describing the same compiler crash 我还在android NDK Google组中找到了一篇老文章,似乎描述了相同的问题,但不幸的是,它没有提出任何解决方案: 一些描述同一个编译器崩溃的老文章

Does anyone have any hint on how to overcome the above problem? 有没有人对如何克服上述问题有任何暗示? Is there any special reason a builtin compiler type is used and not the normal float as in the case of the Linaro toolchain for example? 是否有任何特殊原因使用了内置的编译器类型,而不是像例如Linaro工具链那样使用普通的float? If I replace the typedef would I cause unwanted/undefined behavior? 如果替换typedef,是否会导致不必要的/未定义的行为? Does anyone know if the toolchain included in the NDK based on the CodeSourcery toolchain, because the CS one is really buggy and the code base we have breaks it in many ways(just as info so that I know I have to definitely change the toolchain)? 是否有人知道基于CodeSourcery工具链的NDK中包含的工具链,因为CS确实是错误的,并且我们的代码库在很多方面都破坏了它(就像信息一样,所以我知道我必须更改工具链) ?

I'm using: 我正在使用:

  • Android NDK version r8 Android NDK版本R8

  • NDK toolchain gcc (GCC) 4.4.3 - stripped outside the NDK as advised in the NDK documentation NDK工具链gcc(GCC)4.4.3-根据NDK文档中的建议在NDK之外删除

Update: 更新:

Found this other SO question that illustrates pretty much the same issue ... the scary thing is that it's from 2010. 发现了另一个可以说明几乎相同问题的SO问题 ...可怕的是它来自2010年。

Update 2: 更新2:

Replacing the typedef is not an option as it will break completely the NEON intrinsics functionality. 替换typedef不是一个选择,因为它将完全破坏NEON内部函数。 All the floating point intrinsics rely on builtin compiler functions which expect the __builtin_neon_sf (the typedef for float32_t) type as their parameter(s). 所有浮点内在函数都依赖于内置的编译器函数,这些函数期望将__builtin_neon_sf (float32_t的typedef)类型作为其参数。

您可以尝试Dmitry Moskalchuk的Crystax NDK

This is a compiler bug. 这是一个编译器错误。 I've opened one new issue in the Android project bug tracker . 在Android项目错误跟踪器中打开了一个新问题。

Unfortunately to overcome it I had to rewrite the whole portion of code which was causing it. 不幸的是,要克服它,我不得不重写导致它的整个代码部分。

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

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