[yocto] [meta-security][PATCH 2/6] swtpm: fix musl build issues
Armin Kuster
akuster808 at gmail.com
Wed Mar 22 05:46:40 PDT 2017
add two fixes for musl build issues.
also update to latest tip
Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
recipes-tpm/swtpm/files/fix_fcntl_h.patch | 21 +++++++++++++++++++++
recipes-tpm/swtpm/files/ioctl_h.patch | 22 ++++++++++++++++++++++
recipes-tpm/swtpm/swtpm_1.0.bb | 4 +++-
3 files changed, 46 insertions(+), 1 deletion(-)
create mode 100644 recipes-tpm/swtpm/files/fix_fcntl_h.patch
create mode 100644 recipes-tpm/swtpm/files/ioctl_h.patch
diff --git a/recipes-tpm/swtpm/files/fix_fcntl_h.patch b/recipes-tpm/swtpm/files/fix_fcntl_h.patch
new file mode 100644
index 0000000..e844045
--- /dev/null
+++ b/recipes-tpm/swtpm/files/fix_fcntl_h.patch
@@ -0,0 +1,21 @@
+logging: Fix musl build issue with fcntl
+
+ error: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Werror=cpp]
+ #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.
+
+Upstream-Status: Pending
+Signed-off-by: Armin Kuster <akuster at mvista.com>
+
+Index: git/src/swtpm/logging.c
+===================================================================
+--- git.orig/src/swtpm/logging.c
++++ git/src/swtpm/logging.c
+@@ -43,7 +43,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <sys/types.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stdarg.h>
diff --git a/recipes-tpm/swtpm/files/ioctl_h.patch b/recipes-tpm/swtpm/files/ioctl_h.patch
new file mode 100644
index 0000000..d736bc6
--- /dev/null
+++ b/recipes-tpm/swtpm/files/ioctl_h.patch
@@ -0,0 +1,22 @@
+tpm_ioctl: fix musl for missing ioctl
+
+tpm_ioctl.c: In function 'ioctl_to_cmd':
+tpm_ioctl.c:86:26: error: '_IOC_NRSHIFT' undeclared (first use in this function)
+ return ((ioctlnum >> _IOC_NRSHIFT) & _IOC_NRMASK) + 1;
+
+
+Upstream-status:
+Signed-off-by: Armin Kuster <akuster at mvista.com>
+
+Index: git/src/swtpm_ioctl/tpm_ioctl.c
+===================================================================
+--- git.orig/src/swtpm_ioctl/tpm_ioctl.c
++++ git/src/swtpm_ioctl/tpm_ioctl.c
+@@ -58,6 +58,7 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <sys/ioctl.h>
++#include <asm/ioctl.h>
+ #include <getopt.h>
+ #include <sys/un.h>
+ #include <sys/types.h>
diff --git a/recipes-tpm/swtpm/swtpm_1.0.bb b/recipes-tpm/swtpm/swtpm_1.0.bb
index 7b9662a..99c6fdc 100644
--- a/recipes-tpm/swtpm/swtpm_1.0.bb
+++ b/recipes-tpm/swtpm/swtpm_1.0.bb
@@ -10,11 +10,13 @@ DEPENDS = "libtasn1 fuse expect socat glib-2.0 libtpm libtpm-native"
DEPENDS += "tpm-tools-native expect-native socat-native"
RDEPENDS_${PN} += "tpm-tools"
-SRCREV = "65d8e4d83447f4c13a41a6f995bd0490f49bc5ef"
+SRCREV = "d7bbe3de5cc58c1dca41149df89cfdc08019a722"
SRC_URI = " \
git://github.com/stefanberger/swtpm.git \
file://fix_signed_issue.patch \
file://fix_lib_search_path.patch \
+ file://fix_fcntl_h.patch \
+ file://ioctl_h.patch \
"
S = "${WORKDIR}/git"
--
2.7.4
More information about the yocto
mailing list