Are you sure that all of your stuff is building with -fPIC? I was having a similar problem, but once I made sure everything compiled with -fPIC, my errors went away.
-Tom Thomas Floodeen, Jr. Mentor Graphics BSD 720.494.1133 From: owner-openssl-us...@openssl.org [mailto:owner-openssl-us...@openssl.org] On Behalf Of Frank E. Gruman Sent: Thursday, November 10, 2011 8:31 AM To: openssl-users@openssl.org Subject: RE: Error when compiling static openSSL (libcrypto.a) into shared library I have since also reproduced this error when compiliing with openssl-1.0.0e (LATEST). Is there no one out there having challenges with this sort of compile? Alternatives for getting this working on a 64-bit system? Regards, Frank ________________________________ From: owner-openssl-us...@openssl.org [mailto:owner-openssl-us...@openssl.org] On Behalf Of Frank E. Gruman Sent: Thursday, November 03, 2011 11:09 AM To: openssl-users@openssl.org Subject: Error when compiling static openSSL (libcrypto.a) into shared library Hello all, I am trying to compile a static libcrypto.a into a shared library. Every time I do this I receive the following error: [100%] Building CXX object CMakeFiles/testprovider.dir/soapTestServiceGatewayProxy.cpp.o Linking CXX shared library libtestprovider.so /usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/libcrypto.a(x86_64cpuid.o): relocation R_X86_64_PC32 against `OPENSSL_cpuid_setup' can not be used when making a shared object; recompile with -fPIC Here are the environments I have tested this with: CentOS 5 (x64) - gcc 4.1.2-51.el5 - openssl-0.9.8r - configured with ./config -fPIC RHEL 5.5 (x64) - gcc 4.1.2-15.el5 - openssl-0.9.8r - configured with ./config -fPIC I have tried passing -Wl,-Bsymbolic to the compiler when linking my shared library to libcrypto.a and had no luck. I did try to compile after passing the no-asm flag and it allowed me to link, but I have grave concerns about the performance implications. The library is very performance critical. As it is now, we can test functionality using a shared libcrypto.so, but this is not ideal for production testing if we can avoid it. Any thoughts? I had found some information out here - http://rt.openssl.org/Ticket/Display.html?id=2466&user=guest&pass=guest . Does anyone know in which release the formal patch noted in that link was included? Regards, Frank ________________________________ This message is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please notify the sender by reply transmission and delete the message. The contents of this message that do not relate to the official business of our company shall be understood as neither given nor endorsed by it. ________________________________ This message is intended only for the use of the individual or entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this message in error, please notify the sender by reply transmission and delete the message. The contents of this message that do not relate to the official business of our company shall be understood as neither given nor endorsed by it.