From 6d13c58e386d478b8788f440b7815cb866b9d6f0 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 16 Mar 2025 13:32:55 -0700 Subject: procmail: Fix build with GCC-14 aids building on newer build hosts which now have moved to gcc-14 as well, so using cmdline option just for target compile is not enough as it runs tests using host compiler as well Signed-off-by: Khem Raj --- .../recipes-support/procmail/procmail/gcc14.patch | 127 +++++++++++++++++++++ meta-oe/recipes-support/procmail/procmail_3.22.bb | 4 +- 2 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-support/procmail/procmail/gcc14.patch diff --git a/meta-oe/recipes-support/procmail/procmail/gcc14.patch b/meta-oe/recipes-support/procmail/procmail/gcc14.patch new file mode 100644 index 0000000000..5ca56fa006 --- /dev/null +++ b/meta-oe/recipes-support/procmail/procmail/gcc14.patch @@ -0,0 +1,127 @@ +From: Santiago Vila +Subject: Fix build with gcc-14 +Bug-Debian: https://bugs.debian.org/1075398 + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- a/initmake ++++ b/initmake +@@ -124,7 +124,7 @@ else + fi + + cat >_autotst.c <_autotst.c < + #include + #include +-main() ++int main() + { struct stat buf;return!&buf; + } + HERE +--- a/src/autoconf ++++ b/src/autoconf +@@ -414,6 +414,12 @@ cat >_autotst.c < ++int killchildren(); ++int fdlock(int fd); ++int sfdlock(int fd); ++int fdunlock(); ++ + void stimeout() + { timeout=1;close(fdcollect);killchildren(); + } +@@ -435,7 +441,7 @@ unsigned sfork() + return pid; + } + +-int main(argc,argv)char*argv[]; ++int main(int argc,char*argv[]) + { int goodlock,testlock,i,pip[2],pipw[2];time_t otimet;unsigned dtimet; + static char filename[]="_locktst.l0"; + close(0);goodlock=0;testlock=FIRST_lock;signal(SIGPIPE,SIG_DFL); +@@ -585,13 +591,13 @@ int killchildren() + return 0; + } + +-int sfdlock(fd) ++int sfdlock(int fd) + { int i;unsigned gobble[GOBBLE>>2]; + for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0); /* SunOS crash test */ + return fdlock(fd); + } + +-static oldfdlock; ++static int oldfdlock; + #ifdef F_SETLKW + static struct flock flck; /* why can't it be a local variable? */ + #endif +@@ -599,7 +605,7 @@ static struct flock flck; /* why can't + static off_t oldlockoffset; + #endif + +-int fdlock(fd) ++int fdlock(int fd) + { int i;unsigned gobble[GOBBLE>>2]; + for(i=GOBBLE>>2;i;gobble[--i]=~(unsigned)0); /* SunOS crash test */ + oldfdlock=fd;fd=0; +@@ -993,11 +999,11 @@ int main(){int i;i=1; + i+=WIFEXITED(i); + i+=WIFSTOPPED(i); + i+=WEXITSTATUS(i); +- i+=WSIGTERM(i); ++ i+=WTERMSIG(i); + return i;} + HERE + +-echo 'Testing for WIFEXITED(), WIFSTOPPED(), WEXITSTATUS() & WSIGTERM()' ++echo 'Testing for WIFEXITED(), WIFSTOPPED(), WEXITSTATUS() & WTERMSIG()' + if $MAKE _autotst.$O >_autotst.rrr 2>&1 + then + $FGREP -v include/ <_autotst.rrr >_autotst.$O +@@ -1029,6 +1035,8 @@ cat >_autotst.c <$DEVNULL 2>&1 ++if $MAKE _autotst.$O >_autotst.rrr 2>&1 + then + : + else +@@ -1196,7 +1204,7 @@ unsigned long dobench(strstr,iter,haysta + return (unsigned long)clock()-to; + } + #endif +-int main(argc,argv)int argc;const char*argv[]; ++int main(int argc,const char*argv[]) + { if(argc==1) + { char*haystack; + #ifdef BENCHSIZE +--- a/src/mailfold.c ++++ b/src/mailfold.c +@@ -378,7 +378,7 @@ void concon(ch)const int ch; /* flip b + } + } + +-void readmail(rhead,tobesent)const long tobesent; ++void readmail(int rhead,const long tobesent) + { char*chp,*pastend;static size_t contlengthoffset; + ;{ long dfilled; + if(rhead==2) /* already read, just examine what we have */ diff --git a/meta-oe/recipes-support/procmail/procmail_3.22.bb b/meta-oe/recipes-support/procmail/procmail_3.22.bb index 59b78c0a6a..32fc12c7da 100644 --- a/meta-oe/recipes-support/procmail/procmail_3.22.bb +++ b/meta-oe/recipes-support/procmail/procmail_3.22.bb @@ -15,6 +15,7 @@ SRC_URI = "http://www.ring.gr.jp/archives/net/mail/${BPN}/${BP}.tar.gz \ file://man-file-mailstat.1-from-debian.patch \ file://CVE-2014-3618.patch \ file://CVE-2017-16844.patch \ + file://gcc14.patch \ " SRC_URI[sha256sum] = "087c75b34dd33d8b9df5afe9e42801c9395f4bf373a784d9bc97153b0062e117" @@ -24,6 +25,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a71e50e197a992c862379e576e669757 \ DEPENDS = "libnet" inherit autotools-brokensep + do_configure() { find examples -type f | xargs chmod 644 export CC="${BUILD_CC}" @@ -35,7 +37,7 @@ do_configure() { } do_compile() { - oe_runmake -i CFLAGS="$TARGET_CFLAGS -Wno-comments -Wno-implicit-int -Wno-implicit-function-declaration -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" LDFLAGS0="${LDFLAGS}" + oe_runmake -i CFLAGS="$TARGET_CFLAGS -Wno-comments -Wno-implicit-function-declaration -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" LDFLAGS0="${LDFLAGS}" } do_install() { -- cgit v1.2.3-54-g00ecf