【问题标题】:Android kernel compile error gcc6 linaro 6Android内核编译错误gcc6 linaro 6
【发布时间】:2017-05-22 09:13:57
【问题描述】:

我正在尝试使用 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

【问题讨论】:

    标签: android gcc compiler-errors kernel linaro


    【解决方案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"
    

    【讨论】:

    • 感谢我选择了 -w,但它似乎效果更好,不知道为什么另一个不起作用。
    猜你喜欢
    • 2015-10-14
    • 1970-01-01
    • 2013-12-09
    • 1970-01-01
    • 2017-01-05
    • 2013-06-03
    • 2017-07-30
    • 2010-12-06
    • 1970-01-01
    相关资源
    最近更新 更多