libtpm: Fix arm build issues

backport two upstream patches and remove local verison

Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
Armin Kuster
2017-02-18 11:27:18 -08:00
parent c12aa7601e
commit 21e1f1177c
4 changed files with 61 additions and 19 deletions
@@ -0,0 +1,26 @@
From 09e7dd42e5201d079bad70e9f7cc6033ce1c7cad Mon Sep 17 00:00:00 2001
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
Date: Fri, 3 Feb 2017 10:58:22 -0500
Subject: [PATCH] Convert another vdprintf to dprintf
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Upstream-Status: Backport
Signed-off-by: Armin Kuster <akuster@mvista.com>
---
src/tpm_library.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: git/src/tpm_library.c
===================================================================
--- git.orig/src/tpm_library.c
+++ git/src/tpm_library.c
@@ -427,7 +427,7 @@ void TPMLIB_LogPrintfA(unsigned int inde
indent = sizeof(spaces) - 1;
memset(spaces, ' ', indent);
spaces[indent] = 0;
- vdprintf(debug_fd, spaces, NULL);
+ dprintf(debug_fd, "%s", spaces);
}
va_start(args, format);
@@ -0,0 +1,33 @@
From 6a9b4e5d70f770aa9ca31e3e6d3b1ae72c192070 Mon Sep 17 00:00:00 2001
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
Date: Tue, 31 Jan 2017 20:10:51 -0500
Subject: [PATCH] Use format '%s' for call to dprintf
Fix the dprintf call to use a format parameter that otherwise causes
errors with gcc on certain platforms.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Upstream-Status: Backport
replaces local patch
Signed-off-by: Armin Kuster <akuster@mvsita.com>
---
src/tpm_library.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: git/src/tpm_library.c
===================================================================
--- git.orig/src/tpm_library.c
+++ git/src/tpm_library.c
@@ -405,8 +405,8 @@ int TPMLIB_LogPrintf(const char *format,
}
if (debug_prefix)
- dprintf(debug_fd, debug_prefix);
- dprintf(debug_fd, buffer);
+ dprintf(debug_fd, "%s", debug_prefix);
+ dprintf(debug_fd, "%s", buffer);
return i;
}
@@ -1,18 +0,0 @@
Upstream-Status: Pending
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Index: src/tpm_library.c
===================================================================
--- git.orig/src/tpm_library.c
+++ git/src/tpm_library.c
@@ -405,8 +405,8 @@ int TPMLIB_LogPrintf(const char *format,
}
if (debug_prefix)
- dprintf(debug_fd, debug_prefix);
- dprintf(debug_fd, buffer);
+ dprintf(debug_fd, "%s" , debug_prefix);
+ dprintf(debug_fd, "%s" , buffer);
return i;
}
+2 -1
View File
@@ -5,7 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=97e5eea8d700d76b3ddfd35c4c96485f"
SRCREV = "ad44846dda5a96e269ad2f78a532e01e9a2f02a1"
SRC_URI = " \
git://github.com/stefanberger/libtpms.git \
file://fix_dprintf_issue.patch \
file://Convert-another-vdprintf-to-dprintf.patch \
file://Use-format-s-for-call-to-dprintf.patch \
"
S = "${WORKDIR}/git"