summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2025-03-24 09:33:28 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-03-27 11:19:03 +0000
commit1b716172ae8eeb571f0d35c188de031d2e4fe2bb (patch)
tree88742b0bb686e428fd27d03b9f8eb05bb1078592 /meta
parent0480bea97a80b633994946a57f367e67cfca3765 (diff)
downloadpoky-1b716172ae8eeb571f0d35c188de031d2e4fe2bb.tar.gz
which: Fix build with gcc-15 on musl
(From OE-Core rev: 17993bc259c603bdbdb54c930c2c054fd178b391) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch39
-rw-r--r--meta/recipes-extended/which/which_2.21.bb1
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch b/meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch
new file mode 100644
index 0000000000..e006d797d3
--- /dev/null
+++ b/meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch
@@ -0,0 +1,39 @@
1From 16a1647fc26953fab659de5f55d4c0defdfb894f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 22 Mar 2025 17:56:19 -0700
4Subject: [PATCH] getopt: Fix signature of getenv function
5
6This happens on musl systems using GCC 15
7
8../which-2.21/getopt.h:106:12: error: conflicting types for 'getopt'; have 'int(void)'
9 106 | extern int getopt ();
10 | ^~~~~~
11
12Upstream-Status: Submitted [https://lists.gnu.org/archive/html/which-bugs/2025-03/msg00000.html]
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 getopt.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18--- a/getopt.c
19+++ b/getopt.c
20@@ -209,7 +209,7 @@ static char *posixly_correct;
21 /* Avoid depending on library functions or files
22 whose names are inconsistent. */
23
24-char *getenv ();
25+char *getenv (const char*);
26
27 static char *
28 my_index (str, chr)
29--- a/getopt.h
30+++ b/getopt.h
31@@ -103,7 +103,7 @@ struct option
32 errors, only prototype getopt for the GNU C library. */
33 extern int getopt (int argc, char *const *argv, const char *shortopts);
34 #else /* not __GNU_LIBRARY__ */
35-extern int getopt ();
36+extern int getopt (int, char * const [], const char *);
37 #endif /* __GNU_LIBRARY__ */
38 extern int getopt_long (int argc, char *const *argv, const char *shortopts,
39 const struct option *longopts, int *longind);
diff --git a/meta/recipes-extended/which/which_2.21.bb b/meta/recipes-extended/which/which_2.21.bb
index a8cb45f8fc..6e855bca3f 100644
--- a/meta/recipes-extended/which/which_2.21.bb
+++ b/meta/recipes-extended/which/which_2.21.bb
@@ -18,6 +18,7 @@ EXTRA_OECONF = "--disable-iberty"
18 18
19SRC_URI = "${GNU_MIRROR}/which/which-${PV}.tar.gz \ 19SRC_URI = "${GNU_MIRROR}/which/which-${PV}.tar.gz \
20 file://automake.patch \ 20 file://automake.patch \
21 file://0001-getopt-Fix-signature-of-getenv-function.patch \
21 " 22 "
22 23
23SRC_URI[sha256sum] = "f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad" 24SRC_URI[sha256sum] = "f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad"