From 0eedd36557b43174519dd88c44b5a98f9ee76e7f Mon Sep 17 00:00:00 2001 From: Tom Cosgrove Date: Wed, 10 Nov 2021 11:15:46 +0000 Subject: [PATCH] Serialise builds of the .a files on Windows This is a workaround for an issue with mkstemp() in older MinGW releases that causes simultaneous creation of .a files in the same directory to fail. Fixes #5146 Signed-off-by: Tom Cosgrove --- library/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/Makefile b/library/Makefile index 01e85cf5b..15c9a8b15 100644 --- a/library/Makefile +++ b/library/Makefile @@ -186,6 +186,14 @@ static: libmbedcrypto.a libmbedx509.a libmbedtls.a shared: libmbedcrypto.$(DLEXT) libmbedx509.$(DLEXT) libmbedtls.$(DLEXT) +# Windows builds under Mingw can fail if make tries to create archives in the same +# directory at the same time - see https://bugs.launchpad.net/gcc-arm-embedded/+bug/1848002. +# This forces builds of the .a files to be serialised. +ifdef WINDOWS +libmbedtls.a: | libmbedx509.a +libmbedx509.a: | libmbedcrypto.a +endif + # tls libmbedtls.a: $(OBJS_TLS) echo " AR $@"