Skip to content

Commit 7d4b2a5

Browse files
masayuki2009xiaoxiang781216
authored andcommitted
Makefile, import/Make.defs: Fix undefined symbols for CONFIG_BUILD_KERNEL=y
Summary: - I noticed that applications made by 'make import' contain undefined symbols such as printf for CONFIG_BUILD_KERNEL=y - This commit fixes this issue by adding user libraries. - Also, this commit generates libapps.a which is used for init Impact: - CONFIG_BUILD_KERNEL=y only Testing: - Build (mkimport, make import) with sama5d4-ek:knsh Signed-off-by: Masayuki Ishikawa <[email protected]>
1 parent 3c55638 commit 7d4b2a5

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ ifeq ($(CONFIG_BUILD_KERNEL),y)
6363
install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install)
6464

6565
.import: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
66+
$(Q) for app in ${CONFIGURED_APPS}; do \
67+
$(MAKE) -C "$${app}" archive ; \
68+
done
69+
$(Q) install libapps.a $(APPDIR)$(DELIM)import$(DELIM)libs
6670
$(Q) $(MAKE) install
6771

6872
import: $(IMPORT_TOOLS)

import/Make.defs

+6
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ else
7474
LDLIBPATH = -L $(TOPDIR)$(DELIM)libs
7575
endif
7676

77+
# Link with user libraries
78+
79+
ifeq ($(CONFIG_BUILD_KERNEL),y)
80+
LDLIBS = -lapps -lxx -lmm -lc -lm -lproxies
81+
endif
82+
7783
# Try to get the path to libgcc.a. Of course, this only works for GCC
7884
# toolchains.
7985

0 commit comments

Comments
 (0)