On CentOS 5.4, OpenSSL compiles fine without 'shared' option. But when I passed that option the compilation fails with:
/usr/bin/ld: libcrypto.a(x86_64-gcc.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
When I try: ./config shared CFLAGS=-fPIC
that doesn't work.
What can I do to get OpenSSL to compile with the 'shared' option?
Thanks
Download the ARM GCC toolchain through your package manager; on Ubuntu, sudo apt-get install gcc-arm-linux-gnueabihf . Download a build of the toolchain from Linaro. If you are on Linux, grab the i686 version (non-mingw32). You can find the actual binaries under the bin/ directory after expanding the archive.
Same problem here, BUT usually Makefiles will consider environment variables for compiler or linker options.
So, if you place the -fPIC
option before calling the configure script, it should take care of it. You can do it with:
CFLAGS=-fPIC ./config shared --prefix=/your/path
or
export CFLAGS=-fPIC ./config shared --prefix=/your/path
It worked for me.
There is an option -fXXX
that you can pass to config so you can do it with:
./config -fPIC shared
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With