package/tpm2-tools: fix build with gcc 4.8
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Mon, 9 Aug 2021 21:29:59 +0000 (23:29 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 12 Aug 2021 21:49:19 +0000 (23:49 +0200)
commit6b04d4f22cf5dbc75042b67859c8d2c8d8bbdc49
tree770f0b96af92165b87a013569593f267d61a9e96
parent884a415ccb66c04767ad40d82b713f499a9bb8a7
package/tpm2-tools: fix build with gcc 4.8

Fix the following build failure with gcc 4.8 raised since bump to
version 4.3.2 in commit 91aa6efa8588bf7617cc4a640eb55052b524ceb7:

lib/tpm2_eventlog_yaml.c: In function 'yaml_uefi_var_unicodename':
lib/tpm2_eventlog_yaml.c:130:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for(size_t i = 0; i < data->UnicodeNameLength; ++i, tmp += ret) {
     ^
lib/tpm2_eventlog_yaml.c:130:5: note: use option -std=c99 or -std=gnu99 to compile your code
lib/tpm2_eventlog_yaml.c: In function 'yaml_specid_algs':
lib/tpm2_eventlog_yaml.c:335:5: error: 'for' loop initial declarations are only allowed in C99 mode
     for (size_t i = 0; i < count; ++i, ++alg) {
     ^

Fixes:
 - http://autobuild.buildroot.org/results/018c75cfbb34006c0bca52dcc255ad6f9cc43b77

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/tpm2-tools/0001-configure-make-build-gnu99.patch [new file with mode: 0644]
package/tpm2-tools/tpm2-tools.mk