# Nginx openssl compilation problem

**URL:** <https://www.ruby-forum.com/t/nginx-openssl-compilation-problem/228550>\
**Category:** NGINX\
**Created:** [April 26, 2013, 11:10pm UTC](https://www.ruby-forum.com/t/nginx-openssl-compilation-problem/228550 "2013-04-26T23:10:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fleshgrinder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/e480ec/32.png) [@Fleshgrinder](https://www.ruby-forum.com/u/Fleshgrinder)\
**Post date:** [April 26, 2013, 11:10pm UTC](https://www.ruby-forum.com/t/nginx-openssl-compilation-problem/228550/1 "2013-04-26T23:10:50Z")

</div>

Hello, I’m desparately trying to compile the latest nginx with the  
latest  
OpenSSL.

In short I’m grabbing the latest nginx tar.gz (1.4.0 but had the same  
problem with 1.3.16) and the latest OpenSSL tar.gz (1.0.1e but have the  
same  
problem with 1.0.1d) extract them and want to compile them. Everything  
wents  
smooth until the following point:

/usr/lib/gcc/x86\_64-linux-gnu/4.7/…/…/…/x86\_64-linux-gnu/crt1.o: In  
function `_start': (.text+0x20): undefined reference to `main’  
collect2: error: ld returned 1 exit status  
make[4]: \*\*\* [link\_app.] Error 1  
make[4]: Leaving directory `/tmp/openssl-1.0.1e/test' make[3]: *** [md2test] Error 2 make[3]: Leaving directory `/tmp/openssl-1.0.1e/test’  
make[2]: \*\*\* [build\_tests] Error 1  
make[2]: Leaving directory `/tmp/openssl-1.0.1e' make[1]: *** [/tmp/openssl-1.0.1e/.openssl/include/openssl/ssl.h] Error 2 make[1]: Leaving directory `/tmp/nginx-1.4.0’  
make: \*\*\* [build] Error 2

My ./configure line looks like the following:

./configure --prefix=/usr/local --sbin-path=/usr/local/sbin  
–conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid  
–lock-path=/var/lock/nginx.lock  
–error-log-path=/var/log/nginx/error.log  
–http-log-path=/var/log/nginx/access.log  
–http-client-body-temp-path=/dev/shm/nginx/client-body/tmp  
–http-fastcgi-temp-path=/dev/shm/nginx/fastcgi/tmp  
–with-pcre=/tmp/pcre-8.32 --with-openssl=/tmp/openssl-1.0.1e  
–with-zlib=/tmp/zlib --with-cc-opt=‘-O3 -m64’ --with-ld-opt=‘-m64’  
–with-ipv6 --with-http\_gzip\_static\_module --with-http\_ssl\_module  
–with-http\_spdy\_module --with-md5=/tmp/openssl-1.0.1e --with-md5-asm  
–with-sha1=/tmp/openssl-1.0.1e --with-sha1-asm --with-pcre-jit  
–without-http\_autoindex\_module --without-http\_auth\_basic\_module  
–without-http\_browser\_module --without-http\_geo\_module  
–without-http\_limit\_conn\_module --without-http\_limit\_req\_module  
–without-http\_map\_module --without-http\_memcached\_module  
–without-http\_proxy\_module --without-http\_referer\_module  
–without-http\_scgi\_module --without-http\_split\_clients\_module  
–without-http\_ssi\_module --without-http\_upstream\_ip\_hash\_module  
–without-http\_userid\_module --without-http\_uwsgi\_module  
–without-mail\_pop3\_module --without-mail\_imap\_module  
–without-mail\_smtp\_module  
–add-module=/tmp/nginx-upload-progress-module  
–add-module=/tmp/nginx-upstream-fair

Of course the PCRE, Zlib, nginx-upload-progress-module and  
nginx-upstream-fair sources are in place and working just fine. Some  
more  
info on the environment:

gcc (Debian 4.7.2-5) 4.7.2  
cpp (Debian 4.7.2-5) 4.7.2  
pcre 8.32  
zlib and additional modules from github master

I know that this is some gcc linker problem and I tryed several -lxxx  
options or leaving the -O3 / -m64 options, nothing seems to help and I  
hope  
somebody can point me in the right direction.

Many thanks in advance!  
Richard

Posted at Nginx Forum:

> **[nginx openssl compilation problem](https://forum.nginx.org/read.php?2,238671,238671#msg-238671)**
>
> Hello, I'm desparately trying to compile the latest nginx with the latest OpenSSL. In short I'm grabbing the latest nginx tar.gz (1.4.0 but had the same problem with 1.3.16) and the latest OpenSSL tar.gz (1.0.1e but have the same problem with 1.0.1d)...

---

<div class="post-metadata">

**Author:** ![Fleshgrinder](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/e480ec/32.png) [@Fleshgrinder](https://www.ruby-forum.com/u/Fleshgrinder)\
**Post date:** [April 29, 2013, 11:38am UTC](https://www.ruby-forum.com/t/nginx-openssl-compilation-problem/228550/2 "2013-04-29T11:38:42Z")

</div>

Finally I was able to compile nginx and of course I’d like to share this  
with you. Seems like the order of the configure options was the problem.  
I  
used the following configure argument order and it compiled without any  
problems.

nginx version: nginx/1.4.0  
built by gcc 4.7.2 (Debian 4.7.2-5)  
TLS SNI support enabled  
configure arguments: --user=www-data --group=www-data  
–prefix=/usr/local  
–sbin-path=/usr/local/sbin --conf-path=/etc/nginx/nginx.conf  
–pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock  
–error-log-path=/var/log/nginx/error.log  
–http-log-path=/var/log/nginx/access.log  
–http-client-body-temp-path=/dev/shm/nginx/client-body/tmp  
–http-fastcgi-temp-path=/dev/shm/nginx/fastcgi/tmp --with-ipv6  
–with-http\_gzip\_static\_module --with-http\_ssl\_module  
–with-http\_spdy\_module  
–with-openssl=/usr/local/src/nginx/openssl-1.0.1e  
–with-md5=/usr/local/src/nginx/openssl-1.0.1e --with-md5-asm  
–with-sha1=/usr/local/src/nginx/openssl-1.0.1e --with-sha1-asm  
–with-pcre=/usr/local/src/nginx/pcre-8.32 --with-pcre-jit  
–with-zlib=/usr/local/src/nginx/zlib --without-http\_autoindex\_module  
–without-http\_auth\_basic\_module --without-http\_browser\_module  
–without-http\_geo\_module --without-http\_limit\_conn\_module  
–without-http\_limit\_req\_module --without-http\_map\_module  
–without-http\_memcached\_module --without-http\_proxy\_module  
–without-http\_referer\_module --without-http\_scgi\_module  
–without-http\_split\_clients\_module --without-http\_ssi\_module  
–without-http\_upstream\_ip\_hash\_module --without-http\_userid\_module  
–without-http\_uwsgi\_module --without-mail\_pop3\_module  
–without-mail\_imap\_module --without-mail\_smtp\_module  
–add-module=/usr/local/src/nginx/nginx-upload-progress-module  
–add-module=/usr/local/src/nginx/nginx-upstream-fair

Posted at Nginx Forum:

> **[Re: nginx openssl compilation problem](https://forum.nginx.org/read.php?2,238671,238705#msg-238705)**
>
> Hello, I'm desparately trying to compile the latest nginx with the latest OpenSSL. In short I'm grabbing the latest nginx tar.gz (1.4.0 but had the same problem with 1.3.16) and the latest OpenSSL tar.gz (1.0.1e but have the same problem with 1.0.1d)...
