diff mbox series

[6/6] tpm2-tools: allow building without stack smashing protection (SSP)

Message ID 20180322202752.2562-7-casantos@datacom.ind.br
State Accepted
Commit 428dfe71f337a5de4540d57a244442d64b2d8e75
Headers show
Series tpm2-{tss, abrmd, tools} fix compilation errors | expand

Commit Message

Carlos Santos March 22, 2018, 8:27 p.m. UTC
Disable SSP if the toolchain does not support it. This must be done
explicitly because configure enables hardening by default but doesn't
contain a link test, so it doesn't detect when libssp is missing.

Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
 package/tpm2-tools/tpm2-tools.mk | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Peter Korsgaard March 22, 2018, 11:02 p.m. UTC | #1
>>>>> "Carlos" == Carlos Santos <casantos@datacom.ind.br> writes:

 > Disable SSP if the toolchain does not support it. This must be done
 > explicitly because configure enables hardening by default but doesn't
 > contain a link test, so it doesn't detect when libssp is missing.

 > Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
 > ---
 >  package/tpm2-tools/tpm2-tools.mk | 4 ++++
 >  1 file changed, 4 insertions(+)

 > diff --git a/package/tpm2-tools/tpm2-tools.mk b/package/tpm2-tools/tpm2-tools.mk
 > index 0697900d2d..8d2cfa2cb2 100644
 > --- a/package/tpm2-tools/tpm2-tools.mk
 > +++ b/package/tpm2-tools/tpm2-tools.mk
 > @@ -10,4 +10,8 @@ TPM2_TOOLS_LICENSE = BSD-2-Clause
 >  TPM2_TOOLS_LICENSE_FILES = LICENSE
 >  TPM2_TOOLS_DEPENDENCIES = dbus libcurl libglib2 openssl tpm2-tss host-pkgconf
 
 > +# configure.ac doesn't contain a link test, so it doesn't detect when 

A trailing space here. Committed with that fixed, thanks.
diff mbox series

Patch

diff --git a/package/tpm2-tools/tpm2-tools.mk b/package/tpm2-tools/tpm2-tools.mk
index 0697900d2d..8d2cfa2cb2 100644
--- a/package/tpm2-tools/tpm2-tools.mk
+++ b/package/tpm2-tools/tpm2-tools.mk
@@ -10,4 +10,8 @@  TPM2_TOOLS_LICENSE = BSD-2-Clause
 TPM2_TOOLS_LICENSE_FILES = LICENSE
 TPM2_TOOLS_DEPENDENCIES = dbus libcurl libglib2 openssl tpm2-tss host-pkgconf
 
+# configure.ac doesn't contain a link test, so it doesn't detect when 
+# libssp is missing.
+TPM2_TOOLS_CONF_OPTS = $(if $(BR2_TOOLCHAIN_HAS_SSP),--enable-hardening,--disable-hardening)
+
 $(eval $(autotools-package))