Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 231468

Summary: dev-lang/erlang-12.2.3 crypto module is incorrectly linked
Product: Gentoo Linux Reporter: Wendall Cada <wendallc>
Component: New packagesAssignee: Christian Faulhammer (RETIRED) <fauli>
Status: RESOLVED FIXED    
Severity: normal CC: lang-misc+disabled
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://www.erlang.org/pipermail/erlang-bugs/2008-July/000869.html
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emege --info
12.2.2 config.log

Description Wendall Cada 2008-07-10 22:48:22 UTC
Compiling erlang-12.2.2 with gcc-3.4.6-r2 hardened compiler with ssl USE flag enabled. Compiler fails to properly link crypto_drv.so against /usr/lib/libcrypto.so.0.9.8

Here is the output:
ldd /usr/lib/erlang/lib/crypto-1.5.1.1/priv/lib/crypto_drv.so
        linux-gate.so.1 =>  (0x5376b000)
        libc.so.6 => /lib/libc.so.6 (0x535b4000)
        /lib/ld-linux.so.2 (0x5376c000)

I should be seeing a line like this:
libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0xb7ea5000)

Here is the specific failure message:
Erlang (BEAM) emulator version 5.6.2 [source] [smp:4] [async-threads:0]

Eshell V5.6.2  (abort with ^G)
1> crypto:start().
sh: line 0: exec: crypto_drv: not found
                                       {error,{shutdown,{crypto_app,start,[normal,[]]}}}

I can attach any other requested debug output. I think this is fairly self-explanatory. I see several other references to this bug other places, but with different compilers, and different versions of Erlang. I'm sure this is an upstream issue, just not sure it there is an appropriate patch.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2008-07-10 23:23:33 UTC
Please attach your `emerge --info' too.
Comment 2 Christian Faulhammer (RETIRED) gentoo-dev 2008-07-11 07:00:09 UTC
Apart from emerge --info, I'd like to have your config.log...and a try with 12.2.3.  You seem to run into this problem often. :)
Comment 3 Christian Faulhammer (RETIRED) gentoo-dev 2008-07-11 07:09:17 UTC
Ok, I see the problem, I have it on a non-hardened machine, too.
Comment 4 Wendall Cada 2008-07-11 19:59:38 UTC
I'm just getting back to testing on this bug. I just hadn't complained about it in a while. I will attach emerge --info and my config.log as well. I'll give 12.2.3 a shot also. Thanks for looking into fixing this.
Comment 5 Wendall Cada 2008-07-11 20:03:43 UTC
Created attachment 160137 [details]
emege --info
Comment 6 Wendall Cada 2008-07-11 21:04:25 UTC
Created attachment 160141 [details]
12.2.2 config.log
Comment 7 Wendall Cada 2008-07-11 21:22:28 UTC
dev-lang/erlang-12.2.3 has same issue:

Erlang (BEAM) emulator version 5.6.3 [source] [smp:4] [async-threads:0]

Eshell V5.6.3  (abort with ^G)
1> crypto:start().
sh: line 0: exec: crypto_drv: not found
                                       {error,{shutdown,{crypto_app,start,[normal,[]]}}}

Let me know if you need the config log for this.
Comment 8 Christian Faulhammer (RETIRED) gentoo-dev 2008-07-12 09:14:01 UTC
(In reply to comment #7)
> Let me know if you need the config log for this.

 I don't.  Bug is reported upstream, let's see what they tell.
Comment 9 Wendall Cada 2008-07-14 23:49:32 UTC
Linking the file manually like this fixes the problem:
gcc -shared -o /usr/lib/erlang/lib/crypto-1.5.2/priv/lib/crypto
_drv.so /usr/lib/erlang/lib/crypto-1.5.2/priv/obj/crypto_drv.o /usr/lib/libcrypto.so

I think the problem is in the Makefile found at lib/crypto/c_src/Makefile.in line 97. If you try to link against /usr/lib/libcrypto.a a TEXTREL error is generated:
/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/bin/ld: warning: creating a DT_TEXTREL in object.
Comment 10 Christian Faulhammer (RETIRED) gentoo-dev 2008-07-17 10:06:03 UTC
Adding URL for upstream bug report, no reaction yet.  Not much time at the moment, maybe I will try to tweak the Makefile soon.
Comment 11 Christian Faulhammer (RETIRED) gentoo-dev 2008-08-07 08:05:30 UTC
I haven't forgotten you, but I have limited Internet access at the moment (and for months to come).  Anyway.  Please modify the ebuild in a way that configure has --enable-dynamic-ssl-lib, and maybe remove the sed lines for DYNAMIC_SSL in src_unpack.  Please report back.
Comment 12 Wendall Cada 2008-08-07 21:43:08 UTC
I will do this within the next few days and attach the modified ebuild. Thanks for the feedback. I fixed the problem temporarily by linking the library, so I'm in no rush for a fix.
Comment 13 Christian Faulhammer (RETIRED) gentoo-dev 2008-08-12 08:19:45 UTC
It did the trick on my home system.