From f398d385db3b94a92d8142592255d2d46170315c Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 7 Mar 2017 12:26:56 +0100 Subject: [PATCH 01/12] make: consider whole archives when linking --- Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.include b/Makefile.include index 74e9f4db5884..3ef90b5a6b91 100644 --- a/Makefile.include +++ b/Makefile.include @@ -313,7 +313,7 @@ LINKFLAGPREFIX ?= -Wl, DIRS += $(EXTERNAL_MODULE_DIRS) -_LINK = $(if $(CPPMIX),$(LINKXX),$(LINK)) $(UNDEF) $(LINKFLAGPREFIX)--start-group $(BASELIBS) -lm $(LINKFLAGPREFIX)--end-group $(LINKFLAGPREFIX)-Map=$(BINDIR)/$(APPLICATION).map $(LINKFLAGS) +_LINK = $(if $(CPPMIX),$(LINKXX),$(LINK)) $(UNDEF) $(LINKFLAGPREFIX)--whole-archive $(LINKFLAGPREFIX)--start-group $(BASELIBS) -lm $(LINKFLAGPREFIX)--end-group $(LINKFLAGPREFIX)--no-whole-archive $(LINKFLAGPREFIX)-Map=$(BINDIR)/$(APPLICATION).map $(LINKFLAGS) ifeq ($(BUILD_IN_DOCKER),1) link: ..in-docker-container From 8fc262fdb7c3a2242ab8a77bbb412a4e3829c413 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Wed, 17 Aug 2016 09:47:36 +0200 Subject: [PATCH 02/12] make: remove use of UNDEF --- boards/common/msba2/Makefile.include | 2 -- boards/native/Makefile.include | 2 -- cpu/atmega1281/Makefile.include | 4 ---- cpu/atmega2560/Makefile.include | 4 ---- cpu/kinetis/Makefile.include | 3 --- cpu/msp430_common/Makefile.include | 1 - makefiles/arch/cortexm.inc.mk | 7 ------- sys/Makefile.include | 11 ++++------- sys/newlib_syscalls_default/Makefile.include | 1 - 9 files changed, 4 insertions(+), 31 deletions(-) delete mode 100644 sys/newlib_syscalls_default/Makefile.include diff --git a/boards/common/msba2/Makefile.include b/boards/common/msba2/Makefile.include index 6618753cb59a..467e4489b97d 100644 --- a/boards/common/msba2/Makefile.include +++ b/boards/common/msba2/Makefile.include @@ -31,6 +31,4 @@ INCLUDES += -I$(RIOTBOARD)/common/msba2/drivers/include export OFLAGS = -O ihex -export UNDEF += $(BINDIR)/cpu/startup.o - USEMODULE += boards_common_msba2-drivers diff --git a/boards/native/Makefile.include b/boards/native/Makefile.include index 92151fd84f63..f83ec992135c 100644 --- a/boards/native/Makefile.include +++ b/boards/native/Makefile.include @@ -185,5 +185,3 @@ eval-gprof: eval-cachegrind: $(CGANNOTATE) $(shell ls -rt cachegrind.out* | tail -1) - -export UNDEF += $(BINDIR)/cpu/startup.o diff --git a/cpu/atmega1281/Makefile.include b/cpu/atmega1281/Makefile.include index 6647a8d43794..b46d4e871c8f 100644 --- a/cpu/atmega1281/Makefile.include +++ b/cpu/atmega1281/Makefile.include @@ -4,9 +4,5 @@ USEMODULE += atmega_common # define path to atmega common module, which is needed for this CPU export ATMEGA_COMMON = $(RIOTCPU)/atmega_common/ -# explicitly tell the linker to link the syscalls and startup code. -# Without this the interrupt vectors will not be linked correctly! -export UNDEF += $(BINDIR)/cpu/startup.o - # CPU depends on the atmega common module, so include it include $(ATMEGA_COMMON)Makefile.include diff --git a/cpu/atmega2560/Makefile.include b/cpu/atmega2560/Makefile.include index 6647a8d43794..b46d4e871c8f 100644 --- a/cpu/atmega2560/Makefile.include +++ b/cpu/atmega2560/Makefile.include @@ -4,9 +4,5 @@ USEMODULE += atmega_common # define path to atmega common module, which is needed for this CPU export ATMEGA_COMMON = $(RIOTCPU)/atmega_common/ -# explicitly tell the linker to link the syscalls and startup code. -# Without this the interrupt vectors will not be linked correctly! -export UNDEF += $(BINDIR)/cpu/startup.o - # CPU depends on the atmega common module, so include it include $(ATMEGA_COMMON)Makefile.include diff --git a/cpu/kinetis/Makefile.include b/cpu/kinetis/Makefile.include index 046337a006e3..e68e78d3bd77 100644 --- a/cpu/kinetis/Makefile.include +++ b/cpu/kinetis/Makefile.include @@ -30,9 +30,6 @@ LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ram_start_addr=$(RAM_START_ADDR) LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_rom_length=$(ROM_LEN) LINKFLAGS += $(LINKFLAGPREFIX)--defsym=_ram_length=$(RAM_LEN) -# add the CPU specific flash configuration field for the linker -export UNDEF += $(BINDIR)/cpu/fcfield.o - # include common periph drivers USEMODULE += periph_common diff --git a/cpu/msp430_common/Makefile.include b/cpu/msp430_common/Makefile.include index ab6e0cf8c0d3..472b3b41e4b5 100644 --- a/cpu/msp430_common/Makefile.include +++ b/cpu/msp430_common/Makefile.include @@ -4,7 +4,6 @@ INCLUDES += -I$(RIOTCPU)/msp430_common/include/ MODEL = $(shell echo $(CPU_MODEL) | tr 'a-z' 'A-Z') export CFLAGS += -DCPU_MODEL_$(MODEL) -export UNDEF += $(BINDIR)/msp430_common/startup.o export USEMODULE += msp430_common msp430_common_periph periph_common DEFAULT_MODULE += oneway_malloc diff --git a/makefiles/arch/cortexm.inc.mk b/makefiles/arch/cortexm.inc.mk index 8c7377c738eb..1aad86802633 100644 --- a/makefiles/arch/cortexm.inc.mk +++ b/makefiles/arch/cortexm.inc.mk @@ -83,13 +83,6 @@ export CFLAGS += -DARM_MATH_CM7 endif endif -# Explicitly tell the linker to link the startup code. -# Without this the interrupt vectors will not be linked correctly! -VECTORS_O ?= $(BINDIR)/cpu/vectors.o -ifeq ($(COMMON_STARTUP),) -export UNDEF += $(VECTORS_O) -endif - # CPU depends on the cortex-m common module, so include it: include $(RIOTCPU)/cortexm_common/Makefile.include diff --git a/sys/Makefile.include b/sys/Makefile.include index 24b8c7259b11..8fdb56745a8c 100644 --- a/sys/Makefile.include +++ b/sys/Makefile.include @@ -38,9 +38,10 @@ endif ifneq (,$(filter cpp11-compat,$(USEMODULE))) USEMODULE_INCLUDES += $(RIOTBASE)/sys/cpp11-compat/include - # make sure cppsupport.o is linked explicitly because __dso_handle is not - # found if it is hidden away inside a static object. - export UNDEF += $(BINDIR)/cpp11-compat/cppsupport.o +endif + +ifneq (,$(filter gnrc_slip,$(USEMODULE))) + FEATURES_REQUIRED += periph_uart endif ifneq (,$(filter embunit,$(USEMODULE))) @@ -65,10 +66,6 @@ ifneq (,$(filter newlib,$(USEMODULE))) include $(RIOTMAKE)/libc/newlib.mk endif -ifneq (,$(filter newlib_syscalls_default,$(USEMODULE))) - include $(RIOTBASE)/sys/newlib_syscalls_default/Makefile.include -endif - ifneq (,$(filter arduino,$(USEMODULE))) include $(RIOTBASE)/sys/arduino/Makefile.include endif diff --git a/sys/newlib_syscalls_default/Makefile.include b/sys/newlib_syscalls_default/Makefile.include deleted file mode 100644 index 419a6feddc87..000000000000 --- a/sys/newlib_syscalls_default/Makefile.include +++ /dev/null @@ -1 +0,0 @@ -UNDEF += $(BINDIR)/newlib_syscalls_default/syscalls.o From f3784992c3fb489f7f0acf54dd577ec764200a67 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 6 Nov 2017 23:24:11 +0100 Subject: [PATCH 03/12] make: bindist: don't add $(APPLICATION) twice if it's in BIN_USEMODULE --- makefiles/bindist.inc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makefiles/bindist.inc.mk b/makefiles/bindist.inc.mk index 783edc9ca7c5..b4ca2da8c887 100644 --- a/makefiles/bindist.inc.mk +++ b/makefiles/bindist.inc.mk @@ -1,4 +1,4 @@ -USEMODULE += $(BIN_USEMODULE) +USEMODULE += $(filter-out $(APPLICATION),$(BIN_USEMODULE)) DIST_FILES += $(BIN_USEMODULE:%=bin/$(BOARD)/%.a) From a5d9ca63b29575a977450b64a806f90748a2a26f Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 14 Nov 2017 13:29:01 +0100 Subject: [PATCH 04/12] cpu: efm32_common: add PERIPH_TIMER_PROVIDES_SET define to periph_cpu.h --- cpu/efm32/include/periph_cpu.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpu/efm32/include/periph_cpu.h b/cpu/efm32/include/periph_cpu.h index e0c5fbfb9713..bf84f5e3cbd4 100644 --- a/cpu/efm32/include/periph_cpu.h +++ b/cpu/efm32/include/periph_cpu.h @@ -357,6 +357,8 @@ typedef struct { timer_dev_t timer; /**< the higher numbered timer */ IRQn_Type irq; /**< number of the higher timer IRQ channel */ } timer_conf_t; + +#define PERIPH_TIMER_PROVIDES_SET /** @} */ /** From 38109ac837d6a918051621646b6b126f075e9bb6 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 14 Nov 2017 13:45:26 +0100 Subject: [PATCH 05/12] cpu: x86: add libm.o and libc.o to EXTRA_LIBS --- Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.include b/Makefile.include index 3ef90b5a6b91..d3b6e3e89422 100644 --- a/Makefile.include +++ b/Makefile.include @@ -313,7 +313,7 @@ LINKFLAGPREFIX ?= -Wl, DIRS += $(EXTERNAL_MODULE_DIRS) -_LINK = $(if $(CPPMIX),$(LINKXX),$(LINK)) $(UNDEF) $(LINKFLAGPREFIX)--whole-archive $(LINKFLAGPREFIX)--start-group $(BASELIBS) -lm $(LINKFLAGPREFIX)--end-group $(LINKFLAGPREFIX)--no-whole-archive $(LINKFLAGPREFIX)-Map=$(BINDIR)/$(APPLICATION).map $(LINKFLAGS) +_LINK = $(if $(CPPMIX),$(LINKXX),$(LINK)) $(UNDEF) $(LINKFLAGPREFIX)--whole-archive $(LINKFLAGPREFIX)--start-group $(BASELIBS) -lm $(LINKFLAGPREFIX)--end-group $(LINKFLAGPREFIX)--no-whole-archive $(LINKFLAGPREFIX)-Map=$(BINDIR)/$(APPLICATION).map $(EXTRA_LIBS) $(LINKFLAGS) ifeq ($(BUILD_IN_DOCKER),1) link: ..in-docker-container From 0538e2f84f7304b334b65936b2d2d4cb0287efa2 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 14 Nov 2017 14:00:21 +0100 Subject: [PATCH 06/12] make: filter $(EXTRA_LIBS) out of $(BASELIBS) --- Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.include b/Makefile.include index d3b6e3e89422..b81b1922c377 100644 --- a/Makefile.include +++ b/Makefile.include @@ -313,7 +313,7 @@ LINKFLAGPREFIX ?= -Wl, DIRS += $(EXTERNAL_MODULE_DIRS) -_LINK = $(if $(CPPMIX),$(LINKXX),$(LINK)) $(UNDEF) $(LINKFLAGPREFIX)--whole-archive $(LINKFLAGPREFIX)--start-group $(BASELIBS) -lm $(LINKFLAGPREFIX)--end-group $(LINKFLAGPREFIX)--no-whole-archive $(LINKFLAGPREFIX)-Map=$(BINDIR)/$(APPLICATION).map $(EXTRA_LIBS) $(LINKFLAGS) +_LINK = $(if $(CPPMIX),$(LINKXX),$(LINK)) $(UNDEF) $(LINKFLAGPREFIX)--whole-archive $(LINKFLAGPREFIX)--start-group $(filter-out $(EXTRA_LIBS),$(BASELIBS)) -lm $(LINKFLAGPREFIX)--end-group $(LINKFLAGPREFIX)--no-whole-archive $(LINKFLAGPREFIX)-Map=$(BINDIR)/$(APPLICATION).map $(EXTRA_LIBS) $(LINKFLAGS) ifeq ($(BUILD_IN_DOCKER),1) link: ..in-docker-container From 486c3639b9e6f16aa4d3e0880a0ad9b990ccb678 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 14 Nov 2017 14:00:51 +0100 Subject: [PATCH 07/12] cpu: mips32r2_common: add PERIPH_TIMER_PROVIDES_SET define to periph_cpu.h --- cpu/mips32r2_generic/include/periph_cpu.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpu/mips32r2_generic/include/periph_cpu.h b/cpu/mips32r2_generic/include/periph_cpu.h index d952154e7584..2d7b0451b1a8 100644 --- a/cpu/mips32r2_generic/include/periph_cpu.h +++ b/cpu/mips32r2_generic/include/periph_cpu.h @@ -24,6 +24,13 @@ extern "C" { #define PROVIDES_PM_SET_LOWEST /** @} */ +/** + * @name timer configuration + * @{ + */ +#define PERIPH_TIMER_PROVIDES_SET +/** @} */ + #ifdef __cplusplus } #endif From bccaa5be64a8362c0965e9e1f7ee753ba35dd044 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 14 Nov 2017 14:02:40 +0100 Subject: [PATCH 08/12] add newlib_syscalls_mips_uhi.a to EXTRA_LIBS --- cpu/mips32r2_common/Makefile.include | 1 + 1 file changed, 1 insertion(+) diff --git a/cpu/mips32r2_common/Makefile.include b/cpu/mips32r2_common/Makefile.include index 8924ee503721..9b4e3d40bad6 100644 --- a/cpu/mips32r2_common/Makefile.include +++ b/cpu/mips32r2_common/Makefile.include @@ -12,6 +12,7 @@ ifeq ($(USE_UHI_SYSCALLS),1) #Use UHI to handle syscalls export LINKFLAGS += -luhi export USEMODULE += newlib_syscalls_mips_uhi + EXTRA_LIBS += $(BINDIR)/newlib_syscalls_mips_uhi.a else #Use RIOT to handle syscalls (default) export USEMODULE += newlib_syscalls_default From c0c2eb4068703a0360423a4366c09983d0837caf Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 14 Nov 2017 14:32:17 +0100 Subject: [PATCH 09/12] pkg: oonf_api: add archive to EXTRA_LIBS --- pkg/oonf_api/Makefile.include | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/oonf_api/Makefile.include b/pkg/oonf_api/Makefile.include index ec6be727f0ef..7631087d58f3 100644 --- a/pkg/oonf_api/Makefile.include +++ b/pkg/oonf_api/Makefile.include @@ -3,3 +3,5 @@ INCLUDES += -I$(PKGDIRBASE)/oonf_api/src-api ifeq ($(TOOLCHAIN), llvm) CFLAGS += -Wno-keyword-macro -Wno-parentheses-equality endif + +EXTRA_LIBS += $(BINDIR)/oonf_api.a From d393d8c0f791deba1d3bf50f7d15a1f35a642e1c Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 14 Nov 2017 14:53:59 +0100 Subject: [PATCH 10/12] pkg: openthread: add pkg archives to EXTRA_LIBS --- pkg/openthread/Makefile.include | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/openthread/Makefile.include b/pkg/openthread/Makefile.include index b4eebf43654d..b57c0f777186 100644 --- a/pkg/openthread/Makefile.include +++ b/pkg/openthread/Makefile.include @@ -9,3 +9,7 @@ ifneq (,$(filter openthread_contrib,$(USEMODULE))) DIRS += $(OPENTHREAD_DIR)/contrib DIRS += $(OPENTHREAD_DIR)/contrib/netdev endif + +EXTRA_LIBS += ${BINDIR}/libmbedcrypto.a +EXTRA_LIBS += ${BINDIR}/libopenthread.a +EXTRA_LIBS += ${BINDIR}/libopenthread-cli.a From d1226a03ad71b28fd48a033f6c7670f9020cd182 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 22 Feb 2018 23:06:26 +0100 Subject: [PATCH 11/12] pkg/ccn-lite: remove duplicate riot specific ccnl_buf_new() --- ...ot-remove-riot-specific-ccnl_buf_new.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 pkg/ccn-lite/patches/0001-ccnl-riot-remove-riot-specific-ccnl_buf_new.patch diff --git a/pkg/ccn-lite/patches/0001-ccnl-riot-remove-riot-specific-ccnl_buf_new.patch b/pkg/ccn-lite/patches/0001-ccnl-riot-remove-riot-specific-ccnl_buf_new.patch new file mode 100644 index 000000000000..55adc3825651 --- /dev/null +++ b/pkg/ccn-lite/patches/0001-ccnl-riot-remove-riot-specific-ccnl_buf_new.patch @@ -0,0 +1,38 @@ +From 8f2cb10afd5636aeaea7e89c7acd221cecfb4ce8 Mon Sep 17 00:00:00 2001 +From: Kaspar Schleiser +Date: Thu, 22 Feb 2018 23:04:08 +0100 +Subject: [PATCH] ccnl-riot: remove riot specific ccnl_buf_new() + +--- + src/ccnl-riot/src/ccn-lite-riot.c | 15 --------------- + 1 file changed, 15 deletions(-) + +diff --git a/src/ccnl-riot/src/ccn-lite-riot.c b/src/ccnl-riot/src/ccn-lite-riot.c +index 6f978d15f1..65d749ec97 100644 +--- a/src/ccnl-riot/src/ccn-lite-riot.c ++++ b/src/ccnl-riot/src/ccn-lite-riot.c +@@ -183,21 +183,6 @@ extern int ccnl_isContent(unsigned char *buf, int len, int suite); + * @} + */ + +-// ---------------------------------------------------------------------- +-struct ccnl_buf_s* +-ccnl_buf_new(void *data, int len) +-{ +- struct ccnl_buf_s *b = ccnl_malloc(sizeof(struct ccnl_buf_s) + len); +- +- if (!b) +- return NULL; +- b->next = NULL; +- b->datalen = len; +- if (data) +- memcpy(b->data, data, len); +- return b; +-} +- + /* add a netif to CCN-lite's interfaces, set the nettype, and register a receiver */ + int + ccnl_open_netif(kernel_pid_t if_pid, gnrc_nettype_t netreg_type) +-- +2.16.1 + From 8fd65154e44a4d54a38a080a7658353f68a6c03b Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 22 Feb 2018 23:15:14 +0100 Subject: [PATCH 12/12] tests/can_trx: drop obsolete APPLICATION --- tests/can_trx/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/can_trx/Makefile b/tests/can_trx/Makefile index fab8275842f2..76363b7ed87e 100644 --- a/tests/can_trx/Makefile +++ b/tests/can_trx/Makefile @@ -1,4 +1,3 @@ -export APPLICATION = can_trx include ../Makefile.tests_common USEMODULE += shell