0001-Fix-static-linking-problem-with-libgcrypt.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 8cee09b59a8c1ff2ebfc8c46097825d2eafdc4dd Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Sat, 16 May 2015 17:32:13 +0200
  4. Subject: [PATCH] Fix static linking problem with libgcrypt
  5. When libgcrypt is used, it is linked with libgpg-error, so we should
  6. also test that libgpg-error is available, and include -lgpg-error in
  7. the LIBS variable.
  8. This fixes build issues like:
  9. CCLD xml
  10. /home/thomas/projets/buildroot/output/host/usr/bfin-buildroot-uclinux-uclibc/sysroot/usr/lib/libexslt.a(crypto.o): In function `_exsltCryptoGcryptInit':
  11. crypto.c:(.text+0x112): undefined reference to `_gcry_check_version'
  12. /home/thomas/projets/buildroot/output/host/usr/bfin-buildroot-uclinux-uclibc/sysroot/usr/lib/libexslt.a(crypto.o): In function `_exsltCryptoRc4DecryptFunction':
  13. crypto.c:(.text+0x316): undefined reference to `_gcry_cipher_open'
  14. crypto.c:(.text+0x32a): undefined reference to `_gcry_strerror'
  15. crypto.c:(.text+0x34c): undefined reference to `_gcry_cipher_setkey'
  16. Which are caused by the AC_SEARCH_LIBS() test for libgcrypt to fail
  17. due to -lgpg-error not been present in the LIBS variable.
  18. Note that using PKG_CHECK_MODULES() would be a much much better
  19. replacement than this complicated handling of static libraries, but
  20. it's a much more significant effort.
  21. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  22. ---
  23. configure.ac | 1 +
  24. 1 file changed, 1 insertion(+)
  25. diff --git a/configure.ac b/configure.ac
  26. index 4db0129..e378996 100644
  27. --- a/configure.ac
  28. +++ b/configure.ac
  29. @@ -125,6 +125,7 @@ AS_IF([test "x$STATIC_LIBS" != xno],
  30. [AC_SEARCH_LIBS([libiconv_open], [iconv], [], [], "$USER_LIBS")], "$USER_LIBS")
  31. AC_SEARCH_LIBS([clock_gettime], [rt], [], [], "$USER_LIBS")
  32. AC_SEARCH_LIBS([deflate], [z], [], [], "$USER_LIBS")
  33. + AC_SEARCH_LIBS([gpg_strerror], [gpg-error], [], [], "$USER_LIBS")
  34. AC_SEARCH_LIBS([gcry_cipher_encrypt], [gcrypt], [], [], "$USER_LIBS")
  35. # Checks for inet libraries:
  36. --
  37. 2.1.0