From 4caca5b780dbbdeaeffbc1054a6e99c5f596026d Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Wed, 20 Oct 2021 15:19:32 +0800 Subject: [PATCH] tpm2-tools: fix build with openssl 3.0 Backport a patch to disable '-Werror' to fix build error until upstream addresses openssl 3.0 compatibility issue. Signed-off-by: Yi Zhao --- ...ly-use-Werror-for-non-release-builds.patch | 34 +++++++++++++++++++ .../tpm2-tools/tpm2-tools_4.1.3.bb | 1 + 2 files changed, 35 insertions(+) create mode 100644 meta-tpm2/recipes-tpm/tpm2-tools/files/0001-build-only-use-Werror-for-non-release-builds.patch diff --git a/meta-tpm2/recipes-tpm/tpm2-tools/files/0001-build-only-use-Werror-for-non-release-builds.patch b/meta-tpm2/recipes-tpm/tpm2-tools/files/0001-build-only-use-Werror-for-non-release-builds.patch new file mode 100644 index 0000000..9edad0c --- /dev/null +++ b/meta-tpm2/recipes-tpm/tpm2-tools/files/0001-build-only-use-Werror-for-non-release-builds.patch @@ -0,0 +1,34 @@ +From 0d7cb21f01e390ee42d5238d297e48b39b23205a Mon Sep 17 00:00:00 2001 +From: Jonas Witschel +Date: Fri, 14 May 2021 12:03:24 +0200 +Subject: [PATCH] build: only use -Werror for non-release builds + +While we want to catch any compiler warnings during development, a release +build should never fail due to e.g. stricter static checks introduced by new +compiler versions. + +Upstream-Status: Backport +[https://github.com/tpm2-software/tpm2-tools/commit/a691a7de76a5d57af90a868d68c5f48e4e47015b] + +Signed-off-by: Jonas Witschel +Signed-off-by: Yi Zhao +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index fd7fa55..7ad2806 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -178,7 +178,7 @@ AS_IF([test x"$enable_hardening" != x"no"], [ + + add_hardened_c_flag([-Wall]) + add_hardened_c_flag([-Wextra]) +- add_hardened_c_flag([-Werror]) ++ AS_IF([test "x$ax_is_release" = "xno"], [add_hardened_c_flag([-Werror])]) + + add_hardened_c_flag([-Wformat]) + add_hardened_c_flag([-Wformat-security]) +-- +2.17.1 + diff --git a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_4.1.3.bb b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_4.1.3.bb index 1df2d40..496f494 100644 --- a/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_4.1.3.bb +++ b/meta-tpm2/recipes-tpm/tpm2-tools/tpm2-tools_4.1.3.bb @@ -9,6 +9,7 @@ DEPENDS = "tpm2-abrmd tpm2-tss openssl curl autoconf-archive" SRC_URI = "https://github.com/tpm2-software/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.gz \ file://0001-tests-switch-to-python3.patch \ file://CVE-2021-3565.patch \ + file://0001-build-only-use-Werror-for-non-release-builds.patch \ " SRC_URI[md5sum] = "48e0f58232b6a86fe4d007acf12af283"