首页 > 解决方案 > 如何解决与 clang 相关的 gcc 或 g++ 错误?

问题描述

在我的 android 内核中进行了一些更改,并试图编译它,但遇到了一些与 clang 相关的错误。

我试图操纵 clang 和 gcc 标志,但不知道应该添加或删除哪个。

extern "C"
{

int init_test()
{
    int n=5,i;
    TestClass **t;

    t = new TestClass* [n];
    for(i=0; i<n; i++) {
       t[i] = new TestClass(i);
       t[i]->print_version();
    }

    for(i=0; i<n; i++)
        delete t[i];
    delete t;
    return 0;
}

输出:

  CC      kernel/test.o
real-aarch64-linux-android-g++: error: unrecognized command line option '-no-integrated-as'
real-aarch64-linux-android-g++: error: unrecognized command line option '-mno-implicit-float'
real-aarch64-linux-android-g++: error: unrecognized command line option '-mno-global-merge'
real-aarch64-linux-android-g++: error: unrecognized command line option '-no-integrated-as'
real-aarch64-linux-android-g++: error: unrecognized command line option '-Qunused-arguments'
make[3]: *** [/home/saurabh/walleye_test/private/msm-google/scripts/Makefile.build:333: kernel/test.o] Error 1
make[2]: *** [/home/saurabh/walleye_test/private/msm-google/Makefile:1100: kernel] Error 2

标签: androidgcclinux-kernelkernel

解决方案


推荐阅读