2017-01-07 76 views
2

我试图编译使用Linaro 6,我收到这个错误,我相信有一些与GCC 6做?我很业余与编译内核或编码对于这个问题,但我不知道这一点甚至搜索类似的术语:Android内核编译错误gcc6 linaro 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

看起来像该iommu驱动程序的错误。它试图对int进行位移,而不是long,int没有足够的位来完成操作。我猜测-Wno-error没有被使用,所以所有的警告被视为错误。

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

我亲手做的就是更新CFLAGS在我的.bashrc(你正在使用Linux假设)。这是我使用的:

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

谢谢我用-w去,而不是似乎工作得更好,不知道为什么其他不工作。 – Mike