Link without using an archive file

For reasons discussed long ago and that have to do with how ld handles weak symbols, it was decided that it was preferable to link using an explicit list of object files, instead of adding object files to an archive first and then linking using this archive. This was applied for the CC2538, but not for CC13xx/CC26xx.

This pull applies this link logic to all CM3s. For this to work with the Contiki-NG build system, we need `.SECONDEXPANSION:`, so this pull moves that to the common CM3 Makefile.
This commit is contained in:
George Oikonomou 2017-12-17 21:31:39 +00:00
parent fa1842ccb5
commit b5fa28e2d4
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,9 @@ CPU_STARTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CPU_START_SOURCEFILES
### Compilation rules
CUSTOM_RULE_LINK = 1
%.elf: $(CPU_STARTFILES) %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a $(LDSCRIPT)
.SECONDEXPANSION:
%.elf: $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(LDSCRIPT)
$(TRACE_LD)
$(Q)$(LD) $(LDFLAGS) ${filter-out $(LDSCRIPT) %.a,$^} ${filter %.a,$^} $(TARGET_LIBFILES) -lm -o $@

View File

@ -36,8 +36,6 @@ CPU_START_SOURCEFILES = startup-gcc.c
CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) $(DEBUG_IO_SOURCEFILES)
CONTIKI_SOURCEFILES += $(USB_SOURCEFILES)
.SECONDEXPANSION:
### Always re-build ieee-addr.o in case the command line passes a new NODEID
FORCE: