Signed-off-by: Khem Raj <raj.k...@gmail.com>
---
 ...01-sdiff-Match-execvp-argument-types.patch | 37 +++++++++++++++++++
 ...efine-stricoll-as-_stricoll-on-mingw.patch | 37 +++++++++++++++++++
 .../diffutils/diffutils_%.bbappend            |  5 ++-
 3 files changed, 78 insertions(+), 1 deletion(-)
 create mode 100644 
recipes-extended/diffutils/diffutils/0001-sdiff-Match-execvp-argument-types.patch
 create mode 100644 
recipes-extended/diffutils/diffutils/0002-Define-stricoll-as-_stricoll-on-mingw.patch

diff --git 
a/recipes-extended/diffutils/diffutils/0001-sdiff-Match-execvp-argument-types.patch
 
b/recipes-extended/diffutils/diffutils/0001-sdiff-Match-execvp-argument-types.patch
new file mode 100644
index 0000000..2dff6db
--- /dev/null
+++ 
b/recipes-extended/diffutils/diffutils/0001-sdiff-Match-execvp-argument-types.patch
@@ -0,0 +1,37 @@
+From 197c0c72a6cb60a647db02c2874a8103be4557d6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.k...@gmail.com>
+Date: Wed, 29 May 2024 10:58:54 -0700
+Subject: [PATCH 1/2] sdiff: Match execvp argument types
+
+Fixes build with GCC-14
+
+../../diffutils-3.10/src/sdiff.c:579:28: error: passing argument 2 of 
'_execvp' from incompatible pointer type [-Wincompatible-pointer-types]
+  579 |       execvp (diffargv[0], (char **) diffargv);
+      |                            ^~~~~~~~~~~~~~~~~~
+      |                            |
+      |                            char **
+
+* src/sdiff.c (main): execpv expects const pointer.
+
+Upstream-Status: Submitted 
[https://lists.gnu.org/archive/html/bug-diffutils/2024-05/msg00003.html]
+Signed-off-by: Khem Raj <raj.k...@gmail.com>
+---
+ src/sdiff.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sdiff.c b/src/sdiff.c
+index 0b638d4..a4642b1 100644
+--- a/src/sdiff.c
++++ b/src/sdiff.c
+@@ -576,7 +576,7 @@ main (int argc, char *argv[])
+       diffarg (argv[optind]);
+       diffarg (argv[optind + 1]);
+       diffarg (0);
+-      execvp (diffargv[0], (char **) diffargv);
++      execvp (diffargv[0], diffargv);
+       perror_fatal (diffargv[0]);
+     }
+   else
+-- 
+2.45.1
+
diff --git 
a/recipes-extended/diffutils/diffutils/0002-Define-stricoll-as-_stricoll-on-mingw.patch
 
b/recipes-extended/diffutils/diffutils/0002-Define-stricoll-as-_stricoll-on-mingw.patch
new file mode 100644
index 0000000..23807c6
--- /dev/null
+++ 
b/recipes-extended/diffutils/diffutils/0002-Define-stricoll-as-_stricoll-on-mingw.patch
@@ -0,0 +1,37 @@
+From 9e1318440a5f7f4a00f077fc3cbd1edc07e0985d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.k...@gmail.com>
+Date: Wed, 29 May 2024 21:20:12 -0700
+Subject: [PATCH 2/2] Define stricoll as _stricoll on mingw
+
+* src/system.h: Define stricoll as _stricoll on mingw.
+
+Upstream-Status: Submitted 
[https://lists.gnu.org/archive/html/bug-diffutils/2024-05/msg00004.html]
+Signed-off-by: Khem Raj <raj.k...@gmail.com>
+---
+ src/system.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/system.h b/src/system.h
+index b37893f..4c7a318 100644
+--- a/src/system.h
++++ b/src/system.h
+@@ -63,6 +63,16 @@
+ #include <inttypes.h>
+ 
+ #include <string.h>
++/* stricoll is not provided by any headers on windows/mingw
++   only _stricoll is provided, the function is however aliased
++   to provide stricoll in runtime libraries, the configure check
++   to detect stricoll defines the prototype in generated test
++   itself and thus test passes, however compiling fails with
++   GCC-14 which enables implicit-function-declaration as error  */ 
++#if defined _WIN32 && ! defined __CYGWIN__
++#define stricoll _stricoll
++#endif
++
+ #if ! HAVE_STRCASECOLL
+ # if HAVE_STRICOLL || defined stricoll
+ #  define strcasecoll(a, b) stricoll (a, b)
+-- 
+2.45.1
+
diff --git a/recipes-extended/diffutils/diffutils_%.bbappend 
b/recipes-extended/diffutils/diffutils_%.bbappend
index 8b54cb0..284f8cb 100644
--- a/recipes-extended/diffutils/diffutils_%.bbappend
+++ b/recipes-extended/diffutils/diffutils_%.bbappend
@@ -3,6 +3,10 @@ FILESEXTRAPATHS:prepend:mingw32 := "${THISDIR}/${BPN}:"
 # Add some definitions for POSIX signals..
 CFLAGS:append:mingw32 = " -DSIGALRM=14 -DSIGHUP=1 -DSIGQUIT=3 -DSIGPIPE=13 
-DSIGTSTP=18 -DSIGSTOP=17 "
 
+SRC_URI:append:mingw32 = "\
+       file://0001-sdiff-Match-execvp-argument-types.patch \
+       file://0002-Define-stricoll-as-_stricoll-on-mingw.patch"
+
 do_configure:prepend:mingw32 () {
     # Remove building of "man" and "gnulib-tests". The tests don't
     # cross-compile for mingw, but we aren't using them anyway
@@ -11,4 +15,3 @@ do_configure:prepend:mingw32 () {
         -e 's:^SUBDIRS =\(.*\) gnulib-tests\>:SUBDIRS = \1 :g' \
         ${S}/Makefile.am
 }
-
-- 
2.45.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#63237): https://lists.yoctoproject.org/g/yocto/message/63237
Mute This Topic: https://lists.yoctoproject.org/mt/106383346/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to