You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.7 KiB

dovecot: Fix managesieve-login needs libdovecot-login When trying to use managesieve my MUA complained sieve wasn't supported. On investigation dovecot logs the following could be seen: Aug 16 00:28:44 managesieve-login: Fatal: master: service(managesieve-login): child 1430 returned error 127 Aug 16 00:31:32 managesieve-login: Error: Error loading shared library libdovecot-login.so.0: No such file or directory (needed by /usr/lib/dovecot/managesieve-login) Aug 16 00:31:32 managesieve-login: Error: Error loading shared library libdovecot.so.0: No such file or directory (needed by /usr/lib/dovecot/managesieve-login) Aug 16 00:31:32 managesieve-login: Error: Error relocating /usr/lib/dovecot/managesieve-login: net_ip2addr: symbol not found The issue (verified with readelf on non-working build and build with my fix) is that there is no RPATH information in the pigeonhole binaries (like managesieve-login). The dovecot-config that is 'installed' in the staging dir assumes that plugins will be built on the same host as the installed files. The 'installed' dovecot-config (partial) looks like: LIBDOVECOT='-L/usr/lib/dovecot -ldovecot' LIBDOVECOT_LOGIN='-ldovecot-login -L/home/user/Build/openwrt/openwrt-ath79/staging_dir/target-mips_24kc_musl/usr/lib -lssl -lcrypto' LIBDOVECOT_SQL=-ldovecot-sql LIBDOVECOT_COMPRESS=-ldovecot-compression LIBDOVECOT_LDA=-ldovecot-lda LIBDOVECOT_STORAGE='-ldovecot-storage ' LIBDOVECOT_DSYNC=-ldovecot-dsync LIBDOVECOT_LIBFTS=-ldovecot-fts The solution I used was to modify dovecot-config to add the rpath to DOVECOT_BINARY_LDFLAGS, and to replace references to host directories with staging_dir directories. This results in RPATH being added as it needs to be, and results in a working version of dovecot+pigeonhole. NB: I've also touched package version of pigeonhole as this change in dovecot results in (needed) binary changes for pigeonhole. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
6 years ago
dovecot: Fix managesieve-login needs libdovecot-login When trying to use managesieve my MUA complained sieve wasn't supported. On investigation dovecot logs the following could be seen: Aug 16 00:28:44 managesieve-login: Fatal: master: service(managesieve-login): child 1430 returned error 127 Aug 16 00:31:32 managesieve-login: Error: Error loading shared library libdovecot-login.so.0: No such file or directory (needed by /usr/lib/dovecot/managesieve-login) Aug 16 00:31:32 managesieve-login: Error: Error loading shared library libdovecot.so.0: No such file or directory (needed by /usr/lib/dovecot/managesieve-login) Aug 16 00:31:32 managesieve-login: Error: Error relocating /usr/lib/dovecot/managesieve-login: net_ip2addr: symbol not found The issue (verified with readelf on non-working build and build with my fix) is that there is no RPATH information in the pigeonhole binaries (like managesieve-login). The dovecot-config that is 'installed' in the staging dir assumes that plugins will be built on the same host as the installed files. The 'installed' dovecot-config (partial) looks like: LIBDOVECOT='-L/usr/lib/dovecot -ldovecot' LIBDOVECOT_LOGIN='-ldovecot-login -L/home/user/Build/openwrt/openwrt-ath79/staging_dir/target-mips_24kc_musl/usr/lib -lssl -lcrypto' LIBDOVECOT_SQL=-ldovecot-sql LIBDOVECOT_COMPRESS=-ldovecot-compression LIBDOVECOT_LDA=-ldovecot-lda LIBDOVECOT_STORAGE='-ldovecot-storage ' LIBDOVECOT_DSYNC=-ldovecot-dsync LIBDOVECOT_LIBFTS=-ldovecot-fts The solution I used was to modify dovecot-config to add the rpath to DOVECOT_BINARY_LDFLAGS, and to replace references to host directories with staging_dir directories. This results in RPATH being added as it needs to be, and results in a working version of dovecot+pigeonhole. NB: I've also touched package version of pigeonhole as this change in dovecot results in (needed) binary changes for pigeonhole. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
6 years ago
  1. pigeonhole: Fix managesieve-login needs libdovecot-login
  2. When trying to use managesieve my MUA complained sieve wasn't supported.
  3. On investigation dovecot logs the following could be seen:
  4. Aug 16 00:28:44 managesieve-login: Fatal: master:
  5. service(managesieve-login): child 1430 returned error 127
  6. Aug 16 00:31:32 managesieve-login: Error: Error loading shared
  7. library libdovecot-login.so.0: No such file or directory
  8. (needed by /usr/lib/dovecot/managesieve-login)
  9. Aug 16 00:31:32 managesieve-login: Error: Error loading
  10. shared library libdovecot.so.0: No such file or directory
  11. (needed by /usr/lib/dovecot/managesieve-login)
  12. Aug 16 00:31:32 managesieve-login: Error: Error relocating
  13. /usr/lib/dovecot/managesieve-login: net_ip2addr: symbol not found
  14. The issue (verified with readelf on non-working build and build with my fix)
  15. is that there is no RPATH information in the pigeonhole binaries (like
  16. managesieve-login).
  17. The dovecot-config that is 'installed' in the staging dir
  18. assumes that plugins will be built on the same host as the installed files.
  19. The 'installed' dovecot-config (partial) looks like:
  20. LIBDOVECOT='-L/usr/lib/dovecot -ldovecot'
  21. LIBDOVECOT_LOGIN='-ldovecot-login -L/home/user/Build/openwrt/openwrt-ath79/staging_dir/target-mips_24kc_musl/usr/lib -lssl -lcrypto'
  22. LIBDOVECOT_SQL=-ldovecot-sql
  23. LIBDOVECOT_COMPRESS=-ldovecot-compression
  24. LIBDOVECOT_LDA=-ldovecot-lda
  25. LIBDOVECOT_STORAGE='-ldovecot-storage '
  26. LIBDOVECOT_DSYNC=-ldovecot-dsync
  27. LIBDOVECOT_LIBFTS=-ldovecot-fts
  28. This patch modifed dovecot-config that gets installed on the assumption
  29. that users of libdovecot will also be cross-compiled (a safe bet).
  30. --- a/Makefile.am
  31. +++ b/Makefile.am
  32. @@ -73,7 +73,7 @@ install-exec-hook:
  33. grep -v '^LIBDOVECOT_.*_INCLUDE' dovecot-config | \
  34. grep -v '^LIBDOVECOT.*_DEPS' | sed \
  35. -e "s|^\(DOVECOT_INSTALLED\)=.*$$|\1=yes|" \
  36. - -e "s|^\(LIBDOVECOT\)=.*$$|\1='-L$(pkglibdir) -ldovecot'|" \
  37. + -e "s|^\(LIBDOVECOT\)=.*$$|\1='-L$(STAGING_DIR)$(pkglibdir) -ldovecot'|" \
  38. -e "s|^\(LIBDOVECOT_LOGIN\)=.*$$|\1='-ldovecot-login $(SSL_LIBS)'|" \
  39. -e "s|^\(LIBDOVECOT_SQL\)=.*$$|\1=-ldovecot-sql|" \
  40. -e "s|^\(LIBDOVECOT_COMPRESS\)=.*$$|\1=-ldovecot-compression|" \
  41. @@ -81,7 +81,8 @@ install-exec-hook:
  42. -e "s|^\(LIBDOVECOT_LDA\)=.*$$|\1=-ldovecot-lda|" \
  43. -e "s|^\(LIBDOVECOT_LIBFTS\)=.*$$|\1=-ldovecot-fts|" \
  44. -e "s|^\(LIBDOVECOT_STORAGE\)=.*$$|\1='-ldovecot-storage $(LINKED_STORAGE_LDADD)'|" \
  45. - -e "s|^\(LIBDOVECOT_INCLUDE\)=.*$$|\1=-I$(pkgincludedir)|" \
  46. + -e "s|^\(LIBDOVECOT_INCLUDE\)=.*$$|\1=-I$(STAGING_DIR)$(pkgincludedir)|" \
  47. + -e "s|^\(DOVECOT_BINARY_LDFLAGS=\".*\)\"$$|\1 -Wl,-rpath -Wl,$(pkglibdir)\"|" \
  48. > $(DESTDIR)$(pkglibdir)/dovecot-config
  49. uninstall-hook: