]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
libtpms: Fix build agsinst glibc >= 2.43
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 27 Jan 2026 16:20:05 +0000 (16:20 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 28 Jan 2026 11:29:23 +0000 (11:29 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/libtpms
src/patches/libtmps-0.10.2-FTBFS.patch [new file with mode: 0644]

index 61cecc20e5c2a04cb1ae7ada9beab6754a3c3cb1..71028b44d0117d48eb06b4d5965de2b4cbb06903 100644 (file)
@@ -82,6 +82,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
        -mkdir -pv $(DIR_APP)
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/libtmps-0.10.2-FTBFS.patch
        cd $(DIR_APP) && autoreconf -vfi
        cd $(DIR_APP) && ./configure \
                                --prefix=/usr \
diff --git a/src/patches/libtmps-0.10.2-FTBFS.patch b/src/patches/libtmps-0.10.2-FTBFS.patch
new file mode 100644 (file)
index 0000000..dba78b5
--- /dev/null
@@ -0,0 +1,33 @@
+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>
+---
+ 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 f48f4fd38..7b2ea687e 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);