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 <pangzhen1@xiaomi.com>
This commit is contained in:
pangzhen1 2024-07-22 15:49:03 +08:00 committed by Xiang Xiao
parent 67f0b5131b
commit d2ec034ada

View File

@ -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,)