编译Nginx时提示缺少annobin.so文件的解决方法

问题现象描述

在编译安装Nginx 1.14.2时,提示“Inaccessible plugin file /usr/local/lib/gcc/aarch64-unknown-linux-gnu/8.5.0/plugin/annobin.so”。

关键过程、根本原因分析

出现该问题的原因是缺少annobin.so文件,此时需手动安装annobin文件。

结论、解决方案及效果

  1. Yum源安装annobin。

    1
    yum install -y annobin
    

  2. 设置软链接。

    1
    2
    3
    cd /usr/local/lib/gcc/aarch64-unknown-linux-gnu/8.5.0/plugin
    ln -sf /usr/lib/gcc/aarch64-redhat-linux/8/plugin/annobin.so.0.0.0 annobin.so.0
    ln -sf /usr/lib/gcc/aarch64-redhat-linux/8/plugin/annobin.so.0.0.0 annobin.so
    

  3. 重新编译Nginx。

    1
    2
    3
    4
    5
    cd /home/nginx-1.14.2
    make clean
    ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_perl_module --with-pcre --with-cc-opt="-fPIC"
    make -j60
    make install