[gnutls-devel] GnuTLS | static linking: multiple definition of `mpn_cnd_add_n' (#1552)
Read-only notification of GnuTLS library development activities
gnutls-devel at lists.gnutls.org
Fri May 24 16:19:13 CEST 2024
Tim Rühsen created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1552
When statically linking with libgnutls.a and libhogweed.a, the linker complains about multiple definition of several `mpn_` functions.
In my case it is building and linking the fuzzers for `wget` and `wget2` on oss-fuzz.
This problem exists since ~11.03.2024.
```
/src/wget2_deps/lib/libhogweed.a(gmp-glue.o): in function `mpn_cnd_add_n':
gmp-glue.c:(.text.mpn_cnd_add_n[mpn_cnd_add_n]+0x0): multiple definition of `mpn_cnd_add_n'; /usr/bin/ld: DWARF error: invalid or unhandled FORM value: 0x25
/src/wget2_deps/lib/libgnutls.a(gmp-glue.o):gmp-glue.c:(.text.mpn_cnd_add_n[mpn_cnd_add_n]+0x0): first defined here
```
(*) The "DWARF error" here seems to be side-effect and isn't the cause.
The build script, which includes the static build instructions for nettle and gnutls, is [here](https://github.com/google/oss-fuzz/blob/master/projects/wget2/build.sh).
More info: https://github.com/google/oss-fuzz/issues/11698
A possible work-around is using `libgmp.a` instead of mini-nettle ... but the oss-fuzz builds require clang, and from what I remember, `libgmp` fails to build with clang (at least the last time I tried it, which is a while ago).
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1552
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/20240524/327ff52a/attachment.html>
More information about the Gnutls-devel
mailing list