Opened 7 years ago

Closed 7 years ago

#305 closed defect (invalid)

Can't compile NGINX 1.3.13 with OpenSSL library

Reported by: 188464@… Owned by: sb
Priority: minor Milestone:
Component: nginx-core Version: 1.3.x
Keywords: Cc:
uname -a: SunOS titan2 5.11 oi_151a7 i86pc i386 i86pc Solaris
nginx -V: new install

Description

My goal is installing nginx with SSL support. My system is OpenIndiana? 151a7 x86_64, gcc v4.4.4

OpenSSL was built from source

# openssl version
OpenSSL 1.0.1e 11 Feb 2013

# ldd /usr/bin/openssl

libssl.so.1.0.0 => /usr/lib/64/libssl.so.1.0.0
libcrypto.so.1.0.0 => /usr/lib/64/libcrypto.so.1.0.0
libsocket.so.1 => /usr/lib/64/libsocket.so.1
libnsl.so.1 => /usr/lib/64/libnsl.so.1
libdl.so.1 => /usr/lib/64/libdl.so.1
libz.so.1 => /usr/lib/64/libz.so.1
libc.so.1 => /usr/lib/64/libc.so.1
libmp.so.2 => /lib/64/libmp.so.2
libmd.so.1 => /lib/64/libmd.so.1
libm.so.2 => /lib/64/libm.so.2

Nginx configure:
# ./configure --prefix=/usr/nginx --with-debug --with-http_ssl_module --with-openssl=/usr/include/openssl

<result as usual>

# gmake
gmake -f objs/Makefile
gmake[1]: Entering directory `/usr/share/src/nginx-1.3.13'
cd /usr/include/openssl \

&& gmake clean \
&& ./config --prefix=/usr/include/openssl/.openssl no-shared no-threads \
&& gmake \
&& gmake install LIBDIR=lib

gmake[2]: Entering directory `/usr/include/openssl'
gmake[2]: * No rule to make target `clean'. Stop.
gmake[2]: Leaving directory `/usr/include/openssl'
gmake[1]:
* usr/include/openssl/.openssl/include/openssl/ssl.h Error 2
gmake[1]: Leaving directory `/usr/share/src/nginx-1.3.13'
gmake: * [build] Error 2

I hope somebody could point out the mistake. Thanks.

Change History (5)

comment:1 Changed 7 years ago by maxim

  • Owner set to sb
  • Status changed from new to assigned

comment:2 in reply to: ↑ description Changed 7 years ago by ru

Replying to Neddy Hai Nam:
[...]

OpenSSL was built from source

[...]

Nginx configure:
# ./configure --prefix=/usr/nginx --with-debug --with-http_ssl_module --with-openssl=/usr/include/openssl

[...]

# gmake
gmake -f objs/Makefile
gmake[1]: Entering directory `/usr/share/src/nginx-1.3.13'
cd /usr/include/openssl \

&& gmake clean \
&& ./config --prefix=/usr/include/openssl/.openssl no-shared no-threads \
&& gmake \
&& gmake install LIBDIR=lib

gmake[2]: Entering directory `/usr/include/openssl'
gmake[2]: * No rule to make target `clean'. Stop.
gmake[2]: Leaving directory `/usr/include/openssl'
gmake[1]:
* usr/include/openssl/.openssl/include/openssl/ssl.h Error 2
gmake[1]: Leaving directory `/usr/share/src/nginx-1.3.13'
gmake: * [build] Error 2

I hope somebody could point out the mistake. Thanks.

$ configure --help | grep openssl

--with-openssl=DIR set path to OpenSSL library sources
--with-openssl-opt=OPTIONS set additional build options for OpenSSL

The directory specified in the --with-openssl= configure parameter should point to a path to OpenSSL sources, not the installed OpenSSL includes. It's so that nginx can build OpenSSL from sources during its own build, but that's not your case.

Last edited 7 years ago by fabler (previous) (diff)

comment:3 Changed 7 years ago by mdounin

  • Resolution set to invalid
  • Status changed from assigned to closed

This is certainly wrong place for support questions.

comment:4 Changed 7 years ago by 188464@…

  • Resolution invalid deleted
  • Status changed from closed to reopened
# ./configure --prefix=/usr/nginx --with-debug --with-http_ssl_module --with-openssl=/usr/src/openssl-1.0.1e

then

# gmake
...
        objs/src/os/unix/ngx_recv.o \
        objs/src/os/unix/ngx_readv_chain.o \
        objs/src/os/unix/ngx_udp_recv.o \
        objs/src/os/unix/ngx_send.o \
        objs/src/os/unix/ngx_writev_chain.o \
        objs/src/os/unix/ngx_channel.o \
        objs/src/os/unix/ngx_shmem.o \
        objs/src/os/unix/ngx_process.o \
        objs/src/os/unix/ngx_daemon.o \
        objs/src/os/unix/ngx_setaffinity.o \
        objs/src/os/unix/ngx_setproctitle.o \
        objs/src/os/unix/ngx_posix_init.o \
        objs/src/os/unix/ngx_user.o \
        objs/src/os/unix/ngx_process_cycle.o \
        objs/src/os/unix/ngx_solaris_init.o \
        objs/src/os/unix/ngx_solaris_sendfilev_chain.o \
        objs/src/event/modules/ngx_eventport_module.o \
        objs/src/event/modules/ngx_devpoll_module.o \
        objs/src/event/ngx_event_openssl.o \
        objs/src/event/ngx_event_openssl_stapling.o \
        objs/src/core/ngx_regex.o \
        objs/src/http/ngx_http.o \
        objs/src/http/ngx_http_core_module.o \
        objs/src/http/ngx_http_special_response.o \
        objs/src/http/ngx_http_request.o \
        objs/src/http/ngx_http_parse.o \
        objs/src/http/ngx_http_header_filter_module.o \
        objs/src/http/ngx_http_write_filter_module.o \
        objs/src/http/ngx_http_copy_filter_module.o \
        objs/src/http/modules/ngx_http_log_module.o \
        objs/src/http/ngx_http_request_body.o \
        objs/src/http/ngx_http_variables.o \
        objs/src/http/ngx_http_script.o \
        objs/src/http/ngx_http_upstream.o \
        objs/src/http/ngx_http_upstream_round_robin.o \
        objs/src/http/ngx_http_parse_time.o \
        objs/src/http/modules/ngx_http_static_module.o \
        objs/src/http/modules/ngx_http_index_module.o \
        objs/src/http/modules/ngx_http_chunked_filter_module.o \
        objs/src/http/modules/ngx_http_range_filter_module.o \
        objs/src/http/modules/ngx_http_headers_filter_module.o \
        objs/src/http/modules/ngx_http_not_modified_filter_module.o \
        objs/src/http/ngx_http_busy_lock.o \
        objs/src/http/ngx_http_file_cache.o \
        objs/src/http/modules/ngx_http_gzip_filter_module.o \
        objs/src/http/ngx_http_postpone_filter_module.o \
        objs/src/http/modules/ngx_http_ssi_filter_module.o \
        objs/src/http/modules/ngx_http_charset_filter_module.o \
        objs/src/http/modules/ngx_http_userid_filter_module.o \
        objs/src/http/modules/ngx_http_autoindex_module.o \
        objs/src/http/modules/ngx_http_auth_basic_module.o \
        objs/src/http/modules/ngx_http_access_module.o \
        objs/src/http/modules/ngx_http_limit_conn_module.o \
        objs/src/http/modules/ngx_http_limit_req_module.o \
        objs/src/http/modules/ngx_http_geo_module.o \
        objs/src/http/modules/ngx_http_map_module.o \
        objs/src/http/modules/ngx_http_split_clients_module.o \
        objs/src/http/modules/ngx_http_referer_module.o \
        objs/src/http/modules/ngx_http_rewrite_module.o \
        objs/src/http/modules/ngx_http_ssl_module.o \
        objs/src/http/modules/ngx_http_proxy_module.o \
        objs/src/http/modules/ngx_http_fastcgi_module.o \
        objs/src/http/modules/ngx_http_uwsgi_module.o \
        objs/src/http/modules/ngx_http_scgi_module.o \
        objs/src/http/modules/ngx_http_memcached_module.o \
        objs/src/http/modules/ngx_http_empty_gif_module.o \
        objs/src/http/modules/ngx_http_browser_module.o \
        objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
        objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
        objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
        objs/ngx_modules.o \
        -lsocket -lnsl -lsendfile -lpcre /usr/src/openssl-1.0.1e/.openssl/lib/libssl.a /usr/src/openssl-1.0.1e/.openssl/lib/libcrypto.a -lz
ld: warning: file /usr/src/openssl-1.0.1e/.openssl/lib/libssl.a(s23_meth.o): wrong ELF class: ELFCLASS64
ld: warning: file /usr/src/openssl-1.0.1e/.openssl/lib/libcrypto.a(cryptlib.o): wrong ELF class: ELFCLASS64
Undefined                       first referenced
 symbol                             in file
SSL_CTX_remove_session              objs/src/event/ngx_event_openssl.o
ERR_clear_error                     objs/src/event/ngx_event_openssl.o
SSL_load_error_strings              objs/src/event/ngx_event_openssl.o
SSL_get_peer_certificate            objs/src/event/ngx_event_openssl.o
SSL_CIPHER_get_name                 objs/src/event/ngx_event_openssl.o
SSL_do_handshake                    objs/src/event/ngx_event_openssl.o
SSL_CTX_get_verify_callback         objs/src/http/ngx_http_request.o
OPENSSL_config                      objs/src/event/ngx_event_openssl.o
X509_STORE_add_lookup               objs/src/event/ngx_event_openssl.o
sk_value                            objs/src/event/ngx_event_openssl_stapling.o
SSL_set_verify_depth                objs/src/http/ngx_http_request.o
X509_check_issued                   objs/src/event/ngx_event_openssl_stapling.o
OCSP_cert_to_id                     objs/src/event/ngx_event_openssl_stapling.o
PEM_write_bio_X509                  objs/src/event/ngx_event_openssl.o
X509_NAME_oneline                   objs/src/event/ngx_event_openssl.o
SSL_write                           objs/src/event/ngx_event_openssl.o
i2d_OCSP_REQUEST                    objs/src/event/ngx_event_openssl_stapling.o
SSL_CTX_use_PrivateKey_file         objs/src/event/ngx_event_openssl.o
SSL_set_quiet_shutdown              objs/src/event/ngx_event_openssl.o
SSL_get_ex_new_index                objs/src/event/ngx_event_openssl.o
SSL_get_error                       objs/src/event/ngx_event_openssl.o
ENGINE_free                         objs/src/event/ngx_event_openssl.o
OCSP_basic_verify                   objs/src/event/ngx_event_openssl_stapling.o
OCSP_response_get1_basic            objs/src/event/ngx_event_openssl_stapling.o
SSL_CTX_callback_ctrl               objs/src/event/ngx_event_openssl_stapling.o
ASN1_d2i_bio                        objs/src/event/ngx_event_openssl_stapling.o
X509_free                           objs/src/event/ngx_event_openssl.o
ERR_get_error                       objs/src/event/ngx_event_openssl.o
OCSP_RESPONSE_free                  objs/src/event/ngx_event_openssl_stapling.o
OCSP_response_status                objs/src/event/ngx_event_openssl_stapling.o
SHA1_Init                           objs/src/core/ngx_crypt.o
DH_new                              objs/src/event/ngx_event_openssl.o
SHA1_Update                         objs/src/core/ngx_crypt.o
OPENSSL_add_all_algorithms_noconf   objs/src/event/ngx_event_openssl.o
MD5_Update                          objs/src/core/ngx_crypt.o
CRYPTO_add_lock                     objs/src/event/ngx_event_openssl_stapling.o
SSL_CTX_sess_set_remove_cb          objs/src/event/ngx_event_openssl.o
X509_LOOKUP_ctrl                    objs/src/event/ngx_event_openssl.o
X509_LOOKUP_file                    objs/src/event/ngx_event_openssl.o
SSL_set_accept_state                objs/src/event/ngx_event_openssl.o
BIO_s_mem                           objs/src/event/ngx_event_openssl.o
ENGINE_set_default                  objs/src/event/ngx_event_openssl.o
BN_bin2bn                           objs/src/event/ngx_event_openssl.o
X509_STORE_CTX_new                  objs/src/event/ngx_event_openssl_stapling.o
SSL_get_servername                  objs/src/http/ngx_http_request.o
SSL_CTX_set_verify_depth            objs/src/event/ngx_event_openssl.o
SSL_CTX_get_verify_depth            objs/src/http/ngx_http_request.o
X509_STORE_set_flags                objs/src/event/ngx_event_openssl.o
SSL_set_connect_state               objs/src/event/ngx_event_openssl.o
X509_get_serialNumber               objs/src/event/ngx_event_openssl.o
SSL_set_fd                          objs/src/event/ngx_event_openssl.o
SSL_load_client_CA_file             objs/src/event/ngx_event_openssl.o
OBJ_sn2nid                          objs/src/event/ngx_event_openssl.o
ERR_error_string_n                  objs/src/event/ngx_event_openssl.o
BIO_new                             objs/src/event/ngx_event_openssl.o
SSL_CTX_get_ex_new_index            objs/src/event/ngx_event_openssl.o
SHA1_Final                          objs/src/core/ngx_crypt.o
SSL_CTX_get_cert_store              objs/src/event/ngx_event_openssl.o
OCSP_RESPONSE_new                   objs/src/event/ngx_event_openssl_stapling.o
SSL_CTX_sess_set_get_cb             objs/src/event/ngx_event_openssl.o
OCSP_request_add0_id                objs/src/event/ngx_event_openssl_stapling.o
sk_num                              objs/src/event/ngx_event_openssl_stapling.o
MD5_Init                            objs/src/core/ngx_crypt.o
X509_STORE_CTX_get1_issuer          objs/src/event/ngx_event_openssl_stapling.o
SSL_get_verify_result               objs/src/event/ngx_event_openssl.o
SSL_CTX_sess_set_new_cb             objs/src/event/ngx_event_openssl.o
SSL_ctrl                            objs/src/event/ngx_event_openssl.o
SSL_free                            objs/src/event/ngx_event_openssl.o
SSL_read                            objs/src/event/ngx_event_openssl.o
SSL_SESSION_free                    objs/src/http/ngx_http_upstream_round_robin.o
SSL_new                             objs/src/event/ngx_event_openssl.o
OCSP_resp_find_status               objs/src/event/ngx_event_openssl_stapling.o
PEM_read_bio_X509                   objs/src/event/ngx_event_openssl.o
BIO_new_file                        objs/src/event/ngx_event_openssl.o
SSL_CTX_new                         objs/src/event/ngx_event_openssl.o
ERR_peek_error                      objs/src/event/ngx_event_openssl.o
d2i_SSL_SESSION                     objs/src/event/ngx_event_openssl.o
DH_free                             objs/src/event/ngx_event_openssl.o
CRYPTO_free                         objs/src/event/ngx_event_openssl.o
SSL_CTX_load_verify_locations       objs/src/event/ngx_event_openssl.o
SSL_set_shutdown                    objs/src/event/ngx_event_openssl.o
i2d_OCSP_RESPONSE                   objs/src/event/ngx_event_openssl_stapling.o
d2i_OCSP_RESPONSE                   objs/src/event/ngx_event_openssl_stapling.o
PEM_read_bio_DHparams               objs/src/event/ngx_event_openssl.o
SSL_get_shutdown                    objs/src/event/ngx_event_openssl.o
SSL_CTX_get_ex_data                 objs/src/event/ngx_event_openssl.o
SSL_set_SSL_CTX                     objs/src/http/ngx_http_request.o
SSL_get_SSL_CTX                     objs/src/event/ngx_event_openssl.o
SSL_shutdown                        objs/src/event/ngx_event_openssl.o
SSL_CTX_set_ex_data                 objs/src/event/ngx_event_openssl.o
EVP_cleanup                         objs/src/event/ngx_event_openssl.o
SSL_CTX_set_session_id_context      objs/src/event/ngx_event_openssl.o
SSL_CTX_set_verify                  objs/src/event/ngx_event_openssl.o
X509_verify_cert_error_string       objs/src/http/ngx_http_request.o
EC_KEY_free                         objs/src/event/ngx_event_openssl.o
OCSP_cert_status_str                objs/src/event/ngx_event_openssl_stapling.o
OCSP_check_validity                 objs/src/event/ngx_event_openssl_stapling.o
SSL_CTX_set_client_CA_list          objs/src/event/ngx_event_openssl.o
MD5_Final                           objs/src/core/ngx_crypt.o
SSL_get_session                     objs/src/event/ngx_event_openssl.o
SSL_set_session                     objs/src/event/ngx_event_openssl.o
OCSP_CERTID_free                    objs/src/event/ngx_event_openssl_stapling.o
X509_STORE_CTX_get_error_depth      objs/src/event/ngx_event_openssl.o
SSL_get1_session                    objs/src/http/ngx_http_upstream_round_robin.o
SSL_CTX_set_timeout                 objs/src/event/ngx_event_openssl.o
SSL_CTX_get_timeout                 objs/src/event/ngx_event_openssl.o
SSL_CTX_use_certificate             objs/src/event/ngx_event_openssl.o
SSL_CTX_set_next_protos_advertised_cb objs/src/http/modules/ngx_http_ssl_module.o
SSL_CTX_ctrl                        objs/src/event/ngx_event_openssl.o
SSL_CTX_free                        objs/src/event/ngx_event_openssl.o
ENGINE_cleanup                      objs/src/event/ngx_event_openssl.o
OCSP_REQUEST_free                   objs/src/event/ngx_event_openssl_stapling.o
OCSP_REQUEST_new                    objs/src/event/ngx_event_openssl_stapling.o
ERR_peek_last_error                 objs/src/event/ngx_event_openssl.o
SSL_get_current_cipher              objs/src/event/ngx_event_openssl.o
ERR_peek_error_line_data            objs/src/event/ngx_event_openssl.o
X509_STORE_CTX_init                 objs/src/event/ngx_event_openssl_stapling.o
X509_STORE_CTX_free                 objs/src/event/ngx_event_openssl_stapling.o
X509_STORE_CTX_get_current_cert     objs/src/event/ngx_event_openssl.o
SSL_get_ex_data_X509_STORE_CTX_idx  objs/src/event/ngx_event_openssl.o
RSA_generate_key                    objs/src/event/ngx_event_openssl.o
X509_STORE_CTX_get_error            objs/src/event/ngx_event_openssl.o
OCSP_BASICRESP_free                 objs/src/event/ngx_event_openssl_stapling.o
i2d_SSL_SESSION                     objs/src/event/ngx_event_openssl.o
X509_email_free                     objs/src/event/ngx_event_openssl_stapling.o
X509_get_issuer_name                objs/src/event/ngx_event_openssl.o
SSL_CIPHER_description              objs/src/event/ngx_event_openssl.o
CRYPTO_malloc                       objs/src/event/ngx_event_openssl_stapling.o
BIO_ctrl                            objs/src/event/ngx_event_openssl.o
BIO_free                            objs/src/event/ngx_event_openssl.o
BIO_read                            objs/src/event/ngx_event_openssl.o
SSL_get_version                     objs/src/event/ngx_event_openssl.o
SSL_get_ex_data                     objs/src/event/ngx_event_openssl.o
SSL_CTX_set_info_callback           objs/src/event/ngx_event_openssl.o
SSLv23_method                       objs/src/event/ngx_event_openssl.o
SSL_set_ex_data                     objs/src/event/ngx_event_openssl.o
PEM_read_bio_X509_AUX               objs/src/event/ngx_event_openssl.o
SSL_CTX_set_cipher_list             objs/src/http/modules/ngx_http_ssl_module.o
SSL_set_verify                      objs/src/http/ngx_http_request.o
X509_STORE_CTX_get_ex_data          objs/src/event/ngx_event_openssl.o
EC_KEY_new_by_curve_name            objs/src/event/ngx_event_openssl.o
i2a_ASN1_INTEGER                    objs/src/event/ngx_event_openssl.o
SSL_CTX_get_verify_mode             objs/src/http/ngx_http_request.o
X509_get1_ocsp                      objs/src/event/ngx_event_openssl_stapling.o
SSL_CTX_set_tmp_rsa_callback        objs/src/http/modules/ngx_http_ssl_module.o
OCSP_response_status_str            objs/src/event/ngx_event_openssl_stapling.o
X509_get_subject_name               objs/src/event/ngx_event_openssl.o
SSL_library_init                    objs/src/event/ngx_event_openssl.o
ENGINE_by_id                        objs/src/event/ngx_event_openssl.o
ld: fatal: symbol referencing errors. No output written to objs/nginx
collect2: ld returned 1 exit status
gmake[1]: *** [objs/nginx] Error 1
gmake[1]: Leaving directory `/usr/share/src/nginx-1.3.12'
gmake: *** [build] Error 2

comment:5 Changed 7 years ago by fabler

  • Resolution set to invalid
  • Status changed from reopened to closed

As to your last building bug, it was due to openssl libs were built as 64-bit binaries, while you are trying to build 32-bit nginx binary. So you may build 64-bit nginx binary with statically linked openssl libs by:
configure --with-debug --with-http_ssl_module --with-openssl=/usr/src/openssl-1.0.1e --with-cc-opt=-m64 --with-ld-opt=-m64

or you could configure nginx to use already built ssl libs in /usr/lib/64 (I assume appropriate include files are also in the standard location):

configure --with-debug --with-http_ssl_module --with-cc-opt=-m64 --with-ld-opt=-m64

Note: See TracTickets for help on using tickets.