openssl: Duplicate symbols libssl.a and libcrypto.a (3.0.8 regression)
In 3.0.8 there are duplicate symbols in libssl.a and libcrypto.a that break the static link of our application. Here’s the linker output showing the duplicate symbols. Note v3.0.7 does not have this problem and links clean.
g++ -Wl,--whole-archive /home/normg/local/gs370/slow50/openssl/install50/lib/libssl.a /home/normg/local/gs370/slow50/openssl/install50/lib/libcrypto.a -Wl,--no-whole-archive main.o -o opensslmain -lpthread -lc -ldl
/usr/bin/ld: /home/normg/local/gs370/slow50/openssl/install50/lib/libcrypto.a(libcrypto-lib-sparse_array.o): in function `ossl_sa_new':
/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:59: multiple definition of `ossl_sa_new'; /home/normg/local/gs370/slow50/openssl/install50/lib/libssl.a(libssl-lib-sparse_array.o):/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:59: first defined here
/usr/bin/ld: /home/normg/local/gs370/slow50/openssl/install50/lib/libcrypto.a(libcrypto-lib-sparse_array.o): in function `ossl_sa_free':
/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:111: multiple definition of `ossl_sa_free'; /home/normg/local/gs370/slow50/openssl/install50/lib/libssl.a(libssl-lib-sparse_array.o):/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:111: first defined here
/usr/bin/ld: /home/normg/local/gs370/slow50/openssl/install50/lib/libcrypto.a(libcrypto-lib-sparse_array.o): in function `ossl_sa_free_leaves':
/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:119: multiple definition of `ossl_sa_free_leaves'; /home/normg/local/gs370/slow50/openssl/install50/lib/libssl.a(libssl-lib-sparse_array.o):/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:119: first defined here
/usr/bin/ld: /home/normg/local/gs370/slow50/openssl/install50/lib/libcrypto.a(libcrypto-lib-sparse_array.o): in function `ossl_sa_doall':
/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:135: multiple definition of `ossl_sa_doall'; /home/normg/local/gs370/slow50/openssl/install50/lib/libssl.a(libssl-lib-sparse_array.o):/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:135: first defined here
/usr/bin/ld: /home/normg/local/gs370/slow50/openssl/install50/lib/libcrypto.a(libcrypto-lib-sparse_array.o): in function `ossl_sa_doall_arg':
/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:146: multiple definition of `ossl_sa_doall_arg'; /home/normg/local/gs370/slow50/openssl/install50/lib/libssl.a(libssl-lib-sparse_array.o):/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:146: first defined here
/usr/bin/ld: /home/normg/local/gs370/slow50/openssl/install50/lib/libcrypto.a(libcrypto-lib-sparse_array.o): in function `ossl_sa_num':
/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:152: multiple definition of `ossl_sa_num'; /home/normg/local/gs370/slow50/openssl/install50/lib/libssl.a(libssl-lib-sparse_array.o):/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:152: first defined here
/usr/bin/ld: /home/normg/local/gs370/slow50/openssl/install50/lib/libcrypto.a(libcrypto-lib-sparse_array.o): in function `ossl_sa_get':
/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:157: multiple definition of `ossl_sa_get'; /home/normg/local/gs370/slow50/openssl/install50/lib/libssl.a(libssl-lib-sparse_array.o):/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:157: first defined here
/usr/bin/ld: /home/normg/local/gs370/slow50/openssl/install50/lib/libcrypto.a(libcrypto-lib-sparse_array.o): in function `ossl_sa_set':
/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:180: multiple definition of `ossl_sa_set'; /home/normg/local/gs370/slow50/openssl/install50/lib/libssl.a(libssl-lib-sparse_array.o):/export/moop3/users/normg/gs370/slow50/openssl/../../externals/openssl/crypto/sparse_array.c:180: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:12: opensslmain] Error 1
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- Use of sparse_array.c only in the shared libssl Conditioning it on $disabled{shared} isn't right, it will still end up in the static variant of the library. It's better to use SHARED_SOURCE for thes... — committed to levitte/openssl by levitte a year ago
- Use of sparse_array.c only in the shared libssl Conditioning it on $disabled{shared} isn't right, it will still end up in the static variant of the library. It's better to use SHARED_SOURCE for thes... — committed to openssl/openssl by levitte a year ago
- Use of sparse_array.c only in the shared libssl Conditioning it on $disabled{shared} isn't right, it will still end up in the static variant of the library. It's better to use SHARED_SOURCE for thes... — committed to openssl/openssl by levitte a year ago
- Use of sparse_array.c only in the shared libssl Conditioning it on $disabled{shared} isn't right, it will still end up in the static variant of the library. It's better to use SHARED_SOURCE for thes... — committed to hardik05/openssl by levitte a year ago
- Use of sparse_array.c only in the shared libssl Conditioning it on $disabled{shared} isn't right, it will still end up in the static variant of the library. It's better to use SHARED_SOURCE for thes... — committed to hardik05/openssl by levitte a year ago
- Use of sparse_array.c only in the shared libssl Conditioning it on $disabled{shared} isn't right, it will still end up in the static variant of the library. It's better to use SHARED_SOURCE for thes... — committed to hardik05/openssl by levitte a year ago
- WL#15614 OpenSSL 3.0 support in Cluster v7.5, 7.6/MySQL 5.7 - adapt finding OpenSSL version from include file for OpenSSL 3.0 - allow use of OpenSSL version 3 - suppress deprecation warnings for usin... — committed to mysql/mysql-server by zmur a year ago
- WL#15614 OpenSSL 3.0 support in Cluster v7.5, 7.6/MySQL 5.7 - adapt finding OpenSSL version from include file for OpenSSL 3.0 - allow use of OpenSSL version 3 - suppress deprecation warnings for usin... — committed to mysql/mysql-server by zmur a year ago
Yes, #20240 fixes the issue.