1.13.9 compile errors

Evgenij Krupchenko nginx-forum at forum.nginx.org
Mon Mar 12 10:32:23 UTC 2018

i'm building custom nginx binary on debian 9 using latest zlib and openssl

./configure \
--prefix=/nginx \
--sbin-path=/nginx/sbin/nginx-https \
--conf-path=/nginx/conf/https \
--pid-path=/run/nginx-https.pid \
--error-log-path=/log/nginx-https_error.log \
--http-log-path=/log/nginx-https_access.log \
--http-client-body-temp-path=/nginx/tmp/https_client-body \
--http-proxy-temp-path=/nginx/tmp/https_proxy \
--http-fastcgi-temp-path=/nginx/tmp/http_fastcgi \
--user=www \
--group=www \
--without-select_module \
--without-poll_module \
--without-http_ssi_module \
--without-http_userid_module \
--without-http_geo_module \
--without-http_map_module \
--without-http_split_clients_module \
--without-http_referer_module \
--without-http_uwsgi_module \
--without-http_scgi_module \
--without-http_memcached_module \
--without-http_limit_conn_module \
--without-http_limit_req_module \
--without-http_empty_gif_module \
--without-http_browser_module \
--without-http_upstream_hash_module \
--without-http_upstream_ip_hash_module \
--without-http_upstream_least_conn_module \
--without-http_upstream_keepalive_module \
--without-http_upstream_zone_module \
--with-threads \
--with-file-aio \
--with-zlib=/install/zlib-1.2.11 \
--with-openssl=/install/openssl-1.1.1-pre2 \

in the end of "make" i got this:

objs/ngx_modules.o \
-ldl -lpthread -lpthread -lcrypt -lpcre
/install/openssl-1.1.1-pre2/.openssl/lib/libcrypto.a -ldl
/install/zlib-1.2.11/libz.a \
/install/openssl-1.1.1-pre2/.openssl/lib/libcrypto.a(threads_pthread.o): In
function `fork_once_func':
threads_pthread.c:(.text+0x16): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status
objs/Makefile:223: recipe for target 'objs/nginx' failed
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory '/install/nginx-1.13.9'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

previous version 1.13.8 and all before was build successfully with the same
configure parameters.

also, i've found this post:
as suggested, after "configure" i've modified objs/Makefile: removed the
first -lpthread and the second -lpthread moved to the end of the line. in my
case it was the line #331:

-ldl -lpthread -lpthread -lcrypt -lpcre
/install/openssl-1.1.1-pre2/.openssl/lib/libcrypto.a -ldl
/install/zlib-1.2.11/libz.a \

-ldl -lcrypt -lpcre /install/openssl-1.1.1-pre2/.openssl/lib/libssl.a
/install/openssl-1.1.1-pre2/.openssl/lib/libcrypto.a -ldl
/install/zlib-1.2.11/libz.a -lpthread \

and then it builds successfully.
and also success when i'm using openssl-1.0.2n in configure parameters.

so the problem only occurs in combination nginx-1.13.9 + openssl-1.1.1-pre2

and my question is: someone would fix bug this in the next 1.13.10 or should
we now always edit the makefile before compiling?
or this is not a bug and i'm just missing something?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,279002,279002#msg-279002

More information about the nginx mailing list