Issues building Nginx using boringssl

Jinze YANG rttwyjz at gmail.com
Wed Feb 21 03:18:53 UTC 2024


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:root at VM-8-12-debian /www/server/nginx/sbin
# ./nginx -t
./nginx: symbol lookup error: ./nginx: undefined symbol: SSL_library_init
root at VM-8-12-debian /www/server/nginx/sbin # ./nginx -V
nginx version: nginx/1.25.4
built by gcc 12.2.0 (Debian 12.2.0-14)
built with OpenSSL 1.1.1 (compatible; BoringSSL) (running with OpenSSL
3.0.11 19 Sep 2023)
TLS SNI support enabled
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'

>* On 20 Feb 2024, at 09:22, 杨金泽 <rttwyjz at gmail.com <https://mailman.nginx.org/mailman/listinfo/nginx>> wrote:
*> >* Hello,
*>* I encountered the following error when using boringssl to build Nginx:
*>* checking for OpenSSL library ... not found
*>* checking for OpenSSL library in /usr/local/ ... not found
*>* checking for OpenSSL library in /usr/pkg/ ... not found
*>* checking for OpenSSL library in /opt/local/ ... not found
*>* ./auto/configure: error: SSL modules require the OpenSSL library.
*>* You can either do not enable the modules, or install the OpenSSL library
*>* into the system, or build the OpenSSL library statically from the source
*>* with nginx by using --with-openssl=<path> option.
*
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20240221/0cd74c34/attachment.htm>


More information about the nginx mailing list