arch/arm/makefile: linking libraries with GCC should use option -l

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2022-09-18 23:30:14 +08:00 committed by Xiang Xiao
parent 64c0ec592b
commit 3a5ae5681d

View File

@ -99,13 +99,16 @@ ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),)
endif endif
LIBPATH_OPT = -L LIBPATH_OPT = -L
LIBRARY_OPT = -l
SCRIPT_OPT = -T SCRIPT_OPT = -T
else else
LIBPATH_OPT = --userlibpath LIBPATH_OPT = --userlibpath
EXTRA_LIBS += arm_vectors.o LIBRARY_OPT = --library=
SCRIPT_OPT = --scatter= SCRIPT_OPT = --scatter=
EXTRA_LIBS += arm_vectors.o
endif endif
LDFLAGS += $(addprefix $(SCRIPT_OPT),$(call CONVERT_PATH,$(ARCHSCRIPT))) $(EXTRALINKCMDS) LDFLAGS += $(addprefix $(SCRIPT_OPT),$(call CONVERT_PATH,$(ARCHSCRIPT))) $(EXTRALINKCMDS)
LIBPATHS += $(LIBPATH_OPT) $(call CONVERT_PATH,$(TOPDIR)$(DELIM)staging) LIBPATHS += $(LIBPATH_OPT) $(call CONVERT_PATH,$(TOPDIR)$(DELIM)staging)
@ -114,9 +117,9 @@ ifeq ($(BOARDMAKE),y)
LIBPATHS += $(LIBPATH_OPT) $(call CONVERT_PATH,$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board) LIBPATHS += $(LIBPATH_OPT) $(call CONVERT_PATH,$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board)
endif endif
LDLIBS = $(patsubst %.a,%,$(patsubst lib%,--library=%,$(LINKLIBS))) LDLIBS = $(patsubst %.a,%,$(patsubst lib%,$(LIBRARY_OPT)%,$(LINKLIBS)))
ifeq ($(BOARDMAKE),y) ifeq ($(BOARDMAKE),y)
LDLIBS += --library=board LDLIBS += $(LIBRARY_OPT)board
endif endif
VPATH += chip VPATH += chip