Android NDK 使用哪个编译器? [英] Which compiler does Android NDK use?

查看:48
本文介绍了Android NDK 使用哪个编译器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 Android 应用程序编写基于 ARM NEON 的代码,但我一直在努力解决某些编译器标志无法识别的问题.后来我意识到对这些标志的支持是最近才添加的,而且我的 GCC 版本较旧.我在 Windows 上做所有事情,并且受到 Cygwin 必须提供的版本的限制.这是我的问题:在我去尝试在我的 Windows 机器上构建 GCC 4.6.0 并使 Cygwin 喜欢它之前,它对我有用还是 NDK 使用它自己的 GCC 版本并且我的升级根本不会影响它?如果是,是否可以告诉它使用不同的编译器?

I'm writing ARM NEON-based code for an Android application and I was struggling with certain compiler flags not being recognized. I later realized that support for those flags was only added quite recently and that my GCC version is older. I'm doing the whole thing on Windows and am limited by what versions Cygwin has to offer. Here's my question: before I go and try to build GCC 4.6.0 on my Windows machine and make Cygwin like it, will it work for me or does the NDK use its own version of the GCC and my upgrade will not at all affect it? If it does, is it possible to tell it to use a different compiler?

推荐答案

NDK 本身调用构建在 arm-eabi-gcc 编译器上的定制交叉编译器.有一些例子表明人们使用支持 ARM 指令集的 bog 标准 GCC 实现来创建自定义工具链,但这超出了我的范围.我过去读过的大部分内容总是讨论使用 NDK 中包含的工具链来编译本机代码.

The NDK itself invokes a customized cross-compiler built on the arm-eabi-gcc compiler. There are examples out there of people creating custom toolchains using bog-standard GCC implementations with support for ARM instruction sets but that's way out of my league. Most of the stuff I've read in the past always discussed using the toolchain included with the NDK to compile native code.

推论:大多数抱怨并不得不制作自己的工具链的人都是对 NDK 工具链编译器的(假设)低于标准的 C++ 支持感到不满的人.我不能说这个,因为有些文章比较旧,而且 Android 变化如此之快.它也不是一个似乎经常出现的意见.

Corollary: Most of the people who have complained and have had to make their own toolchain have been people that were upset with the (supposed) sub-par C++ support of the NDK toolchain's compiler. I can't speak to this because some of the articles were older and Android changes so rapidly. It also hasn't been an opinion that seems to pop up all too frequently.

这篇关于Android NDK 使用哪个编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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