From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Khem Raj <raj.khem@gmail.com>, Alexander Kanavin <alex@linutronix.de>
Subject: [PATCH 5/6] virglrenderer: Fix build with clang
Date: Fri, 1 Dec 2023 10:33:53 -0800 [thread overview]
Message-ID: <20231201183356.311137-5-raj.khem@gmail.com> (raw)
In-Reply-To: <20231201183356.311137-1-raj.khem@gmail.com>
Fix warnigns seen with -Wembedded-directive -D_FORTIFY_SOURCE=2
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Alexander Kanavin <alex@linutronix.de>
---
...st-Fix-undefined-behavior-with-clang.patch | 56 +++++++++++++++++++
.../virglrenderer/virglrenderer_1.0.0.bb | 1 +
2 files changed, 57 insertions(+)
create mode 100644 meta/recipes-graphics/virglrenderer/virglrenderer/0001-vtest-Fix-undefined-behavior-with-clang.patch
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 00000000000..48488d7be12
--- /dev/null
+++ b/meta/recipes-graphics/virglrenderer/virglrenderer/0001-vtest-Fix-undefined-behavior-with-clang.patch
@@ -0,0 +1,56 @@
+From ea328b246d093477cf26a68b42e975aaaef6abad Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Nov 2023 21:55:36 -0800
+Subject: [PATCH] vtest: Fix undefined behavior with clang
+
+This is seen when compiling with CC="clang -D_FORTIFY_SOURCE=2"
+Move #ifdef outside of printf() call.
+
+Fixes
+
+| ../git/vtest/vtest_server.c:244:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
+| 244 | #ifdef ENABLE_VENUS
+| | ^
+| ../git/vtest/vtest_server.c:246:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
+| 246 | #endif
+| | ^
+
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1309]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ vtest/vtest_server.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/vtest/vtest_server.c b/vtest/vtest_server.c
+index 1ca7f74f..93d949d7 100644
+--- a/vtest/vtest_server.c
++++ b/vtest/vtest_server.c
+@@ -197,6 +197,12 @@ static void vtest_server_parse_args(int argc, char **argv)
+ /* getopt_long stores the option index here. */
+ int option_index = 0;
+
++#ifdef ENABLE_VENUS
++ char* ven = " [--venus]";
++#else
++ char* ven = "";
++#endif
++
+ do {
+ ret = getopt_long(argc, argv, "", long_options, &option_index);
+
+@@ -244,10 +250,8 @@ static void vtest_server_parse_args(int argc, char **argv)
+ printf("Usage: %s [--no-fork] [--no-loop-or-fork] [--multi-clients] "
+ "[--use-glx] [--use-egl-surfaceless] [--use-gles] [--no-virgl]"
+ "[--rendernode <dev>] [--socket-path <path>] "
+-#ifdef ENABLE_VENUS
+- " [--venus]"
+-#endif
+- " [file]\n", argv[0]);
++ "%s"
++ " [file]\n", argv[0], ven);
+ exit(EXIT_FAILURE);
+ break;
+ }
+--
+2.43.0
+
diff --git a/meta/recipes-graphics/virglrenderer/virglrenderer_1.0.0.bb b/meta/recipes-graphics/virglrenderer/virglrenderer_1.0.0.bb
index ffe30a9c525..eb7ba1089f6 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"
SRCREV = "9c9d55ecbe502e0d71ee99529709efcca69aac42"
SRC_URI = "git://gitlab.freedesktop.org/virgl/virglrenderer.git;branch=main;protocol=https \
file://0001-meson.build-use-python3-directly-for-python.patch \
+ file://0001-vtest-Fix-undefined-behavior-with-clang.patch \
"
S = "${WORKDIR}/git"
--
2.43.0
next prev parent reply other threads:[~2023-12-01 18:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-01 18:33 [PATCH v12 1/6] vte: upgrade 0.72.2 -> 0.74.0 Khem Raj
2023-12-01 18:33 ` [PATCH v12 2/6] vte: Upgrade to 0.74.1 Khem Raj
2023-12-01 18:33 ` [PATCH v12 3/6] vte: Separate out gtk4 pieces of vte into individual packages Khem Raj
2023-12-01 18:33 ` [PATCH 4/6] rust-common.bbclass: Define rust arch for x32 platforms Khem Raj
2023-12-01 18:33 ` Khem Raj [this message]
2023-12-01 18:33 ` [PATCH 6/6] llvm: Upgrade to 17.0.6 Khem Raj
2023-12-01 23:27 ` [OE-core] " Alexandre Belloni
[not found] ` <179CD8EAC4F00896.18076@lists.openembedded.org>
2023-12-01 23:55 ` Alexandre Belloni
2023-12-02 0:03 ` Khem Raj
2023-12-02 0:10 ` Khem Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231201183356.311137-5-raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--cc=alex@linutronix.de \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox