Welcome! Log In Create A New Profile

Advanced

Compile NGINX as Position Independent Executable (Compile Error)

Anonymous User
October 24, 2015 10:26AM
Hey NGINX Devs,
I want to compile and run NGINX on OSv from Cloudius https://github.com/ cloudius-systems/osv.For that I have to compile NGINX as Position Independent Code (-fPIC / -fPIE).

The issue I currently have is that when I run 'make build' after executing the ./configure script in the source folder I get following error:

cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -fPIE -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs  -o objs/src/os/unix/ngx_process_ cycle.o \ src/os/unix/ngx_process_cycle. o src/os/unix/ngx_process_cycle. c: In function ‘ngx_master_process_cycle’:

src/os/unix/ngx_process_cycle. c:124:5: error: implicit declaration of function ‘setproctitle’ [-Werror=implicit-function- declaration]
ngx_setproctitle(title);
     ^
cc1: all warnings being treated as errors
make[1]: *** [objs/src/os/unix/ngx_process_ cycle.o] Error 1
make[1]: Leaving directory `/tmp/thesis_vs/osv_proj/ nginx/upstream/nginx-1..8.0'
make: *** [build] Error 2



My current workflow to compile NGNIX with fPIE is as follows:

- Load Sources (1.8 Stable Release)
- Patch source files from http://git.buildroot.net/ buildroot/tree/package/nginx to pass some of the configure checks and adjust as needed for OSv Operating System.
- Export flags for configure script as required for OSv



export ngx_force_gcc_have_atomic=yes \

export ngx_force_c99_have_variadic_ macros=yes \

export ngx_force_gcc_have_variadic_ macros=yes \

export ngx_force_have_epoll=yes \

export ngx_force_have_sendfile=yes \

export ngx_force_have_sendfile64=yes \ ?!??!

export ngx_force_have_pr_set_ dumpable=yes \ ?!?!

export ngx_force_sys_nerr=100 \

export ngx_force_have_map_anon=yes \

export ngx_force_have_posix_sem=yes\

export ngx_force_have_sysvshm=yes\

export ngx_force_have_map_devzero=no




4. ./configure --with-cc-opt="-fPIE" \

--with-ld-opt="-shared" \
--prefix=/none \
--conf-path=/data/conf/nginx. conf \
--sbin-path=/none \
--pid-path=/tmp/nginx.pid \
--lock-path=/tmp/nginx.lock \
--error-log-path=/tmp/error. log \
--http-log-path=/tmp/access. log \
--http-client-body-temp-path=/ tmp/client-body \
--http-proxy-temp-path=/tmp/ proxy \
--http-fastcgi-temp-path=/tmp/ fastcgi \
--http-scgi-temp-path=/tmp/ scgi \
--http-uwsgi-temp-path=/tmp/ uwsgi \
--without-http_rewrite_module \
--with-http_ssl_module \
--with-ipv6 \
--with-pcre 

5. make build


Im using Ubuntu 14.04 and gcc-4.8 to compile NGINX
I have no idea if / what I'm doing wrong here. Any help is highly appreciated. :) 
Kind regards,
Vincent
P.S.: Sorry for sending it on both lists but I wasn't sure which is the right one for this kind of question._______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Compile NGINX as Position Independent Executable (Compile Error)

Anonymous User 549 October 24, 2015 10:26AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 163
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