Makefile/Application: correct COMPILER_RT_LIB PATH

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2022-04-15 13:46:45 +08:00 committed by Xiang Xiao
parent 460f631fa3
commit ab5e7496d5

View File

@ -55,9 +55,12 @@ ifeq ($(BUILD_MODULE),y)
# Revisit: This only works for gcc and clang.
# Do other compilers have similar?
COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)
ifneq ($(COMPILER_RT_LIB),)
LDLIBS += $(COMPILER_RT_LIB)
ifeq ($(wildcard $(COMPILER_RT_LIB)),)
# if "--print-libgcc-file-name" unable to find the correct libgcc PATH
# then go ahead and try "--print-file-name"
COMPILER_RT_LIB := $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-file-name $(notdir $(COMPILER_RT_LIB))))
endif
LDLIBS += $(COMPILER_RT_LIB)
endif
SUFFIX = $(subst $(DELIM),.,$(CWD))