From 8b364c74365ebe79490ffa011ee19b2a2e4e1a78 Mon Sep 17 00:00:00 2001 From: Pengyu Lv Date: Mon, 25 Sep 2023 14:31:43 +0800 Subject: [PATCH 1/2] Fix the commands to build library In `scripts/common.make`, used by `tests/Makefile` and `programs/Makefile`, we have the following rules to build the library: ``` $(MBEDLIBS): $(MAKE) -C ../library ``` $(MBEDLIBS) contains three library files but the command is for all the 3 files instead of single target generation. This would cause a race when doing parallel build. This commit fixes command so that the recipe could generate a single library file. Fix https://github.com/Mbed-TLS/mbedtls/issues/8229 Signed-off-by: Pengyu Lv Signed-off-by: Gilles Peskine --- scripts/common.make | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/common.make b/scripts/common.make index b3d028ff62..c0e7b1d966 100644 --- a/scripts/common.make +++ b/scripts/common.make @@ -140,7 +140,7 @@ endif default: all $(MBEDLIBS): - $(MAKE) -C $(MBEDTLS_PATH)/library + $(MAKE) -C $(MBEDTLS_PATH)/library $(@F) neat: clean ifndef WINDOWS From d86c4ae1d282b0fe594719dd4742bd93ba1c6a98 Mon Sep 17 00:00:00 2001 From: Pengyu Lv Date: Mon, 25 Sep 2023 14:55:59 +0800 Subject: [PATCH 2/2] Fix dependencies in programs/Makefile Make fuzz depend on MBEDLIBS to avoid multiple instances for generation the library files. Signed-off-by: Pengyu Lv --- programs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/Makefile b/programs/Makefile index 6c9d4d7342..47745de052 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -101,7 +101,7 @@ SSL_OPT_APPS += test/query_compile_time_config test/udp_proxy ssl-opt: $(patsubst %,%$(EXEXT),$(SSL_OPT_APPS)) .PHONY: ssl-opt -fuzz: ${MBEDTLS_TEST_OBJS} +fuzz: ${MBEDLIBS} ${MBEDTLS_TEST_OBJS} $(MAKE) -C fuzz ${MBEDTLS_TEST_OBJS}: