packages/exim: fix build failures
cover packages/exim: fix build failures
exim is failing on the autobuilders since the version bump to 4.93 (commit 6038c3232acfdb: "package/exim: bump version to 4.93.0.3").
Commit 2c692e81a844b30b ("package/exim: fix host build") fixed one failure when building the host tools, but we still have a similar ("'for' loop initial declarations are only allowed in C99 mode") one when cross-building target files.
In patch 1 I applied a similar fix (add -std=c99), but more failures started appearing later in the build process.
I have not completely understood the new failures, yet with a couple of patches it is now building. This is done in patch 2 but I'm not sure it is a correct solution.
Finally another failure appeared. It is yet another for-loop-initial-declaration error, but happens later in the install step. This is fixed in patch 3 adding another -std=c99.
I cannot work on this issue for the next few days, so here are my patches, as-is, in case anybody wants to have a look before 2020.02.
Luca
Luca Ceresoli (3):
package/exim: fix target build on some toolchains package/exim: fix various build failures package/exim: fix build error during install step
..._lock-fix-lstat-related-build-errors.patch | 50 +++++++++++++++++++ .../exim/0006-sieve-fix-build-errors.patch | 41 +++++++++++++++ package/exim/exim.mk | 7 ++- 3 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 package/exim/0005-exim_lock-fix-lstat-related-build-errors.patch create mode 100644 package/exim/0006-sieve-fix-build-errors.patch
Signature · 1 line
2.25.0
PATCH 1/3 package/exim: fix target build on some toolchains
Building with the Sourcery CodeBench ARM 2014.05 the build fails with this error:
Quoted 1 line
Quoted 1 line
Quoted 1 line
exim_dbmbuildutility built
/home/ceresoli/devel/buildroot/output/host/bin/arm-none-linux-gnueabi-gcc -DEXIM_DUMPDB exim_dbutil.c exim_dbutil.c: In function 'main':
exim_dbutil.c:568:1: error: 'for' loop initial declarations are only allowed in C99 mode
for (uschar * key = dbfn_scan(dbm, TRUE, &cursor);
^
exim_dbutil.c:568:1: note: use option -std=c99 or -std=gnu99 to compile your code exim_dbutil.c:630:2: error: 'for' loop initial declarations are only allowed in C99 mode
for (int i = 1; i <= wait->count; i++)
^
exim_dbutil.c:642:6: error: 'for' loop initial declarations are only allowed in C99 mode
for (int j = 0; j < MESSAGE_ID_LENGTH; j++)
^Fix by enforcing C99. This completes commit 2c692e81a844b30b4d3161dfd9897b3265bb9279 ("package/exim: fix host build") to also fix target builds.
--- package/exim/exim.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
package/exim/exim.mk +2 -1
@@ -127,7 +127,8 @@ define EXIM_BUILD_CMDS LNCC=$(HOSTCC) \ CFLAGS="-std=c99 $(HOST_CFLAGS)" \ LFLAGS="-fPIC $(HOST_LDFLAGS)" - $(TARGET_MAKE_ENV) build=br $(MAKE1) -C $(@D) $(EXIM_STATIC_FLAGS) + $(TARGET_MAKE_ENV) build=br $(MAKE1) -C $(@D) $(EXIM_STATIC_FLAGS) \ + CFLAGS="-std=c99 $(TARGET_CFLAGS)" endef # Need to replicate the LFLAGS in install, as exim still wants to build
Signature · 1 line
2.25.0
PATCH 2/3 package/exim: fix various build failures
In reply to Luca Ceresoli--- ..._lock-fix-lstat-related-build-errors.patch | 50 +++++++++++++++++++ .../exim/0006-sieve-fix-build-errors.patch | 41 +++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 package/exim/0005-exim_lock-fix-lstat-related-build-errors.patch create mode 100644 package/exim/0006-sieve-fix-build-errors.patch
package/exim/0005-exim_lock-fix-lstat-related-build-errors.patch new file +50 -0
@@ -0,0 +1,50 @@ +From bbcf4320134efd8a01ce5a02bb9af62019ca05f6 Mon Sep 17 00:00:00 2001 +From: Luca Ceresoli <[email protected]> +Date: Tue, 4 Feb 2020 15:57:48 +0100 +Subject: [PATCH] exim_lock: fix lstat-related build errors + +exim_lock fails to cross-compile with the Sourcery CodeBench ARM 2014.05 +toolchain due the a missing include of sys/types.h, needed for the +constants used by fstat() and lstat(). + +Discovered when cross-compiling with the Buildroot embedded Linux +buildsystem. + +Fixes: + + exim_lock.c:427:30: error: 'S_IFMT' undeclared (first use in this function) + if ((statbuf.st_mode & S_IFMT) == S_IFLNK) + ^ + exim_lock.c:427:30: note: each undeclared identifier is reported only once for each function it appears in + exim_lock.c:427:41: error: 'S_IFLNK' undeclared (first use in this function) + if ((statbuf.st_mode & S_IFMT) == S_IFLNK) + ^ + +Signed-off-by: Luca Ceresoli <[email protected]> +--- + src/exim_lock.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/exim_lock.c b/src/exim_lock.c +index 068216816054..cb140aff6436 100644 +--- a/src/exim_lock.c ++++ b/src/exim_lock.c +@@ -13,6 +13,8 @@ Argument: the name of the lock file + Copyright (c) The Exim Maintainers 2016 + */ + ++#define _XOPEN_SOURCE ++ + #include "os.h" + + #include <stdio.h> +@@ -26,6 +28,7 @@ Copyright (c) The Exim Maintainers 2016 + #include <unistd.h> + #include <utime.h> + #include <sys/utsname.h> ++#include <sys/types.h> + #include <sys/stat.h> + #include <sys/file.h> + #include <pwd.h> +-- +2.25.0
package/exim/0006-sieve-fix-build-errors.patch new file +41 -0
41 lines not on this page · raw message
Signature · 1 line
2.25.0
PATCH 3/3 package/exim: fix build error during install step
In reply to Luca Ceresoliexim builds some files during the 'make install' step, and these fail with an error:
lookups/lf_quote.c:49:3: error: 'for' loop initial declarations are only allowed in C99 mode
for (int j = 0; j < vlength; j++)
^Fix by passing the -std=c99 here, as it is already passed in the build step.
--- package/exim/exim.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
package/exim/exim.mk +3 -1
@@ -135,7 +135,9 @@ endef # something when installing... define EXIM_INSTALL_TARGET_CMDS DESTDIR=$(TARGET_DIR) INSTALL_ARG="-no_chown -no_symlink" build=br \ - $(MAKE1) -C $(@D) $(EXIM_STATIC_FLAGS) install + $(MAKE1) -C $(@D) $(EXIM_STATIC_FLAGS) \ + CFLAGS="-std=c99 $(TARGET_CFLAGS)" \ + install chmod u+s $(TARGET_DIR)/usr/sbin/exim endef
Signature · 1 line
2.25.0
cover packages/exim: fix build failures
In reply to Luca CeresoliQuoted 17 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Luca" == Luca Ceresoli <[email protected]> writes:
exim is failing on the autobuilders since the version bump to 4.93 (commit
6038c3232acfdb: "package/exim: bump version to 4.93.0.3").Commit
2c692e81a844b30b("package/exim: fix host build") fixed one failure when building the host tools, but we still have a similar ("'for' loop initial declarations are only allowed in C99 mode") one when cross-building target files.In patch 1 I applied a similar fix (add -std=c99), but more failures started appearing later in the build process.
I have not completely understood the new failures, yet with a couple of patches it is now building. This is done in patch 2 but I'm not sure it is a correct solution.
Quoted 6 lines
Finally another failure appeared. It is yet another for-loop-initial-declaration error, but happens later in the install step. This is fixed in patch 3 adding another -std=c99.
I cannot work on this issue for the next few days, so here are my patches, as-is, in case anybody wants to have a look before 2020.02.
Thanks, the patches looks sensible to me. Did you submit them upstream? We normally add a link to that in the patches.
Signature · 1 line
Bye, Peter Korsgaard
cover packages/exim: fix build failures
Hi Peter,
Quoted 21 lines · Peter Korsgaard
Quoted 20 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Luca" == Luca Ceresoli <[email protected]> writes:
exim is failing on the autobuilders since the version bump to 4.93 (commit
6038c3232acfdb: "package/exim: bump version to 4.93.0.3").Commit
2c692e81a844b30b("package/exim: fix host build") fixed one failure when building the host tools, but we still have a similar ("'for' loop initial declarations are only allowed in C99 mode") one when cross-building target files.In patch 1 I applied a similar fix (add -std=c99), but more failures started appearing later in the build process.
I have not completely understood the new failures, yet with a couple of patches it is now building. This is done in patch 2 but I'm not sure it is a correct solution.
Finally another failure appeared. It is yet another for-loop-initial-declaration error, but happens later in the install step. This is fixed in patch 3 adding another -std=c99.
Quoted 5 lines
Quoted 2 lines
I cannot work on this issue for the next few days, so here are my patches, as-is, in case anybody wants to have a look before 2020.02.
Thanks, the patches looks sensible to me. Did you submit them upstream? We normally add a link to that in the patches.
I still haven't sent them to upstream because I thought there could be a better fix. I plan to send them within a few days after having another look into it. After that I'm also sending v2 here with the "Upstream-status" added.
Signature · 1 line
Luca
cover packages/exim: fix build failures
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Luca" == Luca Ceresoli <[email protected]> writes:
Hi,
Quoted 7 lines
Quoted 2 lines
Thanks, the patches looks sensible to me. Did you submit them upstream? We normally add a link to that in the patches.
I still haven't sent them to upstream because I thought there could be a better fix. I plan to send them within a few days after having another look into it. After that I'm also sending v2 here with the "Upstream-status" added.
Ok, great - Thanks!
Signature · 1 line
Bye, Peter Korsgaard