From 786f96627cd6e4b4ee5297782e9abbed9453cfd9 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sun, 10 Apr 2022 23:07:00 +0200 Subject: [PATCH] package/fetchmail: fix openssl build Fix the following openssl build failure raised since bump to version 6.4.29 in commit ba6fd52195f2e3d0b04baae40cfe084226824d31: /home/autobuild/autobuild/instance-5/output-1/host/bin/arc-buildroot-linux-gnu-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -I/home/autobuild/autobuild/instance-5/output-1/host/arc-buildroot-linux-gnu/sysroot/usr/include -I/usr/kerberos/include -L/home/autobuild/autobuild/instance-5/output-1/host/arc-buildroot-linux-gnu/sysroot/usr/lib -L/home/autobuild/autobuild/instance-5/output-1/host/bin/../arc-buildroot-linux-gnu/sysroot/usr/lib -o fetchmail socket.o getpass.o fetchmail.o env.o idle.o options.o daemon.o driver.o transact.o sink.o smtp.o idlist.o uid.o mxget.o md5ify.o cram.o gssapi.o opie.o interface.o netrc.o unmime.o conf.o checkalias.o uid_db.o lock.o rcfile_l.o rcfile_y.o ucs/norm_charmap.o fm_realpath.o pop3.o imap.o etrn.o odmr.o libfm.a strlcpy.o strlcat.o /usr/lib/libssl.so /usr/lib/libcrypto.so /usr/lib/libssl.so: file not recognized: file format not recognized Fixes: - http://autobuild.buildroot.org/results/815f18f25017be178d478458c48712d9a8570d5a Signed-off-by: Fabrice Fontaine Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- ...c-fix-cross-compilation-with-openssl.patch | 56 +++++++++++++++++++ package/fetchmail/fetchmail.mk | 2 + 2 files changed, 58 insertions(+) create mode 100644 package/fetchmail/0001-configure.ac-fix-cross-compilation-with-openssl.patch diff --git a/package/fetchmail/0001-configure.ac-fix-cross-compilation-with-openssl.patch b/package/fetchmail/0001-configure.ac-fix-cross-compilation-with-openssl.patch new file mode 100644 index 0000000000..fff848196a --- /dev/null +++ b/package/fetchmail/0001-configure.ac-fix-cross-compilation-with-openssl.patch @@ -0,0 +1,56 @@ +From 262aa59c1a7a7100e1dd4e73a6d0112d9becc701 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Fri, 1 Apr 2022 19:23:06 +0200 +Subject: [PATCH] configure.ac: fix cross-compilation with openssl + +Don't call AC_LIB_LINKFLAGS when the libraries are retrieved through +pkg-config to avoid the following build failure when cross-compiling +raised since commit 77503f545d2806d07ab83c59ed9a96f435d281da: + +/home/autobuild/autobuild/instance-5/output-1/host/bin/arc-buildroot-linux-gnu-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -I/home/autobuild/autobuild/instance-5/output-1/host/arc-buildroot-linux-gnu/sysroot/usr/include -I/usr/kerberos/include -L/home/autobuild/autobuild/instance-5/output-1/host/arc-buildroot-linux-gnu/sysroot/usr/lib -L/home/autobuild/autobuild/instance-5/output-1/host/bin/../arc-buildroot-linux-gnu/sysroot/usr/lib -o fetchmail socket.o getpass.o fetchmail.o env.o idle.o options.o daemon.o driver.o transact.o sink.o smtp.o idlist.o uid.o mxget.o md5ify.o cram.o gssapi.o opie.o interface.o netrc.o unmime.o conf.o checkalias.o uid_db.o lock.o rcfile_l.o rcfile_y.o ucs/norm_charmap.o fm_realpath.o pop3.o imap.o etrn.o odmr.o libfm.a strlcpy.o strlcat.o /usr/lib/libssl.so /usr/lib/libcrypto.so +/usr/lib/libssl.so: file not recognized: file format not recognized + +This build failure is raised because AC_LIB_LINKFLAGS will override the +pkg-config target libraries by the host openssl libraries: + +configure: Enabling OpenSSL support in /home/autobuild/autobuild/instance-5/output-1/host/arc-buildroot-linux-gnu/sysroot/usr. +configure: SSL-check: trying pkg-config for openssl +checking for SSL... yes +checking how to link with libssl... /usr/lib/libssl.so /usr/lib/libcrypto.so +configure: From pkg-config: Adding /usr/lib/libssl.so /usr/lib/libcrypto.so to LIBS. LDFLAGS= -L/home/autobuild/autobuild/instance-5/output-1/host/arc-buildroot-linux-gnu/sysroot/usr/lib -L/home/autobuild/autobuild/instance-5/output-1/host/bin/../arc-buildroot-linux-gnu/sysroot/usr/lib + +Fixes: + - http://autobuild.buildroot.org/results/815f18f25017be178d478458c48712d9a8570d5a + +Signed-off-by: Fabrice Fontaine +[Upstream status: +https://gitlab.com/fetchmail/fetchmail/-/merge_requests/42] +--- + configure.ac | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index bd042d51..80e5bf91 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -838,15 +838,13 @@ else + PKG_CHECK_MODULES([SSL],[$i],[ + set -- $SSL_LIBS + while test $# -ge 1 ; do +- case $1 in -l*|lib*) : ;; ++ case $1 in -l*|lib*) LIBS="$LIBS $1" ;; + *) LDFLAGS="$LDFLAGS $1" ;; + esac + shift + done + CPPFLAGS="$SSL_CFLAGS $CPPFLAGS" +- AC_LIB_LINKFLAGS([ssl], [crypto]) +- AS_MESSAGE([From pkg-config: Adding $LIBSSL to LIBS. LDFLAGS=$LDFLAGS]) +- LIBS="$LIBS $LIBSSL" ++ AS_MESSAGE([From pkg-config: $SSL_LIBS]) + found=1 + break],[: ignore-error]) + done +-- +2.35.1 + diff --git a/package/fetchmail/fetchmail.mk b/package/fetchmail/fetchmail.mk index b97f01a423..25dfcae87b 100644 --- a/package/fetchmail/fetchmail.mk +++ b/package/fetchmail/fetchmail.mk @@ -12,6 +12,8 @@ FETCHMAIL_LICENSE = GPL-2.0; some exceptions are mentioned in COPYING FETCHMAIL_LICENSE_FILES = COPYING FETCHMAIL_CPE_ID_VENDOR = fetchmail FETCHMAIL_SELINUX_MODULES = fetchmail mta +# We're patching configure.ac +FETCHMAIL_AUTORECONF = YES FETCHMAIL_CONF_OPTS = \ --with-ssl=$(STAGING_DIR)/usr