diff mbox series

secvar/test: use mbedtls cflags when building the test binaries

Message ID 20201002015419.32135-1-erichte@linux.ibm.com
State Accepted
Headers show
Series secvar/test: use mbedtls cflags when building the test binaries | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch
snowpatch_ozlabs/apply_patch warning Failed to apply on branch master (f76a1d963ca26ec9925a1aaf126c8cf70de67224)

Commit Message

Eric Richter Oct. 2, 2020, 1:54 a.m. UTC
The edk2 test file includes some mbedtls files directly, make sure that
those also include the correct mbedtls config file.

Without this, the default config file is used, which conflicts with the
version we build as part of skiboot.

As host libc includes a SIZE_MAX macro, this also changes the SIZE_MAX
macro defined in mbedtls_config.h (needed for some mbedtls functions) to
only be defined if it isn't already.

Signed-off-by: Eric Richter <erichte@linux.ibm.com>
---
 libstb/crypto/mbedtls-config.h    | 2 ++
 libstb/secvar/test/Makefile.check | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libstb/crypto/mbedtls-config.h b/libstb/crypto/mbedtls-config.h
index 9560993b..e0c358d2 100644
--- a/libstb/crypto/mbedtls-config.h
+++ b/libstb/crypto/mbedtls-config.h
@@ -86,7 +86,9 @@ 
 /* Settings to reduce/remove warnings */
 #define MBEDTLS_MPI_WINDOW_SIZE	3	// (max/default is 6) Increase for speed, may introduce warnings
 #define MBEDTLS_MPI_MAX_SIZE	512	// (default is 1024) increase for more bits in user-MPIs
+#ifndef SIZE_MAX
 #define SIZE_MAX		65535	// this might need to be in libc?
+#endif
 
 /* Disableable to mitigate warnings */
 //#define MBEDTLS_ASN1_WRITE_C  // Expects SIZE_MAX
diff --git a/libstb/secvar/test/Makefile.check b/libstb/secvar/test/Makefile.check
index b2cafcf6..94da7dd9 100644
--- a/libstb/secvar/test/Makefile.check
+++ b/libstb/secvar/test/Makefile.check
@@ -42,10 +42,10 @@  HOST_MBEDTLS_CFLAGS+= -Wno-unused-function -Wno-suggest-attribute=const
 $(SECVAR_TEST) : core/test/stubs.o
 
 $(SECVAR_TEST) : % : %.c $(HOST_MBEDTLS_OBJS)
-	$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) -O0 -g -I include -I . -I libfdt -o $@ $< $(HOST_MBEDTLS_OBJS) core/test/stubs.o, $<)
+	$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) $(HOST_MBEDTLS_CFLAGS) -O0 -g -I include -I . -I libfdt -o $@ $< $(HOST_MBEDTLS_OBJS) core/test/stubs.o, $<)
 
 $(SECVAR_TEST:%=%-gcov): %-gcov : %.c % $(HOST_MBEDTLS_OBJS)
-	$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) $(HOSTGCOVCFLAGS) -I include -I . -I libfdt -lgcov -o $@ $< $(HOST_MBEDTLS_OBJS) core/test/stubs.o, $<)
+	$(call Q, HOSTCC ,$(HOSTCC) $(HOSTCFLAGS) $(HOSTGCOVCFLAGS) $(HOST_MBEDTLS_CFLAGS) -I include -I . -I libfdt -lgcov -o $@ $< $(HOST_MBEDTLS_OBJS) core/test/stubs.o, $<)
 
 -include $(wildcard libstb/secvar/test/*.d)