From a562acb160e0454ae15d7ceeae0cbb4c69d267fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Mon, 27 Jan 2014 18:01:37 +0100 Subject: [PATCH] cc2538: Fix library linkage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a project needs to use some libraries at link stage, then the corresponding linker options (e.g. '-lm') have to be passed after any .o file depending on these libraries. Hence, LDFLAGS cannot be used to add such options when invoking $(LD) in Makefile.cc2538, or it should be moved to the correct location. Instead, this change adds TARGET_LIBFILES to the correct location, like most other Contiki targets. Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/Makefile.cc2538 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/cc2538/Makefile.cc2538 b/cpu/cc2538/Makefile.cc2538 index 103e177fc..c92d67d22 100644 --- a/cpu/cc2538/Makefile.cc2538 +++ b/cpu/cc2538/Makefile.cc2538 @@ -71,7 +71,7 @@ CUSTOM_RULE_LINK=1 %.elf: $(TARGET_STARTFILES) %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a $(LDSCRIPT) $(TRACE_LD) - $(Q)$(LD) $(LDFLAGS) ${filter-out $(LDSCRIPT) %.a,$^} ${filter %.a,$^} -o $@ + $(Q)$(LD) $(LDFLAGS) ${filter-out $(LDSCRIPT) %.a,$^} ${filter %.a,$^} $(TARGET_LIBFILES) -o $@ %.hex: %.elf $(OBJCOPY) -O ihex $< $@