简体   繁体   English

为什么Android NDK对于32位和64位ABI使用不同的GCC版本?

[英]Why does the Android NDK use different GCC versions for 32-bit and 64-bit ABIs?

From the docs (emphasis mine): 文档 (重点是我的):

Made GCC 4.8 the default for all 32-bit ABIs . 将GCC 4.8设置为所有32位ABI的默认值 Deprecated GCC 4.6, and will remove it next release. 不建议使用GCC 4.6,并将在下一版本中将其删除。 To restore previous behavior, either add NDK_TOOLCHAIN_VERSION=4.6 to ndk-build, or add --toolchain=arm-linux-androideabi-4.6 when executing make-standalone-toolchain.sh on the command line. 要恢复以前的行为,请在命令行上执行make-standalone-toolchain.sh时,将NDK_TOOLCHAIN_VERSION = 4.6添加到ndk-build,或添加--toolchain = arm-linux-androideabi-4.6。 GCC 4.9 remains the default for 64-bit ABIs . 对于64位ABI,GCC 4.9仍然是默认设置

Specifically, is there any reason not to use GCC 4.9 for 32-bit ABIs as well? 具体来说,是否有任何理由不对32位ABI也使用GCC 4.9? We need std::regex support which was only added in 4.9. 我们需要仅在4.9中添加的std::regex支持。

This is probably mostly for pragmatic reasons. 这可能主要是出于务实的原因。 The default version for 32 bit is lagging behind a bit, since the old versions are more proven, and if there are no direct issues with them, they have probably preferred to stay with them. 32位的默认版本滞后了一点,因为旧版本已得到更可靠的证明,并且如果它们没有直接问题,则它们可能更愿意选择保留。

For the 64 bit ABIs, in particular aarch64, the support in older GCC versions might not have been mature enough. 对于64位ABI,尤其是aarch64,旧版GCC中的支持可能还不够成熟。 Additionally, those ABIs haven't been supported at all before, so there's no risk of regressions since it's a completely new configuration. 此外,这些ABI之前根本没有得到支持,因此由于它是全新的配置,因此没有回归的风险。

If you need features from GCC 4.9, just add NDK_TOOLCHAIN_VERSION=4.9 . 如果您需要GCC 4.9中的功能,只需添加NDK_TOOLCHAIN_VERSION=4.9 There shouldn't be any issues in principle, but if there are I'm sure they'd love to hear reports about it if you run into anything. 原则上不应该有任何问题,但是如果您遇到任何问题,我敢肯定,如果有的话,他们很乐意听到有关该问题的报告。

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

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