[gnutls-devel] GnuTLS | Fix link errors with gcc-9 (!966)

Development of GNU's TLS library gnutls-devel at lists.gnutls.org
Sun Mar 31 19:25:47 CEST 2019



New Merge Request !966

https://gitlab.com/gnutls/gnutls/merge_requests/966

Project:Branches: ametzler/gnutls:tmp-ametzler-gcc9-build-error to gnutls/gnutls:master
Author:    Andreas Metzler
Assignee:  


This fixes the error reported in https://bugs.debian.org/925701 - Gnutls FTBFS with gcc-9 due to these changes:
```
GCC 9 also passes the linker option --as-needed by default; typical
build issues are passing libraries before object files to the linker,
or underlinking of convenience libraries built from the same source.
```

To reproduce I had to configure gnutls for installation into a multiarch path:
```--prefix=/usr --libdir=\${prefix}/lib/x86_64-linux-gnu```

I have found two issues: libecore.la is underlinked, -ldl missing.
```
/usr/bin/ld: ./.libs/libecore.a(libecore_la-eina_module.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line
```
cipher-openssl-compat has wrong order, due to setting cipher_openssl_compat_LDFLAGS instead of cipher_openssl_compat_LDADD
```
libtool: link: gcc-9 [...] -Wabi=11 -fdiagnostics-show-option -g -O2 /usr/lib/x86_64-linux-gnu/libcrypto.so -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu -o .libs/cipher-openssl-compat cipher-openssl-compat.o  ../.libs/libutils.a /dev/shm/gnutls.git/b4deb/lib/.libs/libgnutls.so -lp11-kit -lidn2 -lunistring -ltasn1 -lnettle -lhogweed -lgmp ../../gl/.libs/libgnu.a ../../lib/.libs/libgnutls.so
/usr/bin/ld: cipher-openssl-compat.o: in function `cipher_test':
/dev/shm/gnutls.git/b4deb/tests/slow/../../../tests/slow/cipher-openssl-compat.c:42: undefined reference to `EVP_get_cipherbyname'
/usr/bin/ld: /dev/shm/gnutls.git/b4deb/tests/slow/../../../tests/slow/cipher-openssl-compat.c:146: undefined reference to `EVP_CipherInit_ex'
[...]
```

## Checklist
 * [x] Commits have `Signed-off-by:` with name/author being identical to the commit author
 * [ ] Code modified for feature
 * [ ] Test suite updated with functionality tests
 * [ ] Test suite updated with negative tests
 * [ ] Documentation updated / NEWS entry present (for non-trivial changes)

## Reviewer's checklist:
 * [ ] Any issues marked for closing are addressed
 * [ ] There is a test suite reasonably covering new functionality or modifications
 * [ ] Function naming, parameters, return values, types, etc., are consistent and according to `CONTRIBUTION.md`
 * [ ] This feature/change has adequate documentation added
 * [ ] No obvious mistakes in the code

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/merge_requests/966
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/20190331/cc40abd2/attachment.html>


More information about the Gnutls-devel mailing list