summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/meson
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2019-08-13 09:28:56 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-14 17:33:48 +0100
commit1b57d8e43bb86c03c4d92581a6319fc03d38c020 (patch)
treef50a22a7cd343f10c41ccbb24a142250bb1fee2a /meta/recipes-devtools/meson
parent686cf796b94eb44f92d907e24562790ef7c8b1e8 (diff)
downloadpoky-1b57d8e43bb86c03c4d92581a6319fc03d38c020.tar.gz
meson: backport fix for builds with -Werror=return-type
(From OE-Core rev: de623085039111d9988918ae95e07e48108a9ff1) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/meson')
-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.patch100
2 files changed, 101 insertions, 0 deletions
diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index 662368e219..14e5f8a610 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://0001-mesonbuild-environment.py-check-environment-for-vari.patch \ 16 file://0001-mesonbuild-environment.py-check-environment-for-vari.patch \
17 file://0001-modules-python.py-do-not-substitute-python-s-install.patch \ 17 file://0001-modules-python.py-do-not-substitute-python-s-install.patch \
18 file://vala-cross-compile.patch \ 18 file://vala-cross-compile.patch \
19 file://0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch \
19 " 20 "
20SRC_URI[sha256sum] = "f27b7a60f339ba66fe4b8f81f0d1072e090a08eabbd6aa287683b2c2b9dd2d82" 21SRC_URI[sha256sum] = "f27b7a60f339ba66fe4b8f81f0d1072e090a08eabbd6aa287683b2c2b9dd2d82"
21SRC_URI[md5sum] = "48787e391ec5c052799a3dd491f73909" 22SRC_URI[md5sum] = "48787e391ec5c052799a3dd491f73909"
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..16c6d90761
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/0001-Fix-missing-return-statements-that-are-seen-with-Wer.patch
@@ -0,0 +1,100 @@
1From 15f44be1c7f71cb0a8c6863917acbbc301c621fe 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
24requires compiling with optimization (-O) [-Wcpp]
25 382 | # warning _FORTIFY_SOURCE requires compiling with optimization
26(-O)
27 | ^~~~~~~
28/tmp/tmpep_i4iwg/testfile.c: In function 'main':
29/tmp/tmpep_i4iwg/testfile.c:8:9: error: control reaches end of non-void
30function [-Werror=return-type]
31 8 | }
32 | ^
33cc1: some warnings being treated as errors
34
35Upstream-Status: Backport
36Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
37---
38 mesonbuild/compilers/c.py | 1 +
39 mesonbuild/compilers/clike.py | 5 +++++
40 2 files changed, 6 insertions(+)
41
42diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
43index 3b58a076..9ef92077 100644
44--- a/mesonbuild/compilers/c.py
45+++ b/mesonbuild/compilers/c.py
46@@ -70,6 +70,7 @@ class CCompiler(CLikeCompiler, Compiler):
47 #ifndef {symbol}
48 {symbol};
49 #endif
50+ return 0;
51 }}'''
52 return self.compiles(t.format(**fargs), env, extra_args=extra_args,
53 dependencies=dependencies)
54diff --git a/mesonbuild/compilers/clike.py b/mesonbuild/compilers/clike.py
55index 83f67591..f9cbeabd 100644
56--- a/mesonbuild/compilers/clike.py
57+++ b/mesonbuild/compilers/clike.py
58@@ -375,6 +375,7 @@ class CLikeCompiler:
59 #ifndef {symbol}
60 {symbol};
61 #endif
62+ return 0;
63 }}'''
64 return self.compiles(t.format(**fargs), env, extra_args=extra_args,
65 dependencies=dependencies)
66@@ -554,6 +555,7 @@ class CLikeCompiler:
67 {prefix}
68 int main(int argc, char **argv) {{
69 {type} something;
70+ return 0;
71 }}'''
72 if not self.compiles(t.format(**fargs), env, extra_args=extra_args,
73 dependencies=dependencies)[0]:
74@@ -589,6 +591,7 @@ class CLikeCompiler:
75 {prefix}
76 int main(int argc, char **argv) {{
77 {type} something;
78+ return 0;
79 }}'''
80 if not self.compiles(t.format(**fargs), env, extra_args=extra_args,
81 dependencies=dependencies)[0]:
82@@ -667,6 +670,7 @@ class CLikeCompiler:
83 #include <stdio.h>
84 int main(int argc, char *argv[]) {{
85 printf ("{fmt}", {cast} {f}());
86+ return 0;
87 }}'''.format(**fargs)
88 res = self.run(code, env, extra_args=extra_args, dependencies=dependencies)
89 if not res.compiled:
90@@ -819,6 +823,7 @@ class CLikeCompiler:
91 #error "No definition for __builtin_{func} found in the prefix"
92 #endif
93 #endif
94+ return 0;
95 }}'''
96 return self.links(t.format(**fargs), env, extra_args=extra_args,
97 dependencies=dependencies)
98--
992.17.1
100