【问题标题】:error during compilation of a ARM64 android kernel编译 ARM64 android 内核时出错
【发布时间】:2018-02-01 13:29:03
【问题描述】:

即使经过深入研究,我也找不到答案。 我正在编译一个 Android ARM64 内核,并且在这个文件中

驱动程序/misc/qcom/qdsp6v2/audio_amrwbplus

我有这些台词:

119 static long audio_ioctl(struct file *file, unsigned int cmd,
120                 unsigned long arg)
121 {
122 struct q6audio_aio *audio = file->private_data;
123 int rc = 0;

    ...

抛出此错误:

drivers/misc/qcom/qdsp6v2/audio_amrwbplus.c: In function 'audio_ioctl_shared':
drivers/misc/qcom/qdsp6v2/audio_amrwbplus.c:121:13: error: invalid storage 
class for function 'audio_ioctl'
static long audio_ioctl(struct file *file, unsigned int cmd,
         ^
drivers/misc/qcom/qdsp6v2/audio_amrwbplus.c:121:1: warning: ISO C90 forbids 
mixed declarations and code [-Wdeclaration-after-statement]
error, forbidden warning: audio_amrwbplus.c:121

我正在使用 GCC 7.x 和 5.x 进行编译,结果相同

我也试过设置

-Wno-declaration-after-statement

进入 Makefile,没有运气

【问题讨论】:

  • 你是怎么编译的?
  • export ARCH=arm64 && export CROSS_COMPILE=../uber-7.x/bin/aarch64-linux-android- && make name_defconfig && make 标准是-std=89
  • 删除-std=89
  • -std=89 在 Makefile 中,我应该删除它吗?
  • 显然代码不符合这个标准版本。

标签: android c compilation kernel


【解决方案1】:

对于遇到(某种)相同问题的每个人来说,这就是解决方案。

问题不是编译器告诉我的那些行,而是(在同一个文件中)在那之前的一些行。这只是一些奇怪的括号,后面的代码弄乱了。

如果您遇到类似情况,请尝试在同一文件上进行更深入的搜索,您可能会发现逻辑混乱的问题。

【讨论】:

    猜你喜欢
    • 2017-01-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-26
    • 1970-01-01
    相关资源
    最近更新 更多