From 5a65fcd5f9c67baa681f664e4596760ca1f2606a Mon Sep 17 00:00:00 2001 From: Govindraj Raja Date: Fri, 27 Jan 2023 10:08:54 +0000 Subject: [PATCH] feat(build): allow additional CFLAGS for library build Current CFLAGS if set for library builds could impact entire build, so allow to pass additional CFLAGs for library builds based on format _CFLAGS. This support is currently needed to avoid 'redundant declaration' error from latest mbedtls-3.3, the issue is reported to mbedtls[1] and is under consideration to remove any redundant declarations. But till then we have to disable that compiler option while building for mbedtls-3.3 [1]: https://github.com/Mbed-TLS/mbedtls/issues/6910 Change-Id: Ic99af22b229f8089c82110d6545f762c14a62f5c Signed-off-by: Govindraj Raja --- make_helpers/build_macros.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index a6b1d528b..4815efa74 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -274,10 +274,11 @@ MAKE_DEP = -Wp,-MD,$(DEP) -MT $$@ -MP define MAKE_C_LIB $(eval OBJ := $(1)/$(patsubst %.c,%.o,$(notdir $(2)))) $(eval DEP := $(patsubst %.o,%.d,$(OBJ))) +$(eval LIB := $(call uppercase, $(notdir $(1)))) $(OBJ): $(2) $(filter-out %.d,$(MAKEFILE_LIST)) | lib$(3)_dirs $$(ECHO) " CC $$<" - $$(Q)$$(CC) $$(TF_CFLAGS) $$(CFLAGS) $(MAKE_DEP) -c $$< -o $$@ + $$(Q)$$(CC) $$($(LIB)_CFLAGS) $$(TF_CFLAGS) $$(CFLAGS) $(MAKE_DEP) -c $$< -o $$@ -include $(DEP) -- 2.39.5