I'm trying to compile/install OpenLDAP from source on Ubuntu 14.04, ./configure goes well, make goes well too, but when I do amake install I get this:

/usr/bin/ld: /usr/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
/usr/lib/libssl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
libtool: install: error: relink `libldap.la' with the above command before installing it
make[2]: *** [install-local] Error 1
make[2]: Leaving directory `/home/user/Downloads/openldap-2.4.40/libraries/libldap'
make[1]: *** [install-common] Error 1
make[1]: Leaving directory `/home/user/Downloads/openldap-2.4.40/libraries'
make: *** [install-common] Error 1

It does mention above to compile using -fPIC which I have as follows:


So I don't think that's the problem, I think it has more to do with the relink issue, or the bad value error.

Any ideas how I can get this to work?

  • I was able to fix this using: -D_GNU_SOURCE – jfha73 Jan 31 '15 at 15:17

I was able to fix it using:


Along with -fPIC for CFLAGS and CPPFLAGS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.