* [Buildroot] [PATCH 1/1] package/tpm2-tools: fix build with gcc 4.8
@ 2021-08-09 21:29 Fabrice Fontaine
2021-08-12 21:49 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2021-08-09 21:29 UTC (permalink / raw)
To: buildroot; +Cc: Fabrice Fontaine
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>
---
.../0001-configure-make-build-gnu99.patch | 30 +++++++++++++++++++
package/tpm2-tools/tpm2-tools.mk | 2 ++
2 files changed, 32 insertions(+)
create mode 100644 package/tpm2-tools/0001-configure-make-build-gnu99.patch
diff --git a/package/tpm2-tools/0001-configure-make-build-gnu99.patch b/package/tpm2-tools/0001-configure-make-build-gnu99.patch
new file mode 100644
index 0000000000..37ca6c5873
--- /dev/null
+++ b/package/tpm2-tools/0001-configure-make-build-gnu99.patch
@@ -0,0 +1,30 @@
+From 521c3cc506b18c5c84d86e1e90d1daee39849b0c Mon Sep 17 00:00:00 2001
+From: William Roberts <william.c.roberts@intel.com>
+Date: Mon, 8 Feb 2021 11:57:28 -0600
+Subject: [PATCH] configure: make build gnu99
+
+Signed-off-by: William Roberts <william.c.roberts@intel.com>
+
+[Retrieved from:
+https://github.com/tpm2-software/tpm2-tools/commit/521c3cc506b18c5c84d86e1e90d1daee39849b0c
+and updated to set gnu99 instead of c99 as done by
+https://github.com/tpm2-software/tpm2-tools/commit/5d0267428e96989afce406d096994ec5091ee107]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ configure.ac | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index dc15b5595..25039a0d9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -287,6 +287,9 @@ AC_DEFUN([add_c_flag], [
+ # -D_GNU_SOURCE is required for execvpe() in options.c
+ add_c_flag([-D_GNU_SOURCE], [AC_MSG_ERROR([Cannot enable -D_GNU_SOURCE])])
+
++# Enable gnu99 mode, since we use some of these features.
++add_c_flag([-std=gnu99], [AC_MSG_ERROR([Cannot enable -std=gnu99])])
++
+ # Best attempt compiler options that are on newer versions of GCC that
+ # we can't widely enforce without killing other peoples builds.
+ # Works with gcc only. Needs to be disabled on BSD and clang
diff --git a/package/tpm2-tools/tpm2-tools.mk b/package/tpm2-tools/tpm2-tools.mk
index 981a89a737..41f5bcf201 100644
--- a/package/tpm2-tools/tpm2-tools.mk
+++ b/package/tpm2-tools/tpm2-tools.mk
@@ -11,6 +11,8 @@ TPM2_TOOLS_LICENSE_FILES = doc/LICENSE
TPM2_TOOLS_CPE_ID_VENDOR = tpm2-tools_project
TPM2_TOOLS_SELINUX_MODULES = tpm2
TPM2_TOOLS_DEPENDENCIES = libcurl openssl tpm2-tss host-pkgconf util-linux
+# We're patching configure.ac
+TPM2_TOOLS_AUTORECONF = YES
# -fstack-protector-all and FORTIFY_SOURCE=2 is used by
# default. Disable that so the BR2_SSP_* / BR2_FORTIFY_SOURCE_* options
--
2.30.2
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/tpm2-tools: fix build with gcc 4.8
2021-08-09 21:29 [Buildroot] [PATCH 1/1] package/tpm2-tools: fix build with gcc 4.8 Fabrice Fontaine
@ 2021-08-12 21:49 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2021-08-12 21:49 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: buildroot
On Mon, 9 Aug 2021 23:29:59 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> 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>
> ---
> .../0001-configure-make-build-gnu99.patch | 30 +++++++++++++++++++
> package/tpm2-tools/tpm2-tools.mk | 2 ++
> 2 files changed, 32 insertions(+)
> create mode 100644 package/tpm2-tools/0001-configure-make-build-gnu99.patch
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-12 21:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09 21:29 [Buildroot] [PATCH 1/1] package/tpm2-tools: fix build with gcc 4.8 Fabrice Fontaine
2021-08-12 21:49 ` Thomas Petazzoni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.