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 2021/12/29 12:54:40 UTC
[incubator-nuttx-apps] branch master updated: Fix link error due to missing libapps.a in KERNEL build
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 d1bcd29 Fix link error due to missing libapps.a in KERNEL build
d1bcd29 is described below
commit d1bcd2977c34f952c11fb8a012832f0032f5b83d
Author: Ville Juven <vi...@unikie.com>
AuthorDate: Tue Dec 28 13:18:38 2021 +0200
Fix link error due to missing libapps.a in KERNEL build
The import target for kernel build now fails, due to setting libapps.a
as the default value for the BIN variable.
The fail happens when the ELFLD function passes the LDLIBS parameter
(which contains BIN / libapps.a) for the linker. There is no rule to
create libapps.a in the case of the kernel build, so the linker gives
an error due to it being missing.
This commit patches this behavior so that BIN is not appended to
LDLIBS. Another option would be to implement a dummy rule to create
libapps.a, but looking at the git history this is no longer wanted
behavior, thus the error is patched like this.
---
Application.mk | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/Application.mk b/Application.mk
index d592d4d..a0371cb 100644
--- a/Application.mk
+++ b/Application.mk
@@ -59,10 +59,14 @@ else
CWD = $(CURDIR)
endif
-ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
- LDLIBS += "${shell cygpath -w $(BIN)}"
-else
- LDLIBS += $(BIN)
+# Add the static application library to the linked libraries. Don't do this
+# with CONFIG_BUILD_KERNEL as there is no static app library
+ifneq ($(CONFIG_BUILD_KERNEL),y)
+ ifeq ($(CONFIG_CYGWIN_WINTOOL),y)
+ LDLIBS += "${shell cygpath -w $(BIN)}"
+ else
+ LDLIBS += $(BIN)
+ endif
endif
SUFFIX = $(subst $(DELIM),.,$(CWD))