diff options
| author | Khem Raj <raj.khem@gmail.com> | 2025-03-24 09:33:25 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-27 11:19:03 +0000 |
| commit | afeb5ba6f1075806235fc650cb0dfc0cb6a89659 (patch) | |
| tree | 2dbb946c16d3bcabacddb4a3d4e6c0cce1f036e8 | |
| parent | 7dae0ab041f15c6e3e391eed848c25294723557a (diff) | |
| download | poky-afeb5ba6f1075806235fc650cb0dfc0cb6a89659.tar.gz | |
make: Fix signatures for getenv() and getopt()
Fixes build with GCC 15
(From OE-Core rev: 6b0ca7f009b3473d9793159d82807f1a22520914)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/make/make/0001-Fix-signatures-for-getenv-getopt.patch | 60 | ||||
| -rw-r--r-- | meta/recipes-devtools/make/make_4.4.1.bb | 1 |
2 files changed, 61 insertions, 0 deletions
diff --git a/meta/recipes-devtools/make/make/0001-Fix-signatures-for-getenv-getopt.patch b/meta/recipes-devtools/make/make/0001-Fix-signatures-for-getenv-getopt.patch new file mode 100644 index 0000000000..707de7f2d0 --- /dev/null +++ b/meta/recipes-devtools/make/make/0001-Fix-signatures-for-getenv-getopt.patch | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | From f844b6588dbdb93d9ff0fe883bd801df62c965b7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sat, 22 Mar 2025 14:07:56 -0700 | ||
| 4 | Subject: [PATCH] Fix signatures for getenv/getopt | ||
| 5 | |||
| 6 | GCC-15 complains about missing parameters, this gets found | ||
| 7 | out when using non-glibc ( e.g. musl ) C library | ||
| 8 | |||
| 9 | Fixes | ||
| 10 | lib/fnmatch.c:124:14: error: conflicting types for 'getenv'; have 'char *(void)' | ||
| 11 | | 124 | extern char *getenv (); | ||
| 12 | | | ^~~~~~ | ||
| 13 | |||
| 14 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/bug-make/2025-03/msg00032.html] | ||
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 16 | --- | ||
| 17 | lib/fnmatch.c | 2 +- | ||
| 18 | src/getopt.c | 2 +- | ||
| 19 | src/getopt.h | 2 +- | ||
| 20 | 3 files changed, 3 insertions(+), 3 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/lib/fnmatch.c b/lib/fnmatch.c | ||
| 23 | index 01da376..cb1c856 100644 | ||
| 24 | --- a/lib/fnmatch.c | ||
| 25 | +++ b/lib/fnmatch.c | ||
| 26 | @@ -121,7 +121,7 @@ USA. */ | ||
| 27 | whose names are inconsistent. */ | ||
| 28 | |||
| 29 | # if !defined _LIBC && !defined getenv | ||
| 30 | -extern char *getenv (); | ||
| 31 | +extern char *getenv (const char *); | ||
| 32 | # endif | ||
| 33 | |||
| 34 | # ifndef errno | ||
| 35 | diff --git a/src/getopt.c b/src/getopt.c | ||
| 36 | index 7a792de..76251cc 100644 | ||
| 37 | --- a/src/getopt.c | ||
| 38 | +++ b/src/getopt.c | ||
| 39 | @@ -202,7 +202,7 @@ static char *posixly_correct; | ||
| 40 | whose names are inconsistent. */ | ||
| 41 | |||
| 42 | #ifndef getenv | ||
| 43 | -extern char *getenv (); | ||
| 44 | +extern char *getenv (const char *); | ||
| 45 | #endif | ||
| 46 | |||
| 47 | static char * | ||
| 48 | diff --git a/src/getopt.h b/src/getopt.h | ||
| 49 | index df18cee..d8bb226 100644 | ||
| 50 | --- a/src/getopt.h | ||
| 51 | +++ b/src/getopt.h | ||
| 52 | @@ -102,7 +102,7 @@ struct option | ||
| 53 | errors, only prototype getopt for the GNU C library. */ | ||
| 54 | extern int getopt (int argc, char *const *argv, const char *shortopts); | ||
| 55 | #else /* not __GNU_LIBRARY__ */ | ||
| 56 | -extern int getopt (); | ||
| 57 | +extern int getopt (int, char * const*, const char *); | ||
| 58 | #endif /* __GNU_LIBRARY__ */ | ||
| 59 | extern int getopt_long (int argc, char *const *argv, const char *shortopts, | ||
| 60 | const struct option *longopts, int *longind); | ||
diff --git a/meta/recipes-devtools/make/make_4.4.1.bb b/meta/recipes-devtools/make/make_4.4.1.bb index c73751ddcb..0879b3baa9 100644 --- a/meta/recipes-devtools/make/make_4.4.1.bb +++ b/meta/recipes-devtools/make/make_4.4.1.bb | |||
| @@ -4,6 +4,7 @@ require make.inc | |||
| 4 | 4 | ||
| 5 | SRC_URI += " \ | 5 | SRC_URI += " \ |
| 6 | file://0001-m4-getloadavg.m4-restrict-AIX-specific-test-on-AIX.patch \ | 6 | file://0001-m4-getloadavg.m4-restrict-AIX-specific-test-on-AIX.patch \ |
| 7 | file://0001-Fix-signatures-for-getenv-getopt.patch \ | ||
| 7 | " | 8 | " |
| 8 | 9 | ||
| 9 | EXTRA_OECONF += "--without-guile" | 10 | EXTRA_OECONF += "--without-guile" |
