Answer the question
In order to leave comments, you need to log in
nginx static build?
Build a static nginx binary:
./configure --prefix=nginx-static --with-cc-opt="-static -static-libgcc" \
--with-ld-opt="-static" --with-cpu-opt=generic \
--with-mail --with-ipv6 --with-poll_module --with-select_module \
--with-select_module --with-poll_module \
--with-http_ssl_module --with-http_realip_module \
--with-http_addition_module --with-http_sub_module --with-http_dav_module \
--with-http_flv_module --with-http_mp4_module --with-http_gunzip_module \
--with-http_gzip_static_module --with-http_auth_request_module \
--with-http_random_index_module --with-http_secure_link_module \
--with-http_degradation_module --with-http_stub_status_module \
--with-mail --with-mail_ssl_module --with-openssl=./openssl-${OPENSSL_VERSION} \
--with-pcre=./pcre-${PCRE_VERSION}
checking for OS
+ Linux 2.6.32-754.30.2.el6.x86_64 x86_64
checking for C compiler ... found
+ using GNU C compiler
+ gcc version: 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC)
checking for gcc -pipe switch ... found
checking for --with-ld-opt="-static" ... not found
./configure: error: the invalid value in --with-ld-opt="-static"
cat autoconf.err
----------------------------------------
checking for C compiler
----------------------------------------
checking for gcc -pipe switch
----------------------------------------
checking for --with-ld-opt="-static"
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
----------
#include <sys/types.h>
int main(void) {
;
return 0;
}
----------
cc -static -static-libgcc -o objs/autotest objs/autotest.c -static
----------
Answer the question
In order to leave comments, you need to log in
Apparently, installing the
yum install glibc-static package should solve the problem
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question