[erlang-patches] Crypto Compile Problem on x86_64 OTP-R11B

Raimo Niskanen raimo+erlang-patches@REDACTED
Mon Nov 19 09:14:48 CET 2007


It might have been clear, but I did not get it. What is the patch?
Is it to relink crypto_drv.so using gcc 4.0, or is it just to
manually relink crypto_drv.so using gcc 4.1..

If the problem is in gcc 4.1, do you know if it is a 4.1 bug and has
it been reported to gcc - will it be fixed in gcc, or do you know
what is the root cause?

We have suspected the problem being the OpenSSL libraries not
being linked to allow building other (our) shared libraries (.so)
that themselves contain statically linked OpenSSL libraries (libcrypto.a),
but if it is a gcc 4.1 problem we are interested to know for sure.
I might confuse this problem with another problem where we can not
build crypto_drv.so on OpenBSD against libcrypto.a...



On Sun, Nov 18, 2007 at 06:57:39PM +0200, Daniel Schutte wrote:
> I have seen a few postings on the web regarding this error - specifically in 
> the e-jabberd lists.  The solution is given as compiling with gcc 4.0 instead 
> of 4.1.
> Erlang Compiles fine, it's just the crypto module that is incomplete - more 
> specifically the driver.
> 
> 
> ================ ENVIRONMENT =====
> ================ OS =====
> (CentOS 5.0)
> Linux cupid.erlfinsys.net 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22 08:32:28 EDT 
> 2007 x86_64 x86_64 x86_64 GNU/Linux
> 
> ================ OpenSSL =====
> openssl-0.9.8b-8.3.el5_0.2
> 
> ================ GCC =====
> 
> [olympus@REDACTED otp_src_R11B-5]$ gcc --version
> gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
> Copyright (C) 2006 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> ================ Erlang =====
> Erlang OTP-R11B-5
> 
> ================ ERROR =====
> in the make file the following appears:
> 
> /usr/bin/ld: /usr/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
> /usr/bin/ld: final link failed: Bad value
> collect2: ld returned 1 exit status
> make[4]: *** [../priv/lib/x86_64-unknown-linux-gnu/crypto_drv.so] Error 1
> make[3]: *** [opt] Error 2
> 
> ============================
> Tracing this you get this command that failed
> 
> [olympus@REDACTED c_src]$ 
> gcc -shared  -o ../priv/lib/x86_64-unknown-linux-gnu/crypto_drv.so ../priv/obj/x86_64-unknown-linux-gnu/crypto_drv.o  /usr/lib64/libcrypto.a
> /usr/bin/ld: /usr/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
> /usr/bin/ld: final link failed: Bad value
> 
> ============================
> else you will find it doing this: 
> 
> 1> crypto:start().
> exec: 1: ok
> 2> crypto_drv: not found
> 
> =ERROR REPORT==== 25-Oct-2006::12:57:02 ===
> ** Generic server crypto_server terminating
> ** Last message in was {'EXIT',#Port<0.96>,normal}
> ** When Server state == {#Port<0.96>,[]}
> ** Reason for termination ==
> ** {port_died,normal}
> exec: 1: crypto_drv: not found
> 
> 
> ============================= Solution / Fix ===
> 
> Right or wrong this fixed the problem
> 
> after 
> 
> ./configure
> make
> 
> go to the directory  %ERL_TOP%/lib/crypto/c_src
> issue the command:
> 
> gcc -shared  -o ../priv/lib/x86_64-unknown-linux-gnu/crypto_drv.so ../priv/obj/x86_64-unknown-linux-gnu/crypto_drv.o  /usr/lib64/libcrypto.so
> 
> now do: make install
> 
> crypto:start().
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-patches

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-patches mailing list