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/09/19 03:02:33 UTC

[incubator-nuttx] branch master updated: arch/arm/makefile: linking libraries with GCC should use option -l

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.git


The following commit(s) were added to refs/heads/master by this push:
     new 3a5ae5681d arch/arm/makefile: linking libraries with GCC should use option -l
3a5ae5681d is described below

commit 3a5ae5681d9d998ba63c726f13aaf111c72867cc
Author: chao an <an...@xiaomi.com>
AuthorDate: Sun Sep 18 23:30:14 2022 +0800

    arch/arm/makefile: linking libraries with GCC should use option -l
    
    Signed-off-by: chao an <an...@xiaomi.com>
---
 arch/arm/src/Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/src/Makefile b/arch/arm/src/Makefile
index a3e401c85a..4b2f4c0421 100644
--- a/arch/arm/src/Makefile
+++ b/arch/arm/src/Makefile
@@ -99,13 +99,16 @@ ifeq ($(CONFIG_ARM_TOOLCHAIN_ARMCLANG),)
   endif
 
   LIBPATH_OPT = -L
+  LIBRARY_OPT = -l
   SCRIPT_OPT  = -T
 else
   LIBPATH_OPT = --userlibpath
-  EXTRA_LIBS += arm_vectors.o
+  LIBRARY_OPT = --library=
   SCRIPT_OPT  = --scatter=
+  EXTRA_LIBS += arm_vectors.o
 endif
 
+
 LDFLAGS += $(addprefix $(SCRIPT_OPT),$(call CONVERT_PATH,$(ARCHSCRIPT))) $(EXTRALINKCMDS)
 LIBPATHS += $(LIBPATH_OPT) $(call CONVERT_PATH,$(TOPDIR)$(DELIM)staging)
 
@@ -114,9 +117,9 @@ ifeq ($(BOARDMAKE),y)
   LIBPATHS += $(LIBPATH_OPT) $(call CONVERT_PATH,$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board)
 endif
 
-LDLIBS = $(patsubst %.a,%,$(patsubst lib%,--library=%,$(LINKLIBS)))
+LDLIBS = $(patsubst %.a,%,$(patsubst lib%,$(LIBRARY_OPT)%,$(LINKLIBS)))
 ifeq ($(BOARDMAKE),y)
-  LDLIBS += --library=board
+  LDLIBS += $(LIBRARY_OPT)board
 endif
 
 VPATH += chip