From cecc83d6b92b05033cfeac6d49c7d46d8dda56da Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Sun, 30 Jan 2022 11:15:22 +0900 Subject: [PATCH] import: Make.defs: Fix 'make import' for CONFIG_BUILD_KERNEL=y Summary: - I noticed that 'make import' failed due to recent changes in nuttx - This commit fixes this issue by adding logic for -lm - Also applies the same style for -lgcc Impact: - CONFIG_BUILD_KERNEL=y only Testing: - Build (mkimport, make import) with sama5d4-ek:knsh Signed-off-by: Masayuki Ishikawa --- import/Make.defs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/import/Make.defs b/import/Make.defs index 0d8d153b2..6ecfdc6df 100644 --- a/import/Make.defs +++ b/import/Make.defs @@ -77,14 +77,21 @@ endif # Link with user libraries ifeq ($(CONFIG_BUILD_KERNEL),y) - LDLIBS = -lapps -lxx -lmm -lc -lm -lproxies + LDLIBS = -lapps -lxx -lmm -lc -lproxies +ifneq ($(CONFIG_LIBM),y) + LIBM = ${shell "$(CC)" $(ARCHCPUFLAGS) --print-file-name=libm.a} +ifneq ($(LIBM),".") + LDLIBPATH += -L "${shell dirname $(LIBM)}" + LDLIBS += -lm +endif +endif endif # Try to get the path to libgcc.a. Of course, this only works for GCC # toolchains. -LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-file-name=libgcc.a} -ifneq ($(LIBGCC),) +LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) --print-file-name=libgcc.a} +ifneq ($(LIBGCC),".") LDLIBPATH += -L "${shell dirname $(LIBGCC)}" LDLIBS += -lgcc endif