Want to use --emit-relocs in the linker step

Mahmood Naderan mahmood.nt at gmail.com
Mon Apr 27 14:15:17 UTC 2020


Thank you. That is right.
Regards,
Mahmood




On Mon, Apr 27, 2020 at 6:28 PM Andrei Belov <defan at nginx.com> wrote:

>
> > On 27 Apr 2020, at 16:53, Mahmood Naderan <mahmood.nt at gmail.com> wrote:
> >
> > Hi,
> > I want to add '--emit-relocs' at the linker stage while building nginx,
> I have edited the objs/Makefile to be like this:
> >
> >         $(LINK) -o objs/nginx \
> >         objs/src/core/nginx.o \
> >          ....
> >         objs/ngx_modules.o \
> >         -ldl -lpthread -lcrypt -lpcre -lz --emit-relocs \
> >         -Wl,-E
> >
> >
> > However, I get this error
> >
> > cc: error: unrecognized command line option '--emit-relocs'
> >
> > Any idea to fix that?
>
> As it is linker option, you should use -Wl,--emit-relocs instead.
>
> Also, the better way is to specify linker options via "--with-ld-opt"
> nginx configure option, e.g.:
>
> ./configure --with-ld-opt="-Wl,--emit-relocs"
>
>
> HTH,
>
> -- Andrei
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20200427/d573ea4c/attachment.htm>


More information about the nginx mailing list