enca: Fix cross builds
PATCH 1/4 enca: Fix cross builds
Some portions are built using host CC, which
is important when doing cross compile to pass correct flags otherwise it fails when using newer host compiler e.g. gcc-14
--- meta-oe/recipes-support/enca/enca/cross.patch | 68 +++++++++++++++++++ .../enca/enca/makefile-remove-tools.patch | 14 ---- meta-oe/recipes-support/enca/enca_1.19.bb | 24 ++----- 3 files changed, 73 insertions(+), 33 deletions(-) create mode 100644 meta-oe/recipes-support/enca/enca/cross.patch delete mode 100644 meta-oe/recipes-support/enca/enca/makefile-remove-tools.patch
meta-oe/recipes-support/enca/enca/cross.patch new file +68 -0
@@ -0,0 +1,68 @@ +From: Helmut Grohne <[email protected]> +Subject: build make_hash with the build arch compiler + +Also note that we cannot include config.h in make_hash.c, because it is +specific to the host architecture. + +Sourced from debian - https://salsa.debian.org/debian/enca/-/blob/master/debian/patches/cross.patch?ref_type=heads + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> + +Index: enca-1.19/configure.ac +=================================================================== +--- enca-1.19.orig/configure.ac ++++ enca-1.19/configure.ac +@@ -35,6 +35,7 @@ + dnl Checks for programs. + AC_PROG_AWK + AC_PROG_CC ++AX_PROG_CC_FOR_BUILD + AC_GNU_SOURCE + AC_AIX + AC_ISC_POSIX +Index: enca-1.19/tools/Makefile.am +=================================================================== +--- enca-1.19.orig/tools/Makefile.am ++++ enca-1.19/tools/Makefile.am +@@ -2,7 +2,8 @@ + noinst_HEADERS = encodings.h + noinst_SCRIPTS = expand_table.pl + +-make_hash_SOURCES = make_hash.c ++make_hash$(EXEEXT): make_hash.c ++ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o $@ $< + + BUILT_SOURCES = $(noinst_HEADERS) + +Index: enca-1.19/tools/make_hash.c +=================================================================== +--- enca-1.19.orig/tools/make_hash.c ++++ enca-1.19/tools/make_hash.c +@@ -17,25 +17,9 @@ + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +-#ifdef HAVE_CONFIG_H +-# include "config.h" +-#endif /* HAVE_CONFIG_H */ +- + #include <stdlib.h> + #include <stdio.h> +- +-#ifdef HAVE_STRING_H +-# include <string.h> +-#else /* HAVE_STRING_H */ +-# ifdef HAVE_STRINGS_H +-# include <strings.h> +-# endif /* HAVE_STRINGS_H */ +-#endif /* HAVE_STRING_H */ +- +-#ifdef HAVE_MEMORY_H +-# include <memory.h> +-#endif /* HAVE_MEMORY_H */ +- ++#include <string.h> + #include <unistd.h> + #include <ctype.h> +
meta-oe/recipes-support/enca/enca/makefile-remove-tools.patch deleted +0 -14
@@ -1,14 +0,0 @@ -Upstream-Status: Pending - ---- enca-1.19/Makefile.am.orig 2006-06-29 15:34:55.000000000 +0100 -+++ enca-1.19/Makefile.am 2006-06-29 15:35:20.000000000 +0100 -@@ -1,7 +1,7 @@ - if MAINTAINER_MODE --SUBDIRS = tools data script lib src devel-docs test -+SUBDIRS = data script lib src devel-docs test - else --SUBDIRS = tools script lib src devel-docs -+SUBDIRS = script lib src devel-docs - endif - man_MANS = man/enca.1 -
meta-oe/recipes-support/enca/enca_1.19.bb +5 -19
@@ -2,33 +2,19 @@ SUMMARY = "Enca is an Extremely Naive Charset Analyser" SECTION = "libs" HOMEPAGE = "https://cihar.com/software/enca/" -DEPENDS += "gettext-native" +DEPENDS += "gettext-native autoconf-archive-native" LICENSE = "GPL-2.0-only" LIC_FILES_CHKSUM = "file://COPYING;md5=24b9569831c46d4818450b55282476b4" SRC_URI = "https://dl.cihar.com/enca/enca-${PV}.tar.gz \ + file://cross.patch \ file://dont-run-tests.patch \ - file://makefile-remove-tools.patch \ file://libenca-003-iconv.patch \ - file://0001-Do-not-use-MKTEMP_PROG-in-cross-build.patch" + file://0001-Do-not-use-MKTEMP_PROG-in-cross-build.patch \ + " SRC_URI[sha256sum] = "4c305cc59f3e57f2cfc150a6ac511690f43633595760e1cb266bf23362d72f8a" inherit autotools -do_configure:prepend() { - # remove failing test which checks for something that isn't even used - sed -i -e '/ye_FUNC_SCANF_MODIF_SIZE_T/d' ${S}/configure.ac -} - -do_configure:append() { - sed -i s:-I/usr/include::g ${B}/Makefile - sed -i s:-I/usr/include::g ${B}/*/Makefile -} - -do_compile() { - cd ${S}/tools && ${BUILD_CC} -o make_hash make_hash.c - cd ${B} - oe_runmake -} - +EXTRA_OECONF += "MKTEMP_PROG=mktemp"
PATCH 2/4 ckermit: Fix build with GCC-15
Also fix native pieces to build with gcc-14 while here
--- meta-oe/recipes-support/ckermit/ckermit_302.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
meta-oe/recipes-support/ckermit/ckermit_302.bb +3 -2
@@ -29,7 +29,7 @@ do_compile () { # The original makefile doesn't differentiate between CC and CC_FOR_BUILD, # so we build wart manually. Note that you need a ckwart.o with the proper # timestamp to make this hack work: - ${BUILD_CC} -c ckwart.c + ${BUILD_CC} -DMAINTYPE=int -c -o ckwart.o ckwart.c ${BUILD_CC} -o wart ckwart.o ./wart ckcpro.w ckcpro.c
@@ -46,7 +46,8 @@ do_compile () { -DNORESEND -DNOAUTODL -DNOSTREAMING -DNOHINTS -DNOCKXYZ -DNOLEARN \ -DNOMKDIR -DNOPERMS -DNOCKTIMERS -DNOCKREGEX -DNOREALPATH \ -DCK_SMALL -DNOLOGDIAL -DNORENAME -DNOWHATAMI \ - -DNOARROWKEYS -DMAINTYPE=int" + -DNOARROWKEYS -DMAINTYPE=int \ + -D_DEFAULT_SOURCE -ansi" } do_install () {
PATCH 3/4 uim: Upgrade to 1.9.0
In reply to Khem RajChangelog - https://github.com/uim/uim/releases/tag/1.9.0
---
meta-oe/recipes-support/uim/{uim_1.8.9.bb => uim_1.9.0.bb} | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
rename meta-oe/recipes-support/uim/{uim_1.8.9.bb => uim_1.9.0.bb} (98%)meta-oe/recipes-support/uim/uim_1.9.0.bb renamed from meta-oe/recipes-support/uim/uim_1.8.9.bb +1 -1
@@ -8,7 +8,7 @@ SRC_URI = "https://github.com/uim/uim/releases/download/${PV}/uim-${PV}.tar.bz2" SRC_URI:append:class-target = "\ file://uim-module-manager.patch \ " -SRC_URI[sha256sum] = "dbbd983768bf748449551644f330dbebe859bfeb6f024fea6697ac75131c7aa4" +SRC_URI[sha256sum] = "271f0ed5f455e5bffa859f01b2d0f7fb966554ebd4822657afb67a0431dd85a8" UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases" UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
PATCH 4/4 procmail: Fix build with GCC-14
In reply to Khem Rajaids 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
--- .../procmail/procmail/gcc14.patch | 127 ++++++++++++++++++ .../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
meta-oe/recipes-support/procmail/procmail/gcc14.patch new file +127 -0
@@ -0,0 +1,127 @@ +From: Santiago Vila <[email protected]> +Subject: Fix build with gcc-14 +Bug-Debian: https://bugs.debian.org/1075398 + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> +--- a/initmake ++++ b/initmake +@@ -124,7 +124,7 @@ else + fi + + cat >_autotst.c <<HERE +-main() ++int main() + { return 0; + } + HERE +@@ -200,7 +200,7 @@ cat >_autotst.c <<HERE + #include <sys/types.h> + #include <stdio.h> + #include <sys/stat.h> +-main() ++int main() + { struct stat buf;return!&buf; + } + HERE +--- a/src/autoconf ++++ b/src/autoconf +@@ -414,6 +414,12 @@ cat >_autotst.c <<HERE + int dolock,child[NR_of_forks],timeout,fdcollect; + char dirlocktest[]="_locktest"; + ++#include <stdlib.h> ++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 <<HERE + #ifndef NO_COMSAT + #include "network.h" + #endif ++int setrgid(); ++int setresgid(); + int main(){char a[2]; + endpwent();endgrent();memmove(a,"0",1);bcopy("0",a,1);strcspn(a,"0"); + strtol("0",(char**)0,10);strchr("0",'0');strpbrk(a,"0");rename(a,"0"); +@@ -1059,7 +1067,7 @@ echo 'Testing for memmove, strchr, strpb + echo ' rename, setrgid, setegid, pow, opendir, mkdir, waitpid, fsync,' + echo ' ftruncate, strtod, strncasecmp, strerror, strlcat,' + echo ' memset, bzero, and _exit' +-if $MAKE _autotst.$O >$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 */
meta-oe/recipes-support/procmail/procmail_3.22.bb +3 -1
@@ -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() {
RE: [oe] [meta-oe][PATCH 4/4] procmail: Fix build with GCC-14
Review
Quoted 7 lines
do_compile(){(quoted diff) +1
-5- 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}"
-Wno-implicit-int cannot be deleted.
Because although bitbake did not exit, if this option is removed, do_compile will reveal an error that caused procmail to not generate. You can check log.do.compile to confirm this issue.
--
Best Regards
---------------------------------------------------
Wang Mingyu
FUJITSU NANJING SOFTWARE TECHNOLOGY CO., LTD. (FNST) No.6 Wenzhu Road, Nanjing, 210012, China TEL:+86+25-86630566--8568
COINS: 79988548
FAX: +86+25-83317685
MAIL: [email protected]
Quoted 191 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Khem Raj via lists.openembedded.org
Sent: Monday, March 17, 2025 5:27 AM
To: [email protected]
Cc: Khem Raj <[email protected]>
Subject: [oe] [meta-oe][PATCH 4/4] procmail: Fix build with GCC-14aids 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 <[email protected]>--- .../procmail/procmail/gcc14.patch | 127 ++++++++++++++++++ .../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.patchmeta-oe/recipes-support/procmail/procmail/gcc14.patch new file +56
-0@@ -0,0 +1,127 @@ +From: Santiago Vila <[email protected]> +Subject: Fix build with gcc-14 +Bug-Debian: https://bugs.debian.org/1075398 + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> +--- a/initmake ++++ b/initmake +@@ -124,7 +124,7 @@ else + fi + + cat >_autotst.c <<HERE +-main() ++int main() + { return 0; + } + HERE +@@ -200,7 +200,7 @@ cat >_autotst.c <<HERE #include <sys/types.h> +#include <stdio.h> #include <sys/stat.h> +-main() ++int main() + { struct stat buf;return!&buf; + } + HERE +--- a/src/autoconf ++++ b/src/autoconf +@@ -414,6 +414,12 @@ cat >_autotst.c <<HERE int +dolock,child[NR_of_forks],timeout,fdcollect; + char dirlocktest[]="_locktest"; + ++#include <stdlib.h> ++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 crashtest */
meta-oe/recipes-support/procmail/procmail/gcc14.patch new file +16
-0+ 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 crashtest */
meta-oe/recipes-support/procmail/procmail/gcc14.patch new file +12
-0+ 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 thenmeta-oe/recipes-support/procmail/procmail/gcc14.patch new file +38
-0+ $FGREP -v include/ <_autotst.rrr >_autotst.$O @@ -1029,6 +1035,8 @@ +cat >_autotst.c <<HERE #ifndef NO_COMSAT #include "network.h" + #endif ++int setrgid(); ++int setresgid(); + int main(){char a[2]; + endpwent();endgrent();memmove(a,"0",1);bcopy("0",a,1);strcspn(a,"0"); + +strtol("0",(char**)0,10);strchr("0",'0');strpbrk(a,"0");rename(a,"0"); +@@ -1059,7 +1067,7 @@ echo 'Testing for memmove, strchr, strpb + echo ' rename, setrgid, setegid, pow, opendir, mkdir, waitpid, fsync,' + echo ' ftruncate, strtod, strncasecmp, strerror, strlcat,' + echo ' memset, bzero, and _exit' +-if $MAKE _autotst.$O >$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 */meta-oe/recipes-support/procmail/procmail_3.22.bb +1
-0@@ -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"meta-oe/recipes-support/procmail/procmail_3.22.bb +1
-0@@ -24,6 +25,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a71e50e197a992c862379e576e669757 \ DEPENDS = "libnet" inherit autotools-brokensep + do_configure() { find examples -type f | xargs chmod 644export CC="${BUILD_CC}"meta-oe/recipes-support/procmail/procmail_3.22.bb +1
-5@@ -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() {
Re: [oe] [meta-oe][PATCH 4/4] procmail: Fix build with GCC-14
Quoted 12 lines · Mingyu Wang (Fujitsu)
Review
Quoted 8 lines
do_compile(){(quoted diff) +1
-5- 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}"-Wno-implicit-int cannot be deleted.
Because although bitbake did not exit, if this option is removed,do_compilewill reveal an error that caused procmail to not generate. You can check log.do.compile to confirm this issue.
interesting. Please send a patch to reinstate it.?
Quoted 203 lines
--
Best Regards
---------------------------------------------------
Wang Mingyu
FUJITSU NANJING SOFTWARE TECHNOLOGY CO., LTD. (FNST) No.6 Wenzhu Road, Nanjing, 210012, China TEL:+86+25-86630566--8568
COINS: 79988548
FAX: +86+25-83317685
MAIL: [email protected]Quoted 191 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Khem Raj via lists.openembedded.org
Sent: Monday, March 17, 2025 5:27 AM
To: [email protected]
Cc: Khem Raj <[email protected]>
Subject: [oe] [meta-oe][PATCH 4/4] procmail: Fix build with GCC-14aids 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 <[email protected]>--- .../procmail/procmail/gcc14.patch | 127 ++++++++++++++++++ .../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.patchmeta-oe/recipes-support/procmail/procmail/gcc14.patch new file +56
-0@@ -0,0 +1,127 @@ +From: Santiago Vila <[email protected]> +Subject: Fix build with gcc-14 +Bug-Debian: https://bugs.debian.org/1075398 + +Upstream-Status: Pending +Signed-off-by: Khem Raj <[email protected]> +--- a/initmake ++++ b/initmake +@@ -124,7 +124,7 @@ else + fi + + cat >_autotst.c <<HERE +-main() ++int main() + { return 0; + } + HERE +@@ -200,7 +200,7 @@ cat >_autotst.c <<HERE #include <sys/types.h> +#include <stdio.h> #include <sys/stat.h> +-main() ++int main() + { struct stat buf;return!&buf; + } + HERE +--- a/src/autoconf ++++ b/src/autoconf +@@ -414,6 +414,12 @@ cat >_autotst.c <<HERE int +dolock,child[NR_of_forks],timeout,fdcollect; + char dirlocktest[]="_locktest"; + ++#include <stdlib.h> ++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 crashtest */
meta-oe/recipes-support/procmail/procmail/gcc14.patch new file +16
-0+ 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 crashtest */
meta-oe/recipes-support/procmail/procmail/gcc14.patch new file +12
-0+ 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 thenmeta-oe/recipes-support/procmail/procmail/gcc14.patch new file +38
-0+ $FGREP -v include/ <_autotst.rrr >_autotst.$O @@ -1029,6 +1035,8 @@ +cat >_autotst.c <<HERE #ifndef NO_COMSAT #include "network.h" + #endif ++int setrgid(); ++int setresgid(); + int main(){char a[2]; + endpwent();endgrent();memmove(a,"0",1);bcopy("0",a,1);strcspn(a,"0"); + +strtol("0",(char**)0,10);strchr("0",'0');strpbrk(a,"0");rename(a,"0"); +@@ -1059,7 +1067,7 @@ echo 'Testing for memmove, strchr, strpb + echo ' rename, setrgid, setegid, pow, opendir, mkdir, waitpid, fsync,' + echo ' ftruncate, strtod, strncasecmp, strerror, strlcat,' + echo ' memset, bzero, and _exit' +-if $MAKE _autotst.$O >$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 */meta-oe/recipes-support/procmail/procmail_3.22.bb +1
-0@@ -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"meta-oe/recipes-support/procmail/procmail_3.22.bb +1
-0@@ -24,6 +25,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a71e50e197a992c862379e576e669757 \ DEPENDS = "libnet" inherit autotools-brokensep + do_configure() { find examples -type f | xargs chmod 644export CC="${BUILD_CC}"meta-oe/recipes-support/procmail/procmail_3.22.bb +1
-5@@ -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() {