From 908b3309dc8f8393044fe66b551264120b7c309f Mon Sep 17 00:00:00 2001 From: Yunying Sun Date: Jul 31 2017 07:36:29 +0000 Subject: Add patch to fix gcc7 complaining about implict-fallthrough cases --- diff --git a/.gitignore b/.gitignore index 6582457..f0a8877 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /tpm2.0-tools-2.1.0.tar.gz +/gcc7-implict-fallthrough-fix.patch diff --git a/gcc7-implict-fallthrough-fix.patch b/gcc7-implict-fallthrough-fix.patch new file mode 100644 index 0000000..c40449d --- /dev/null +++ b/gcc7-implict-fallthrough-fix.patch @@ -0,0 +1,24 @@ +diff -ru tpm2.0-tools-2.1.0-orig/tools/main.c tpm2.0-tools-2.1.0/tools/main.c +--- tpm2.0-tools-2.1.0-orig/tools/main.c 2017-07-31 14:26:37.436505592 +0800 ++++ tpm2.0-tools-2.1.0/tools/main.c 2017-07-31 14:27:12.999707128 +0800 +@@ -61,7 +61,7 @@ + execute_man (argv[0], envp); + fprintf (stderr, + "failed to load manpage, check your environment / PATH\n"); +- /* no break */ ++ exit (1); + case 2: + exit (1); + } +diff -ru tpm2.0-tools-2.1.0-orig/tools/tpm2_dump_capability.c tpm2.0-tools-2.1.0/tools/tpm2_dump_capability.c +--- tpm2.0-tools-2.1.0-orig/tools/tpm2_dump_capability.c 2017-07-31 14:26:37.436505592 +0800 ++++ tpm2.0-tools-2.1.0/tools/tpm2_dump_capability.c 2017-07-31 14:29:30.831488212 +0800 +@@ -595,7 +595,7 @@ + case TPM_CAP_COMMANDS: + dump_command_attr_array (capabilities->command.commandAttributes, + capabilities->command.count); +- /* no break */ ++ break; + default: + return 1; + } diff --git a/sources b/sources index e3aa564..ae4e590 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (tpm2.0-tools-2.1.0.tar.gz) = 5488ffdc42a318fae9a307a333cdbce730a144cea847fe68546367c87689cd675d1376c1a638dc4eefa6231d4d7f7417215cc4eb606e999a757425f5097eb0c4 +SHA512 (gcc7-implict-fallthrough-fix.patch) = c936b6770e43fe6ab333b4f04d09c5be14a26f845f865c5744379569accc9cc681e9394161b406dcf942387b887a60e31200ffeea2d10d9dfd3487190c462c65 diff --git a/tpm2-tools.spec b/tpm2-tools.spec index 63e76d4..009fbe3 100644 --- a/tpm2-tools.spec +++ b/tpm2-tools.spec @@ -1,6 +1,6 @@ Name: tpm2-tools Version: 2.1.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A TPM2.0 testing tool build upon TPM2.0-TSS %global pkg_prefix tpm2.0-tools @@ -9,6 +9,9 @@ License: BSD 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 +# https://github.com/01org/tpm2.0-tools/pull/381 +Patch0: gcc7-implict-fallthrough-fix.patch + BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: autoconf-archive @@ -31,7 +34,7 @@ Requires: tpm2-tss%{?_isa} >= 1.1.0-1%{?dist} tpm2-tools is a batch of testing tools for tpm2.0. It is based on tpm2-tss. %prep -%autosetup -n %{pkg_prefix}-%{version} +%autosetup -p1 -n %{pkg_prefix}-%{version} ./bootstrap %build @@ -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 %changelog +* Mon Jul 31 2017 Sun Yunying - 2.1.0-2 +- Add patch to fix gcc7 complaining about implicit-fallthrough cases + * Fri Jul 28 2017 Sun Yunying - 2.1.0-1 - Update to latest upstream release 2.1.0