Welcome! Log In Create A New Profile

Advanced

Nginx1.13.4 static on Debian 9 (Stretch)

Claudiu Rad
August 14, 2017 09:16AM
Hello,

I'm trying a static build of nginx. Sorry if this may have been answered
before but I couldn't find anything closer than
https://trac.nginx.org/nginx/ticket/903.
Downloaded http://nginx.org/download/nginx-1.13.4.tar.gz. In the sources
folder:

../configure --prefix=/opt/nginx --with-cc-opt="-static -static-libgcc" --with-ld-opt="-Bstatic -static -static-libgcc -static-libstdc++"

Build fails with the following result

....
objs/ngx_modules.o \
-Bstatic -static -static-libgcc -static-libstdc++ -ldl -lpthread -lcrypt -lpcre -lz
objs/src/core/nginx.o: In function `ngx_load_module':
/tmp/nginx-static/nginx-1.13.4/src/core/nginx.c:1522: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
objs/src/os/unix/ngx_process_cycle.o: In function `ngx_worker_process_init':
/tmp/nginx-static/nginx-1.13.4/src/os/unix/ngx_process_cycle.c:835: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
objs/src/core/nginx.o: In function `ngx_set_user':
/tmp/nginx-static/nginx-1.13.4/src/core/nginx.c:1228: warning: Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/nginx-static/nginx-1.13.4/src/core/nginx.c:1216: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
objs/src/core/ngx_inet.o: In function `ngx_inet_resolve_host':
/tmp/nginx-static/nginx-1.13.4/src/core/ngx_inet.c:1127: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `sljit_generate_code':
(.text+0x816): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `sljit_generate_code':
(.text+0x91b): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `sljit_generate_code':
(.text+0xcc5): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `sljit_generate_code':
(.text+0xd28): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `sljit_free_exec':
(.text+0xd6c): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `pcre_jit_free_unused_memory':
(.text+0x290d9): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `sljit_free_exec':
(.text+0xddb): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libpcre.a(libpcre_la-pcre_jit_compile.o): In function `pcre_jit_free_unused_memory':
(.text+0x29149): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info.part.4':
(.text+0x1692): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_bases':
(.text+0x1717): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_table_bases':
(.text+0x17eb): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__deregister_frame_info_bases':
(.text+0x188e): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__deregister_frame_info_bases':
(.text+0x1916): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
(.text+0x19e8): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
(.text+0x1a32): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
(.text+0x1b2b): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info.part.4':
(.text+0x16b1): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_bases':
(.text+0x1736): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/x86_64-linux-gnu/6/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_table_bases':
(.text+0x180a): undefined reference to `pthread_mutex_unlock'
collect2: error: ld returned 1 exit status
objs/Makefile:226: recipe for target 'objs/nginx' failed
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory '/tmp/nginx-static/nginx-1.13.4'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

Am I missing anything? I tried passing various static instructions to
CC/LD as seen for example here: https://trac.nginx.org/nginx/ticket/903.

What's the right way to do this?

Thank you for your help.

--
Claudiu

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx1.13.4 static on Debian 9 (Stretch)

Claudiu Rad August 14, 2017 09:16AM

Re: Nginx1.13.4 static on Debian 9 (Stretch)

Maxim Dounin August 14, 2017 09:46AM

Re: Nginx1.13.4 static on Debian 9 (Stretch)

Claudiu Rad August 14, 2017 02:00PM

Re: Nginx1.13.4 static on Debian 9 (Stretch)

Claudiu Rad August 16, 2017 08:40AM

Re: Nginx1.13.4 static on Debian 9 (Stretch)

Maxim Dounin August 16, 2017 10:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 301
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready