Android内核编译报错gcc6 linaro 6

标签 android gcc compiler-errors kernel linaro

我正在尝试使用 Linaro 6 进行编译,但我收到了这个错误,我认为这与 GCC 6 有什么关系?我在编译内核或编码方面非常业余,但即使搜索类似的术语我也无法弄清楚:

  CC      drivers/iommu/msm_iommu-v1.o
In file included from include/linux/io.h:22:0,
                 from drivers/iommu/msm_iommu-v1.c:20:
drivers/iommu/msm_iommu-v1.c: In function '__program_context':
drivers/iommu/msm_iommu_hw-v1.h:78:31: warning: result of '16777215 << 14' requires 39 bits to represent, but 'int' only has 32 bits [-Wshift-overflow=]
error, forbidden warning: msm_iommu_hw-v1.h:78
scripts/Makefile.build:308: recipe for target 'drivers/iommu/msm_iommu-v1.o' failed

这是我的 GitHUB:

https://github.com/mykesorrel/surnia_kernel

最佳答案

看起来像是那个 iommu 驱动程序的错误。它试图将位移位转换为 int 而不是 long,int 没有足够的位来完成操作。我猜未使用 -Wno-error,因此所有警告都被视为错误。

这个问题对你有帮助:How to compile without warnings being treated as errors?

我个人所做的是更新我的 .bashrc 中的 CFLAGS(假设您使用的是 Linux)。这是我使用的:

# Ensure C builds don't fail on warnings
export CFLAGS="-Wno-error"
export CXXFLAGS="-Wno-error"

关于Android内核编译报错gcc6 linaro 6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41525496/

相关文章:

c++ - C++ 和 gcc 中的线程局部静态

Linux 3.13 内核编译失败

java - 如何从 html 代码中获取图像标签到 Glide 中作为 Java 中的图像源?

android - FireBase 离线模式只能用于本地存储吗?

Android 2.3 webview loadData 只显示编码字符

linux - 如何修复错误 : bad value (native) for -march= switch and -mtune= switch?

c - 当有 `-L` 时使用 `LD_LIBRARY_PATH` 有什么意义?

objective-c - 关于实例变量和父类(super class)的奇怪错误

c++ - 错误 : passing ‘const Complex’ as ‘this’ argument of '....' discards qualifiers

android - 将 Firebase uri 转换为位图时出现 FileNotFound 异常?