arch/EXTRA_LIBS: link all staging library.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
cuiziwei 2024-05-10 21:17:34 +08:00 committed by Xiang Xiao
parent 648c52fc4b
commit 7b43a9413a
2 changed files with 28 additions and 0 deletions

View file

@ -53,6 +53,20 @@ OBJS = $(AOBJS) $(COBJS)
# Override in Make.defs if linker is not 'ld'
$(foreach lib,$(notdir $(wildcard $(APPDIR)$(DELIM)staging$(DELIM)*$(LIBEXT))), \
$(foreach elib,$(EXTRA_LIBS), \
$(if $(filter $(notdir $(elib)),$(lib)), \
$(eval NAMEFULL_LIBS+=$(elib)), \
$(if $(filter $(notdir $(elib)),$(patsubst lib%$(LIBEXT),-l%,$(lib))), \
$(eval NAMESPEC_LIBS+=$(elib)) \
) \
) \
) \
)
EXTRA_LIBS := $(filter-out $(NAMEFULL_LIBS) $(NAMESPEC_LIBS),$(EXTRA_LIBS))
EXTRA_LIBS += $(wildcard $(APPDIR)$(DELIM)staging$(DELIM)*$(LIBEXT))
LDSTARTGROUP ?= --start-group
LDENDGROUP ?= --end-group
LDFLAGS += $(addprefix -T,$(call CONVERT_PATH,$(ARCHSCRIPT))) -static

View file

@ -53,6 +53,20 @@ BIN = libarch$(LIBEXT)
# Override in Make.defs if linker is not 'ld'
$(foreach lib,$(notdir $(wildcard $(APPDIR)$(DELIM)staging$(DELIM)*$(LIBEXT))), \
$(foreach elib,$(EXTRA_LIBS), \
$(if $(filter $(notdir $(elib)),$(lib)), \
$(eval NAMEFULL_LIBS+=$(elib)), \
$(if $(filter $(notdir $(elib)),$(patsubst lib%$(LIBEXT),-l%,$(lib))), \
$(eval NAMESPEC_LIBS+=$(elib)) \
) \
) \
) \
)
EXTRA_LIBS := $(filter-out $(NAMEFULL_LIBS) $(NAMESPEC_LIBS),$(EXTRA_LIBS))
EXTRA_LIBS += $(wildcard $(APPDIR)$(DELIM)staging$(DELIM)*$(LIBEXT))
LDSTARTGROUP ?= --start-group
LDENDGROUP ?= --end-group