1 |
commit: 9c07154b652829899c18d44cc3ff78101041723b |
2 |
Author: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jun 4 18:46:45 2019 +0000 |
4 |
Commit: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 4 18:47:59 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c07154b |
7 |
|
8 |
sys-apps/rng-tools: fix a linking problem with USE=pkcs11 #684228 |
9 |
|
10 |
In function init_pkcs11_entropy_source(), there is a call to |
11 |
ERR_reason_error_string(), which is defined in libcrypto. This causes |
12 |
linking problems for rng-tools under certain configurations: |
13 |
|
14 |
$ ./configure --disable-jitterentropy --without-nistbeacon --with-pkcs11 |
15 |
... |
16 |
$ make |
17 |
... |
18 |
gcc -pthread -g -O2 -pthread -o rngd rngd-rngd.o rngd-rngd_entsource.o |
19 |
rngd-rngd_linux.o rngd-util.o rngd-rngd_rdrand.o rdrand_asm.o |
20 |
rngd-rngd_pkcs11.o librngd.a -lsysfs -lgcrypt -lsysfs -lp11 -lgcrypt |
21 |
-lsysfs |
22 |
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: |
23 |
rngd-rngd_pkcs11.o: undefined reference to symbol |
24 |
'ERR_reason_error_string@@OPENSSL_1_1_0' |
25 |
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: |
26 |
/usr/lib64/libcrypto.so.1.1: error adding symbols: DSO missing from |
27 |
command line |
28 |
collect2: error: ld returned 1 exit status |
29 |
make[2]: *** [Makefile:609: rngd] Error 1 |
30 |
make[2]: Leaving directory '/tmp/rng-tools' |
31 |
make[1]: *** [Makefile:888: all-recursive] Error 1 |
32 |
make[1]: Leaving directory '/tmp/rng-tools' |
33 |
make: *** [Makefile:458: all] Error 2 |
34 |
|
35 |
This symbol is defined in libcrypto: |
36 |
|
37 |
$ readelf --dyn-syms /usr/lib64/libcrypto.so | grep ERR_reason_error_string |
38 |
314: 000000000012cf60 155 FUNC GLOBAL DEFAULT 12 |
39 |
ERR_reason_error_string@@OPENSSL_1_1_0 |
40 |
|
41 |
Linking rngd against libcrypto when pkcs11 is enabled fixes the issue. |
42 |
|
43 |
Bug: https://github.com/nhorman/rng-tools/pull/61 |
44 |
Closes: https://bugs.gentoo.org/684228 |
45 |
Package-Manager: Portage-2.3.66, Repoman-2.3.12 |
46 |
Signed-off-by: Göktürk Yüksek <gokturk <AT> gentoo.org> |
47 |
|
48 |
sys-apps/rng-tools/rng-tools-6.7.ebuild | 8 ++++++++ |
49 |
1 file changed, 8 insertions(+) |
50 |
|
51 |
diff --git a/sys-apps/rng-tools/rng-tools-6.7.ebuild b/sys-apps/rng-tools/rng-tools-6.7.ebuild |
52 |
index e674b8de1d3..ca5962d6923 100644 |
53 |
--- a/sys-apps/rng-tools/rng-tools-6.7.ebuild |
54 |
+++ b/sys-apps/rng-tools/rng-tools-6.7.ebuild |
55 |
@@ -45,6 +45,14 @@ PATCHES=( |
56 |
|
57 |
src_prepare() { |
58 |
echo 'bin_PROGRAMS = randstat' >> contrib/Makefile.am || die |
59 |
+ |
60 |
+ # rngd_pkcs11.c needs to be linked against -lcrypto #684228 |
61 |
+ # See: https://github.com/nhorman/rng-tools/pull/61 |
62 |
+ if use pkcs11; then |
63 |
+ sed -e '/rngd_pkcs11.c$/ a rngd_LDADD\t+= -lcrypto' \ |
64 |
+ -i Makefile.am || die |
65 |
+ fi |
66 |
+ |
67 |
default |
68 |
|
69 |
mv README.md README || die |