zoukankan      html  css  js  c++  java
  • 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

    • 感谢那位工程师的回复!!
  • 相关阅读:
    记录一次redis-shake跨云迁移阿里云redis混合型到腾讯云tendis
    nginx 通过配置文件切割访问日志
    saltstack 批量修改hostname
    linux 免交互式修改密码
    zabbix 接入钉钉机器人报警
    监控体系
    zabbix自动化监控三种方式
    zabbix 自定义脚本监控activemq
    2021.07.20 总结
    微信小程序总结
  • 原文地址:https://www.cnblogs.com/vancasola/p/9335724.html
Copyright © 2011-2022 走看看