Add patch0 to fix build error about implicit-fallthrough cases

This commit is contained in:
Yunying Sun 2017-07-31 11:01:39 +08:00
parent f4ab801b43
commit 7afceb6d11
4 changed files with 49 additions and 2 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/tpm2.0-tools-2.1.0.tar.gz /tpm2.0-tools-2.1.0.tar.gz
/gcc7-implicit-fallthrough-complaining-fix.patch

View File

@ -0,0 +1,40 @@
From 1321aee7d2a3be248d32b012ee6d2a4452435690 Mon Sep 17 00:00:00 2001
From: Philip Tricca <flihp@twobit.us>
Date: Thu, 27 Jul 2017 21:08:53 -0700
Subject: [PATCH] gcc7: Change two case fallthrough conditions that upset gcc7.
Signed-off-by: Philip Tricca <flihp@twobit.us>
---
tools/main.c | 2 +-
tools/tpm2_dump_capability.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/main.c b/tools/main.c
index 4f1fd83..67148be 100644
--- a/tools/main.c
+++ b/tools/main.c
@@ -60,7 +60,7 @@ main (int argc,
case 1:
execute_man (argv[0], envp);
LOG_ERR ("failed to load manpage, check your environment / PATH\n");
- /* fallthrough */
+ exit (1);
case 2:
exit (1);
}
diff --git a/tools/tpm2_dump_capability.c b/tools/tpm2_dump_capability.c
index 728dce7..1c56dbc 100644
--- a/tools/tpm2_dump_capability.c
+++ b/tools/tpm2_dump_capability.c
@@ -600,7 +600,7 @@ dump_tpm_capability (TPMU_CAPABILITIES *capabilities,
case TPM_CAP_COMMANDS:
dump_command_attr_array (capabilities->command.commandAttributes,
capabilities->command.count);
- /* fallthrough */
+ break;
default:
return 1;
}
--
1.8.3.1

View File

@ -1 +1 @@
SHA512 (tpm2.0-tools-2.1.0.tar.gz) = 5488ffdc42a318fae9a307a333cdbce730a144cea847fe68546367c87689cd675d1376c1a638dc4eefa6231d4d7f7417215cc4eb606e999a757425f5097eb0c4 SHA512 (gcc7-implicit-fallthrough-complaining-fix.patch) = eb4f8c1df2c294e2b286c71c1c3cd99b0b263da4c5044490024b2c3e98edad5cd707faa7711c8d6192953000861196e5a204144f7111354967bdb40bfc0cbeef

View File

@ -1,6 +1,6 @@
Name: tpm2-tools Name: tpm2-tools
Version: 2.1.0 Version: 2.1.0
Release: 1%{?dist} Release: 2%{?dist}
Summary: A TPM2.0 testing tool build upon TPM2.0-TSS Summary: A TPM2.0 testing tool build upon TPM2.0-TSS
%global pkg_prefix tpm2.0-tools %global pkg_prefix tpm2.0-tools
@ -9,6 +9,9 @@ License: BSD
URL: https://github.com/01org/tpm2.0-tools URL: https://github.com/01org/tpm2.0-tools
Source0: https://github.com/01org/tpm2.0-tools/archive/%{version}.tar.gz#/%{pkg_prefix}-%{version}.tar.gz Source0: https://github.com/01org/tpm2.0-tools/archive/%{version}.tar.gz#/%{pkg_prefix}-%{version}.tar.gz
# https://github.com/01org/tpm2.0-tools/pull/381
Patch0: gcc7-implicit-fallthrough-complaining-fix.patch
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: libtool BuildRequires: libtool
BuildRequires: autoconf-archive BuildRequires: autoconf-archive
@ -48,6 +51,9 @@ tpm2-tools is a batch of testing tools for tpm2.0. It is based on tpm2-tss.
%{_mandir}/man8/tpm2_*.8.gz %{_mandir}/man8/tpm2_*.8.gz
%changelog %changelog
* Mon Jul 31 2017 Sun Yunying <yunying.sun@intel.com> - 2.1.0-2
- Add patch to fix build error about implict-fallthrough
* Fri Jul 28 2017 Sun Yunying <yunying.sun@intel.com> - 2.1.0-1 * Fri Jul 28 2017 Sun Yunying <yunying.sun@intel.com> - 2.1.0-1
- Update to latest upstream release 2.1.0 - Update to latest upstream release 2.1.0