I'm trying to build nginx packages from a deb package source (from the popular, semi-official nginx mainline PPA) but linked to an openssl fork that contains ChaCha20 and Poly1305 additions.
I configured openssl with ./config no-ssl2 no-ssl3 shared -fPIC
(I also set CFLAGS="-fPIC"
), which worked and built successfully, and I can see -fPIC
appearing in all the compilation steps during the build. When I build the nginx package with dpkg-buildpackage -b
pointing at it (I edited auto/options
and set OPENSSL=/home/admin/openssl
), I get this error:
objs/ngx_modules.o \
-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -ldl -lpthread -lpthread -lcrypt -lpam -lexpat -lpcre /root/openssl/.openssl/lib/libssl.a
/home/admin/openssl/.openssl/lib/libcrypto.a -ldl -lz -lxml2 -lxslt -lexslt -lgd -lGeoIP \
-Wl,-E /usr/bin/ld: /home/admin/openssl/.openssl/lib/libssl.a(s23_meth.o):
relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/home/admin/openssl/.openssl/lib/libssl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Any idea what I'm doing wrong, since I did build it with -fPIC
?