From ab5e7496d5c436afafc279adc80ed3e5cfc694ac Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Fri, 15 Apr 2022 13:46:45 +0800 Subject: [PATCH] Makefile/Application: correct COMPILER_RT_LIB PATH Signed-off-by: chao.an --- Application.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Application.mk b/Application.mk index 2fa8ceb4e..51ce6eff2 100644 --- a/Application.mk +++ b/Application.mk @@ -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))