• 编译openwrt时报错:fstools-2018-01-02-11efbf3b/libfstools/overlay.c: At top level: cc1: error: unrecognized command line option '-Wno-format-truncation' [-Werror]


    1. 详细错误信息

      

    [ 11%] Building C object CMakeFiles/fstools.dir/libfstools/overlay.c.o
    /home/jello/openwrt/build_dir/target-aarch64_generic_glibc/fstools-2018-01-02-11efbf3b/libfstools/overlay.c: In function 'jffs2_switch':
    /home/jello/openwrt/build_dir/target-aarch64_generic_glibc/fstools-2018-01-02-11efbf3b/libfstools/overlay.c:249:3: warning: ignoring return value of 'system', declared with attribute warn_unused_result [-Wunused-result]
    system("cp -a /tmp/root/upper/* / 2>/dev/null");
    ^
    /home/jello/build_dir/target-aarch64_generic_glibc/fstools-2018-01-02-11efbf3b/libfstools/overlay.c: At top level:
    cc1: error: unrecognized command line option '-Wno-format-truncation' [-Werror]
    cc1: all warnings being treated as errors
    make[6]: *** [CMakeFiles/fstools.dir/libfstools/overlay.c.o] Error 1

    2. 解决办法

    >  libfstools/overlay.c | 4 ++++
    >  1 file changed, 4 insertions(+)
    >> diff --git a/libfstools/overlay.c b/libfstools/overlay.c
    > index 7ada5ff..8423a57 100644
    > --- a/libfstools/overlay.c
    > +++ b/libfstools/overlay.c
    > @@ -243,6 +243,10 @@ jffs2_switch(struct volume *v)
    >  		ULOG_INFO("performing overlay whiteout
    ");
    >  		umount2("/tmp/root", MNT_DETACH);
    >  		foreachdir("/overlay/", handle_whiteout);
    > +
    > +		/* try hard to be in sync */
    > +		ULOG_INFO("syncronizing overlay
    ");
    > +		system("cp -a /tmp/root/upper/* / 2>/dev/null");
    >  		break;
    >>  	case FS_EXT4:
    >

    删除build_dir/target-aarch64_generic_glibc/fstools-2018-01-02-11efbf3b/libfstools/overlay.c中的以下内容:
         /* try hard to be in sync */
            ULOG_INFO("syncronizing overlay
    ");
            system("cp -a /tmp/root/upper/* / 2>/dev/null");

     3. 参考资料

      补丁

  • 相关阅读:
    idea主题更换pycharm/intellij
    随机生成n张扑克牌。
    JAVA生成6个1-8的随机数,要求无重复。
    一道简单 的循环
    linux虚拟机互访
    linux中grep命令
    vi和vim编辑器
    文件压缩打包以及备份
    文件内容查询
    目录相关操作
  • 原文地址:https://www.cnblogs.com/dakewei/p/10577752.html
Copyright © 2020-2023  润新知