From d2ec034adaade375df595b56414e1314bf65e637 Mon Sep 17 00:00:00 2001 From: pangzhen1 Date: Mon, 22 Jul 2024 15:49:03 +0800 Subject: [PATCH] support inputting multiple ldscript files when linking the nuttx.bin To support greenhill compilation, LDFLAGS removes the code that adds -T through addprefix to ARCHSCRIPT(greenhill requires a space between -T and ldscript files, but addprefix didn't do it). However,if we modified like this, when ARCHSCRIPT has more than one ldscript, the -T is only added to the first ldscript, but not to the following ldscripts, which results in a warning when linking. To solve this problem, we can just add a space after $(SCRIPT_OPT) when using addprefix, instead of deleting addprefix. Signed-off-by: pangzhen1 --- arch/arm/src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/src/Makefile b/arch/arm/src/Makefile index 2c7630f07c6..ccee889260f 100644 --- a/arch/arm/src/Makefile +++ b/arch/arm/src/Makefile @@ -133,7 +133,7 @@ else endif ARCHSCRIPT := $(call CONVERT_PATH,$(ARCHSCRIPT)) -LDFLAGS += $(SCRIPT_OPT) $(addsuffix .tmp,$(ARCHSCRIPT)) $(EXTRALINKCMDS) +LDFLAGS += $(addprefix $(SCRIPT_OPT) ,$(addsuffix .tmp,$(ARCHSCRIPT))) $(EXTRALINKCMDS) LIBPATHS += $(LIBPATH_OPT) $(call CONVERT_PATH,$(TOPDIR)$(DELIM)staging) BOARDMAKE = $(if $(wildcard board$(DELIM)Makefile),y,)