Android内核编译错误gcc6 linaro 6

时间:2017-01-07 19:20:15

标签: 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

1 个答案:

答案 0 :(得分:1)

看起来像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"