• f-stack中nginx配置后make出现error: ignoring return value of ‘ftruncate’


    问题

    Nginx 配置后 make 出现error:

    src/os/unix/ngx_process_cycle.c: In function ‘ngx_start_worker_processes’:
    src/os/unix/ngx_process_cycle.c:388:5: error: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Werror=unused-result]
         (void) ftruncate(shm_fd, sizeof(sem_t));
         ^
    cc1: all warnings being treated as errors
    objs/Makefile:799: recipe for target 'objs/src/os/unix/ngx_process_cycle.o' failed
    make[1]: *** [objs/src/os/unix/ngx_process_cycle.o] Error 1
    make[1]: Leaving directory '/home/sdn/f-stack/app/nginx-1.11.10'
    Makefile:8: recipe for target 'build' failed
    make: *** [build] Error 2
    

    环境

    • The compiling environment is Ubuntu

    • uname -r:4.13.0-45-generic

    • cc -v:gcc version 5.4.0

    DPDK和F-stack可以成功安装,但是Nginx无法make。

    按照原文档的方式配置configure:

    # bash ./configure --prefix=/usr/local/nginx_fstack --with-ff_module
    
    # make
    
    • 出现以下error:
    src/os/unix/ngx_process_cycle.c: In function ‘ngx_start_worker_processes’:
    src/os/unix/ngx_process_cycle.c:388:5: error: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Werror=unused-result]
         (void) ftruncate(shm_fd, sizeof(sem_t));
         ^
    cc1: all warnings being treated as errors
    objs/Makefile:799: recipe for target 'objs/src/os/unix/ngx_process_cycle.o' failed
    make[1]: *** [objs/src/os/unix/ngx_process_cycle.o] Error 1
    make[1]: Leaving directory '/home/sdn/f-stack/app/nginx-1.11.10'
    Makefile:8: recipe for target 'build' failed
    make: *** [build] Error 2
    
    

    解决办法

    在配置文件的时候,键入:

    ./configure --prefix=/usr/local/nginx_fstack --with-ff_module --with-cc-opt="-Wno-implicit-fallthrough -Wno-unused-result"
    

    github issues

    • 感谢那位工程师的回复!!
  • 相关阅读:
    一天一个shell实例(1)文本中n个出现频率最高的单词(转)
    JNDI全攻略(一)(转)
    JNDI 学习(转)
    JNDI全攻略(二)(转)
    C#开发系列 文章索引
    AppControls
    JSF系列 文章索引
    [转载]DELPHI组件安装全攻略
    什么是有价值的人生
    [转载]InnoSetup5.2.3啊风增强版 安装代码
  • 原文地址:https://www.cnblogs.com/vancasola/p/9335724.html
Copyright © 2020-2023  润新知