diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-12-01 10:33:53 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-02 17:18:57 +0000 |
commit | e0a7cccb95e3992516880639b90923a2ab30fd91 (patch) | |
tree | 3b84221bb020be3ea4bedbcf2b0b7a131a34d019 /meta/recipes-graphics | |
parent | a5ee86fd998bb3eb3211933ac87daf584b009152 (diff) | |
download | poky-e0a7cccb95e3992516880639b90923a2ab30fd91.tar.gz |
virglrenderer: Fix build with clang
Fix warnigns seen with -Wembedded-directive -D_FORTIFY_SOURCE=2
(From OE-Core rev: 6e698bac55f785e84f52161cfab8fe6e764940cc)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r-- | meta/recipes-graphics/virglrenderer/virglrenderer/0001-vtest-Fix-undefined-behavior-with-clang.patch | 56 | ||||
-rw-r--r-- | meta/recipes-graphics/virglrenderer/virglrenderer_1.0.0.bb | 1 |
2 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-graphics/virglrenderer/virglrenderer/0001-vtest-Fix-undefined-behavior-with-clang.patch b/meta/recipes-graphics/virglrenderer/virglrenderer/0001-vtest-Fix-undefined-behavior-with-clang.patch new file mode 100644 index 0000000000..48488d7be1 --- /dev/null +++ b/meta/recipes-graphics/virglrenderer/virglrenderer/0001-vtest-Fix-undefined-behavior-with-clang.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | From ea328b246d093477cf26a68b42e975aaaef6abad Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 28 Nov 2023 21:55:36 -0800 | ||
4 | Subject: [PATCH] vtest: Fix undefined behavior with clang | ||
5 | |||
6 | This is seen when compiling with CC="clang -D_FORTIFY_SOURCE=2" | ||
7 | Move #ifdef outside of printf() call. | ||
8 | |||
9 | Fixes | ||
10 | |||
11 | | ../git/vtest/vtest_server.c:244:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive] | ||
12 | | 244 | #ifdef ENABLE_VENUS | ||
13 | | | ^ | ||
14 | | ../git/vtest/vtest_server.c:246:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive] | ||
15 | | 246 | #endif | ||
16 | | | ^ | ||
17 | |||
18 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1309] | ||
19 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
20 | --- | ||
21 | vtest/vtest_server.c | 12 ++++++++---- | ||
22 | 1 file changed, 8 insertions(+), 4 deletions(-) | ||
23 | |||
24 | diff --git a/vtest/vtest_server.c b/vtest/vtest_server.c | ||
25 | index 1ca7f74f..93d949d7 100644 | ||
26 | --- a/vtest/vtest_server.c | ||
27 | +++ b/vtest/vtest_server.c | ||
28 | @@ -197,6 +197,12 @@ static void vtest_server_parse_args(int argc, char **argv) | ||
29 | /* getopt_long stores the option index here. */ | ||
30 | int option_index = 0; | ||
31 | |||
32 | +#ifdef ENABLE_VENUS | ||
33 | + char* ven = " [--venus]"; | ||
34 | +#else | ||
35 | + char* ven = ""; | ||
36 | +#endif | ||
37 | + | ||
38 | do { | ||
39 | ret = getopt_long(argc, argv, "", long_options, &option_index); | ||
40 | |||
41 | @@ -244,10 +250,8 @@ static void vtest_server_parse_args(int argc, char **argv) | ||
42 | printf("Usage: %s [--no-fork] [--no-loop-or-fork] [--multi-clients] " | ||
43 | "[--use-glx] [--use-egl-surfaceless] [--use-gles] [--no-virgl]" | ||
44 | "[--rendernode <dev>] [--socket-path <path>] " | ||
45 | -#ifdef ENABLE_VENUS | ||
46 | - " [--venus]" | ||
47 | -#endif | ||
48 | - " [file]\n", argv[0]); | ||
49 | + "%s" | ||
50 | + " [file]\n", argv[0], ven); | ||
51 | exit(EXIT_FAILURE); | ||
52 | break; | ||
53 | } | ||
54 | -- | ||
55 | 2.43.0 | ||
56 | |||
diff --git a/meta/recipes-graphics/virglrenderer/virglrenderer_1.0.0.bb b/meta/recipes-graphics/virglrenderer/virglrenderer_1.0.0.bb index ffe30a9c52..eb7ba1089f 100644 --- a/meta/recipes-graphics/virglrenderer/virglrenderer_1.0.0.bb +++ b/meta/recipes-graphics/virglrenderer/virglrenderer_1.0.0.bb | |||
@@ -12,6 +12,7 @@ DEPENDS = "libdrm libepoxy virtual/egl virtual/libgbm" | |||
12 | SRCREV = "9c9d55ecbe502e0d71ee99529709efcca69aac42" | 12 | SRCREV = "9c9d55ecbe502e0d71ee99529709efcca69aac42" |
13 | SRC_URI = "git://gitlab.freedesktop.org/virgl/virglrenderer.git;branch=main;protocol=https \ | 13 | SRC_URI = "git://gitlab.freedesktop.org/virgl/virglrenderer.git;branch=main;protocol=https \ |
14 | file://0001-meson.build-use-python3-directly-for-python.patch \ | 14 | file://0001-meson.build-use-python3-directly-for-python.patch \ |
15 | file://0001-vtest-Fix-undefined-behavior-with-clang.patch \ | ||
15 | " | 16 | " |
16 | 17 | ||
17 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |