summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2019-08-20 09:04:41 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-30 16:44:42 +0100
commit5c9a02ed678f2a26a26c6398c2837fbd2ddcb561 (patch)
tree09c32bec837f5e135c3a74c7a85a012a060adfd2
parentcf77c4ae2473fa50cbe6d8b7e71273a37ecfc4cf (diff)
downloadpoky-5c9a02ed678f2a26a26c6398c2837fbd2ddcb561.tar.gz
meson: backport fix for builds with -Werror=return-type
(From OE-Core rev: 0ccf907992a0e3560897ac300ee6b1352d969c42) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/meson/meson.inc1
-rw-r--r--meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch84
2 files changed, 85 insertions, 0 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index 2d18f72c0c..bfe9851e94 100644
--- a/meta/recipes-devtools/meson/meson.inc
+++ b/meta/recipes-devtools/meson/meson.inc
@@ -16,6 +16,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
16 file://cross-prop-default.patch \ 16 file://cross-prop-default.patch \
17 file://many-cross.patch \ 17 file://many-cross.patch \
18 file://cross-libdir.patch \ 18 file://cross-libdir.patch \
19 file://0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch \
19 " 20 "
20SRC_URI[sha256sum] = "ef9f14326ec1e30d3ba1a26df0f92826ede5a79255ad723af78a2691c37109fd" 21SRC_URI[sha256sum] = "ef9f14326ec1e30d3ba1a26df0f92826ede5a79255ad723af78a2691c37109fd"
21SRC_URI[md5sum] = "0267b0871266056184c484792572c682" 22SRC_URI[md5sum] = "0267b0871266056184c484792572c682"
diff --git a/meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch b/meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch
new file mode 100644
index 0000000000..1f22755e17
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch
@@ -0,0 +1,84 @@
1From 7e83cf1edac2a57c08ebb1ce7f21c2a539d5c300 Mon Sep 17 00:00:00 2001
2From: Martin Liska <mliska@suse.cz>
3Date: Mon, 15 Jul 2019 10:06:17 +0200
4Subject: [PATCH] Fix missing return statements that are seen with
5 -Werror=return-type.
6
7Error example:
8
9Code:
10
11 #include <locale.h>
12 int main () {
13 /* If it's not defined as a macro, try to use as a symbol */
14 #ifndef LC_MESSAGES
15 LC_MESSAGES;
16 #endif
17 }
18Compiler stdout:
19
20Compiler stderr:
21 In file included from /usr/include/locale.h:25,
22 from /tmp/tmpep_i4iwg/testfile.c:2:
23/usr/include/features.h:382:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
24 382 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
25 | ^~~~~~~
26/tmp/tmpep_i4iwg/testfile.c: In function 'main':
27/tmp/tmpep_i4iwg/testfile.c:8:9: error: control reaches end of non-void function [-Werror=return-type]
28 8 | }
29 | ^
30cc1: some warnings being treated as errors
31
32Upstream-Status: Backport
33Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
34---
35 mesonbuild/compilers/c.py | 5 +++++
36 1 file changed, 5 insertions(+)
37
38diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
39index b0096459..69cf84a4 100644
40--- a/mesonbuild/compilers/c.py
41+++ b/mesonbuild/compilers/c.py
42@@ -387,6 +387,7 @@ class CCompiler(Compiler):
43 #ifndef {symbol}
44 {symbol};
45 #endif
46+ return 0;
47 }}'''
48 return self.compiles(t.format(**fargs), env, extra_args=extra_args,
49 dependencies=dependencies)
50@@ -563,6 +564,7 @@ class CCompiler(Compiler):
51 {prefix}
52 int main(int argc, char **argv) {{
53 {type} something;
54+ return 0;
55 }}'''
56 if not self.compiles(t.format(**fargs), env, extra_args=extra_args,
57 dependencies=dependencies):
58@@ -598,6 +600,7 @@ class CCompiler(Compiler):
59 {prefix}
60 int main(int argc, char **argv) {{
61 {type} something;
62+ return 0;
63 }}'''
64 if not self.compiles(t.format(**fargs), env, extra_args=extra_args,
65 dependencies=dependencies):
66@@ -672,6 +675,7 @@ class CCompiler(Compiler):
67 #include <stdio.h>
68 int main(int argc, char *argv[]) {{
69 printf ("{fmt}", {cast} {f}());
70+ return 0;
71 }}'''.format(**fargs)
72 res = self.run(code, env, extra_args=extra_args, dependencies=dependencies)
73 if not res.compiled:
74@@ -823,6 +827,7 @@ class CCompiler(Compiler):
75 #error "No definition for __builtin_{func} found in the prefix"
76 #endif
77 #endif
78+ return 0;
79 }}'''
80 return self.links(t.format(**fargs), env, extra_args=extra_args,
81 dependencies=dependencies)
82--
832.17.1
84