mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-08 08:30:47 -09:00
package/libtpms: fix build with host gcc >= 15.x, glibc >= 2.43
Fixes:
https://autobuild.buildroot.net/results/7a6/7a6ea7c513e8f1dcc32d868108bfb2a907d6fe85/
The previous change to src/tpm_library.c dates back to 2024:
https://github.com/stefanberger/libtpms/commits/master/src/tpm_library.c
so a backport to buildroot LTS branches should be considered.
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
[Julien: reword title to mention glibc 2.43]
Signed-off-by: Julien Olivain <ju.o@free.fr>
(cherry picked from commit f773fd6787)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
committed by
Thomas Perale
parent
b2dedc5541
commit
60d110ac8d
@@ -0,0 +1,40 @@
|
||||
From fc8820cfaa8b5e17328f731df93911f6ab92443b Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Berger <stefanb@linux.ibm.com>
|
||||
Date: Fri, 2 Jan 2026 11:37:31 -0500
|
||||
Subject: [PATCH] Fix a compilation error in TPMLIB_GetPlaintext
|
||||
|
||||
Fix a compilation error that newer gcc versions may complain about:
|
||||
|
||||
tpm_library.c: In function 'TPMLIB_GetPlaintext':
|
||||
tpm_library.c:441:11: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
|
||||
441 | start = strstr(stream, starttag);
|
||||
| ^
|
||||
At top level:
|
||||
cc1: note: unrecognized command-line option '-Wno-self-assign' may have been intended to silence earlier diagnostics
|
||||
cc1: all warnings being treated as errors
|
||||
|
||||
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
|
||||
|
||||
Upstream: https://github.com/stefanberger/libtpms/commit/fc8820cfaa8b5e17328f731df93911f6ab92443b
|
||||
|
||||
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
|
||||
---
|
||||
src/tpm_library.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/tpm_library.c b/src/tpm_library.c
|
||||
index f48f4fd3..7b2ea687 100644
|
||||
--- a/src/tpm_library.c
|
||||
+++ b/src/tpm_library.c
|
||||
@@ -435,7 +435,7 @@ static unsigned char *TPMLIB_GetPlaintext(const char *stream,
|
||||
const char *endtag,
|
||||
size_t *length)
|
||||
{
|
||||
- char *start, *end;
|
||||
+ const char *start, *end;
|
||||
unsigned char *plaintext = NULL;
|
||||
|
||||
start = strstr(stream, starttag);
|
||||
--
|
||||
2.47.3
|
||||
|
||||
Reference in New Issue
Block a user