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

Bug 684228

Summary: sys-apps/rng-tools-6.7: /usr/lib64/libcrypto.so.1.1: error adding symbols: DSO missing from command line
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Göktürk Yüksek <gokturk>
Status: RESOLVED FIXED    
Severity: normal CC: base-system, dawid.jarosz
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: sys-apps:rng-tools-6.7:20190424-062513.log
emerge-info.txt

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-04-24 06:38:45 UTC
Created attachment 573928 [details]
sys-apps:rng-tools-6.7:20190424-062513.log

x86_64-pc-linux-gnu-gcc-8.3.0     -pthread -march=x86-64 -mtune=k8 -mcx16 -msahf -msse3 --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -O2 -pipe -frecord-gcc-switches -pthread  -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o rngd rngd-rngd.o rngd-rngd_entsource.o rngd-rngd_linux.o rngd-util.o  rngd-rngd_rdrand.o rdrand_asm.o   rngd-rngd_pkcs11.o librngd.a -lsysfs -lgcrypt -lsysfs  -lp11     -lgcrypt -lsysfs 
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: rngd-rngd_pkcs11.o: undefined reference to symbol 'ERR_reason_error_string@@OPENSSL_1_1_0'
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libcrypto.so.1.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-04-24 06:39:22 UTC
Created attachment 573930 [details]
emerge-info.txt
Comment 2 Dawid Jarosz 2019-05-31 18:42:39 UTC
I also get this error. If I unset pkcs11 USE flag for sys-apps/rng-tools package compiles with out problems. So it has some thig to do with openssl 1.1.0 and pkcs11.
Comment 3 Larry the Git Cow gentoo-dev 2019-06-04 18:48:14 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c07154b652829899c18d44cc3ff78101041723b

commit 9c07154b652829899c18d44cc3ff78101041723b
Author:     Göktürk Yüksek <gokturk@gentoo.org>
AuthorDate: 2019-06-04 18:46:45 +0000
Commit:     Göktürk Yüksek <gokturk@gentoo.org>
CommitDate: 2019-06-04 18:47:59 +0000

    sys-apps/rng-tools: fix a linking problem with USE=pkcs11 #684228
    
    In function init_pkcs11_entropy_source(), there is a call to
    ERR_reason_error_string(), which is defined in libcrypto. This causes
    linking problems for rng-tools under certain configurations:
    
    $ ./configure --disable-jitterentropy --without-nistbeacon --with-pkcs11
    ...
    $ make
    ...
    gcc -pthread -g -O2 -pthread -o rngd rngd-rngd.o rngd-rngd_entsource.o
        rngd-rngd_linux.o rngd-util.o rngd-rngd_rdrand.o rdrand_asm.o
        rngd-rngd_pkcs11.o librngd.a -lsysfs -lgcrypt -lsysfs -lp11 -lgcrypt
        -lsysfs
    /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
        rngd-rngd_pkcs11.o: undefined reference to symbol
        'ERR_reason_error_string@@OPENSSL_1_1_0'
    /usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld:
        /usr/lib64/libcrypto.so.1.1: error adding symbols: DSO missing from
        command line
    collect2: error: ld returned 1 exit status
    make[2]: *** [Makefile:609: rngd] Error 1
    make[2]: Leaving directory '/tmp/rng-tools'
    make[1]: *** [Makefile:888: all-recursive] Error 1
    make[1]: Leaving directory '/tmp/rng-tools'
    make: *** [Makefile:458: all] Error 2
    
    This symbol is defined in libcrypto:
    
    $ readelf --dyn-syms /usr/lib64/libcrypto.so | grep ERR_reason_error_string
    314: 000000000012cf60 155 FUNC GLOBAL DEFAULT 12
        ERR_reason_error_string@@OPENSSL_1_1_0
    
    Linking rngd against libcrypto when pkcs11 is enabled fixes the issue.
    
    Bug: https://github.com/nhorman/rng-tools/pull/61
    Closes: https://bugs.gentoo.org/684228
    Package-Manager: Portage-2.3.66, Repoman-2.3.12
    Signed-off-by: Göktürk Yüksek <gokturk@gentoo.org>

 sys-apps/rng-tools/rng-tools-6.7.ebuild | 8 ++++++++
 1 file changed, 8 insertions(+)