<div dir="ltr"><pre style="color:rgb(0,0,0)"><font face="arial, sans-serif">Hello,
After I built libssl as a shared library, the compilation could be completed normally, but I encountered some problems after compilation. The details are as follows:
</font>root@VM-8-12-debian /www/server/nginx/sbin # ./nginx -t<br>./nginx: symbol lookup error: ./nginx: undefined symbol: SSL_library_init<br>root@VM-8-12-debian /www/server/nginx/sbin # ./nginx -V<br>nginx version: nginx/1.25.4<br>built by gcc 12.2.0 (Debian 12.2.0-14) <br>built with OpenSSL 1.1.1 (compatible; BoringSSL) (running with OpenSSL 3.0.11 19 Sep 2023)<br>TLS SNI support enabled<br>configure arguments: --user=www --group=www --prefix=/www/server/nginx --with-pcre --add-module=/root/ngx_brotli --with-http_v2_module --with-stream --with-stream_ssl_module --with-http_ssl_module --with-http_gzip_static_module --with-http_gunzip_module --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --with-cc-opt=-Wno-error --with-ld-opt=-ljemalloc --with-http_dav_module --with-http_v3_module --with-cc-opt=-I/root/boringssl/include --with-ld-opt='-L/root/boringssl/build/ssl -L/root/boringssl/build/crypto -Wl,-rpath=/root/boringssl/build/ssl -Wl,-rpath=/root/boringssl/build/crypto -Wl,--enable-new-dtags'
><i> On 20 Feb 2024, at 09:22, 杨金泽 <<a href="https://mailman.nginx.org/mailman/listinfo/nginx">rttwyjz at gmail.com</a>> wrote:
</i>><i>
</i>><i> Hello,
</i>><i> I encountered the following error when using boringssl to build Nginx:
</i>><i> checking for OpenSSL library ... not found
</i>><i> checking for OpenSSL library in /usr/local/ ... not found
</i>><i> checking for OpenSSL library in /usr/pkg/ ... not found
</i>><i> checking for OpenSSL library in /opt/local/ ... not found
</i>><i> ./auto/configure: error: SSL modules require the OpenSSL library.
</i>><i> You can either do not enable the modules, or install the OpenSSL library
</i>><i> into the system, or build the OpenSSL library statically from the source
</i>><i> with nginx by using --with-openssl=<path> option.
</i>
Regardless of a pilot error (trimmed), there is indeed a breaking
change in BoringSSL, which now expects C++ runtime environment in
libssl, see git revision c52806157c97105da7fdc2b021d0a0fcd5186bf3,
which basically means it can no longer be used in pure C programs.
Someday they will hopefully fix that, meanwhile you may want to:
- switch to C++ linker as described in the revision;
- build libssl as a shared library (see BUILDING.md in sources);
- use some other workarounds when linking with BoringSSL statically,
such as explicit linking with libstdc++/libc++.
--
Sergey Kandaurov</pre></div>