You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/01/27 03:07:25 UTC

[incubator-nuttx-apps] branch master updated: Makefile, import/Make.defs: Fix undefined symbols for CONFIG_BUILD_KERNEL=y

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 7d4b2a5  Makefile, import/Make.defs: Fix undefined symbols for CONFIG_BUILD_KERNEL=y
7d4b2a5 is described below

commit 7d4b2a517b7a070e6c737c8375373c62e6378d08
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Wed Jan 26 09:42:34 2022 +0900

    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 <Ma...@jp.sony.com>
---
 Makefile         | 4 ++++
 import/Make.defs | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/Makefile b/Makefile
index ae87081..a34b098 100644
--- a/Makefile
+++ b/Makefile
@@ -63,6 +63,10 @@ ifeq ($(CONFIG_BUILD_KERNEL),y)
 install: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_install)
 
 .import: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_all)
+	$(Q) for app in ${CONFIGURED_APPS}; do \
+		$(MAKE) -C "$${app}" archive ; \
+	done
+	$(Q) install libapps.a $(APPDIR)$(DELIM)import$(DELIM)libs
 	$(Q) $(MAKE) install
 
 import: $(IMPORT_TOOLS)
diff --git a/import/Make.defs b/import/Make.defs
index 2850d12..0d8d153 100644
--- a/import/Make.defs
+++ b/import/Make.defs
@@ -74,6 +74,12 @@ else
   LDLIBPATH = -L $(TOPDIR)$(DELIM)libs
 endif
 
+# Link with user libraries
+
+ifeq ($(CONFIG_BUILD_KERNEL),y)
+  LDLIBS = -lapps -lxx -lmm -lc -lm -lproxies
+endif
+
 # Try to get the path to libgcc.a.  Of course, this only works for GCC
 # toolchains.