diff mbox series

[v7,5/8] package/virglrenderer: Fix build with glibc 2.43

Message ID 20260515-virglrenderer-v7-5-1f1814b65ccd@gmail.com
State Changes Requested
Headers show
Series Add virglrenderer support | expand

Commit Message

Joseph Kogut May 16, 2026, 2:03 a.m. UTC
Add an upstream patch to fix the build with glibc 2.43, not present in a
stable release yet.

Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
---
 .../0001-fix-build-with-glibc-2.43.patch           | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)

Comments

Arnout Vandecappelle May 21, 2026, 8:09 p.m. UTC | #1
On 16/05/2026 04:03, Joseph Kogut wrote:
> Add an upstream patch to fix the build with glibc 2.43, not present in a
> stable release yet.

  This should be squashed with the previous commit. No special mention in the 
commit message is needed, it's clear from the patch itself why it is needed.

  Regards,
  Arnout

> 
> Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
> ---
>   .../0001-fix-build-with-glibc-2.43.patch           | 39 ++++++++++++++++++++++
>   1 file changed, 39 insertions(+)
> 
> diff --git a/package/virglrenderer/0001-fix-build-with-glibc-2.43.patch b/package/virglrenderer/0001-fix-build-with-glibc-2.43.patch
> new file mode 100644
> index 0000000000..fda1d9b218
> --- /dev/null
> +++ b/package/virglrenderer/0001-fix-build-with-glibc-2.43.patch
> @@ -0,0 +1,39 @@
> +From 986b5fc57b07c06b5e0b3a3694d06898ebc80163 Mon Sep 17 00:00:00 2001
> +From: Maximilian Hofmann <maxi@maxiicodes.dev>
> +Date: Thu, 26 Feb 2026 23:28:58 +0100
> +Subject: [PATCH] fix: build with glibc 2.43
> +
> +Several glibc functions now return a const pointer if the input is a
> +const pointer and a non-const pointer if the input is non-const, causing
> +a build failure.
> +
> +Fix this by declaring the output pointers as const if they are never
> +modified, and for the lone failure where the output is modified, instead
> +make the input non-const.
> +
> +Signed-off-by: Maximilian Hofmann <maxi@maxiicodes.dev>
> +Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1599>
> +
> +Upstream: https://gitlab.freedesktop.org/virgl/virglrenderer/-/commit/986b5fc57b07c06b5e0b3a3694d06898ebc80163
> +
> +Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
> +---
> + src/gallium/auxiliary/tgsi/tgsi_text.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
> +index db7d7b95..7e37bf79 100644
> +--- a/src/gallium/auxiliary/tgsi/tgsi_text.c
> ++++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
> +@@ -84,7 +84,7 @@ streq_nocase_uprcase(const char *str1,
> + static inline bool skip_n_chars(const char **pcur,
> +                                    int n)
> + {
> +-   char* str = memchr(*pcur, '\0', n);
> ++   const char* str = memchr(*pcur, '\0', n);
> +    if (unlikely(str)) {
> +       *pcur = str;
> +       return false;
> +--
> +2.53.0
> +
>
diff mbox series

Patch

diff --git a/package/virglrenderer/0001-fix-build-with-glibc-2.43.patch b/package/virglrenderer/0001-fix-build-with-glibc-2.43.patch
new file mode 100644
index 0000000000..fda1d9b218
--- /dev/null
+++ b/package/virglrenderer/0001-fix-build-with-glibc-2.43.patch
@@ -0,0 +1,39 @@ 
+From 986b5fc57b07c06b5e0b3a3694d06898ebc80163 Mon Sep 17 00:00:00 2001
+From: Maximilian Hofmann <maxi@maxiicodes.dev>
+Date: Thu, 26 Feb 2026 23:28:58 +0100
+Subject: [PATCH] fix: build with glibc 2.43
+
+Several glibc functions now return a const pointer if the input is a
+const pointer and a non-const pointer if the input is non-const, causing
+a build failure.
+
+Fix this by declaring the output pointers as const if they are never
+modified, and for the lone failure where the output is modified, instead
+make the input non-const.
+
+Signed-off-by: Maximilian Hofmann <maxi@maxiicodes.dev>
+Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/1599>
+
+Upstream: https://gitlab.freedesktop.org/virgl/virglrenderer/-/commit/986b5fc57b07c06b5e0b3a3694d06898ebc80163
+
+Signed-off-by: Joseph Kogut <joseph.kogut@gmail.com>
+---
+ src/gallium/auxiliary/tgsi/tgsi_text.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c
+index db7d7b95..7e37bf79 100644
+--- a/src/gallium/auxiliary/tgsi/tgsi_text.c
++++ b/src/gallium/auxiliary/tgsi/tgsi_text.c
+@@ -84,7 +84,7 @@ streq_nocase_uprcase(const char *str1,
+ static inline bool skip_n_chars(const char **pcur,
+                                    int n)
+ {
+-   char* str = memchr(*pcur, '\0', n);
++   const char* str = memchr(*pcur, '\0', n);
+    if (unlikely(str)) {
+       *pcur = str;
+       return false;
+-- 
+2.53.0
+