summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-05-29 22:11:00 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-30 08:12:34 +0100
commit55f0631d5ba1c05373db663e888e6442344e6dc3 (patch)
tree227d60a7bda7c0d0885d49a5b3996e85acf874cf
parente1a29a656c444c238b92147e6bc37382254cd12f (diff)
downloadmeta-mingw-55f0631d5ba1c05373db663e888e6442344e6dc3.tar.gz
diffutils: Fix build with GCC-14
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--recipes-extended/diffutils/diffutils/0001-sdiff-Match-execvp-argument-types.patch37
-rw-r--r--recipes-extended/diffutils/diffutils/0002-Define-stricoll-as-_stricoll-on-mingw.patch37
-rw-r--r--recipes-extended/diffutils/diffutils_%.bbappend5
3 files changed, 78 insertions, 1 deletions
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 @@
1From 197c0c72a6cb60a647db02c2874a8103be4557d6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 29 May 2024 10:58:54 -0700
4Subject: [PATCH 1/2] sdiff: Match execvp argument types
5
6Fixes build with GCC-14
7
8../../diffutils-3.10/src/sdiff.c:579:28: error: passing argument 2 of '_execvp' from incompatible pointer type [-Wincompatible-pointer-types]
9 579 | execvp (diffargv[0], (char **) diffargv);
10 | ^~~~~~~~~~~~~~~~~~
11 | |
12 | char **
13
14* src/sdiff.c (main): execpv expects const pointer.
15
16Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bug-diffutils/2024-05/msg00003.html]
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 src/sdiff.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/src/sdiff.c b/src/sdiff.c
23index 0b638d4..a4642b1 100644
24--- a/src/sdiff.c
25+++ b/src/sdiff.c
26@@ -576,7 +576,7 @@ main (int argc, char *argv[])
27 diffarg (argv[optind]);
28 diffarg (argv[optind + 1]);
29 diffarg (0);
30- execvp (diffargv[0], (char **) diffargv);
31+ execvp (diffargv[0], diffargv);
32 perror_fatal (diffargv[0]);
33 }
34 else
35--
362.45.1
37
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 @@
1From 9e1318440a5f7f4a00f077fc3cbd1edc07e0985d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 29 May 2024 21:20:12 -0700
4Subject: [PATCH 2/2] Define stricoll as _stricoll on mingw
5
6* src/system.h: Define stricoll as _stricoll on mingw.
7
8Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bug-diffutils/2024-05/msg00004.html]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/system.h | 10 ++++++++++
12 1 file changed, 10 insertions(+)
13
14diff --git a/src/system.h b/src/system.h
15index b37893f..4c7a318 100644
16--- a/src/system.h
17+++ b/src/system.h
18@@ -63,6 +63,16 @@
19 #include <inttypes.h>
20
21 #include <string.h>
22+/* stricoll is not provided by any headers on windows/mingw
23+ only _stricoll is provided, the function is however aliased
24+ to provide stricoll in runtime libraries, the configure check
25+ to detect stricoll defines the prototype in generated test
26+ itself and thus test passes, however compiling fails with
27+ GCC-14 which enables implicit-function-declaration as error */
28+#if defined _WIN32 && ! defined __CYGWIN__
29+#define stricoll _stricoll
30+#endif
31+
32 #if ! HAVE_STRCASECOLL
33 # if HAVE_STRICOLL || defined stricoll
34 # define strcasecoll(a, b) stricoll (a, b)
35--
362.45.1
37
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}:"
3# Add some definitions for POSIX signals.. 3# Add some definitions for POSIX signals..
4CFLAGS:append:mingw32 = " -DSIGALRM=14 -DSIGHUP=1 -DSIGQUIT=3 -DSIGPIPE=13 -DSIGTSTP=18 -DSIGSTOP=17 " 4CFLAGS:append:mingw32 = " -DSIGALRM=14 -DSIGHUP=1 -DSIGQUIT=3 -DSIGPIPE=13 -DSIGTSTP=18 -DSIGSTOP=17 "
5 5
6SRC_URI:append:mingw32 = "\
7 file://0001-sdiff-Match-execvp-argument-types.patch \
8 file://0002-Define-stricoll-as-_stricoll-on-mingw.patch"
9
6do_configure:prepend:mingw32 () { 10do_configure:prepend:mingw32 () {
7 # Remove building of "man" and "gnulib-tests". The tests don't 11 # Remove building of "man" and "gnulib-tests". The tests don't
8 # cross-compile for mingw, but we aren't using them anyway 12 # cross-compile for mingw, but we aren't using them anyway
@@ -11,4 +15,3 @@ do_configure:prepend:mingw32 () {
11 -e 's:^SUBDIRS =\(.*\) gnulib-tests\>:SUBDIRS = \1 :g' \ 15 -e 's:^SUBDIRS =\(.*\) gnulib-tests\>:SUBDIRS = \1 :g' \
12 ${S}/Makefile.am 16 ${S}/Makefile.am
13} 17}
14