Welcome! Log In Create A New Profile

Advanced

Force linking to static archives during make?

Jeffrey Walton
December 18, 2013 07:54AM
This should be my last build question.

$ ./auto/configure --with-http_ssl_module ...
--with-cc-opt="-I/usr/local/ssl/include"
--with-ld-opt="-L/usr/local/ssl/lib /usr/local/ssl/lib/libssl.a
/usr/local/ssl/lib/libcrypto.a -ldl"
....
$ make
....

Results in the following. Note that OpenSSL is still dynamically linked:

$ ldd objs/nginx
linux-vdso.so.1 => (0x00007fffd0dfe000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003ebf600000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003ebfa00000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x0000003ed3e00000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x0000003ec0a00000)
libssl.so.1.0.0 => not found
libcrypto.so.1.0.0 => not found
libz.so.1 => /lib64/libz.so.1 (0x0000003ebfe00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003ebf200000)
/lib64/ld-linux-x86-64.so.2 (0x0000003ebea00000)
libfreebl3.so => /lib64/libfreebl3.so (0x0000003ec7a00000)

*****

Adding -Bstatic does not help even though its clearly on the link command line:

$ ./auto/configure --with-http_ssl_module ...
--with-cc-opt="-I/usr/local/ssl/include" --with-ld-opt="-Bstatic
-L/usr/local/ssl/lib /usr/local/ssl/lib/libssl.a
/usr/local/ssl/lib/libcrypto.a -ldl"
....
$ make
....
objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
objs/ngx_modules.o \
-Bstatic -L/usr/local/ssl/lib /usr/local/ssl/lib/libssl.a
/usr/local/ssl/lib/libcrypto.a -ldl -lpthread -lcrypt -lpcre -lssl
-lcrypto -lz
....
$ ldd objs/nginx
linux-vdso.so.1 => (0x00007fffd4fc6000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003ebf600000)
...
libssl.so.1.0.0 => not found
libcrypto.so.1.0.0 => not found

*****

Omitting -L/usr/local/ssl/lib results in a failed configure.

*****

How does one force nginx to use static linking for a library?

Thanks in advance.

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

Force linking to static archives during make?

Jeffrey Walton December 18, 2013 07:54AM

Re: Force linking to static archives during make?

Ruslan Ermilov December 18, 2013 07:50AM

Re: Force linking to static archives during make?

Jeffrey Walton December 18, 2013 12:04PM

Re: Force linking to static archives during make?

Francis Daly December 18, 2013 05:14PM

Re: Force linking to static archives during make?

Maxim Dounin December 19, 2013 10:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 76
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready