[gnutls-devel] GnuTLS | static build: multiple definition of 'nettle_ecc_scalar_random' (#1045)
Development of GNU's TLS library
gnutls-devel at lists.gnutls.org
Mon Jun 29 02:23:22 CEST 2020
Adrien Béraud created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1045
When building a static library of gnutls, `nettle_ecc_scalar_random` is included in the resulting static library:
```
nm -C x86_64-linux-android/lib/libgnutls.a | grep nettle_ecc_scalar_random
00000000000001f0 T nettle_ecc_scalar_random
```
However this symbol is really part of `libhogweed` (Nettle):
```
nm -C x86_64-linux-android/lib/libhogweed.a | grep nettle_ecc_scalar_random
00000000000001f0 T nettle_ecc_scalar_random
```
So when building an executable with `-lgnutls -lhogweed -lnettle`:
```
ld: error: x86_64-linux-android/lib/libhogweed.a(ecc-random.o): multiple definition of 'nettle_ecc_scalar_random'
ld: x86_64-linux-android/lib/libgnutls.a(ecc-random.o): previous definition here
clang90++: error: linker command failed with exit code 1 (use -v to see invocation)
```
Or if trying to build without libhogweed (just `-lgnutls -lnettle`), the linker fails at runtime:
```
dlopen failed: cannot locate symbol "nettle_rsa_pss_sha256_sign_digest_tr" referenced by "/data/app/blah.so"...
```
Expected behavior:
No definition from libhogweed or nettle should be included in the static library
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1045
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20200629/05ba907a/attachment.html>
More information about the Gnutls-devel
mailing list