From df192b0f253902efa6b863b886e2557eb8c97d35 Mon Sep 17 00:00:00 2001 From: Pham Huu Dang Nhat Date: Wed, 12 Nov 2014 10:40:12 +0700 Subject: [PATCH 1/2] cpu/stm32f1: c++: added _kill (weak) and weak attribute for _kill_r --- cpu/stm32f1/syscalls.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cpu/stm32f1/syscalls.c b/cpu/stm32f1/syscalls.c index b70f0b5358..44c2391880 100644 --- a/cpu/stm32f1/syscalls.c +++ b/cpu/stm32f1/syscalls.c @@ -156,12 +156,29 @@ int _getpid(void) * * @return TODO */ +__attribute__ ((weak)) int _kill_r(struct _reent *r, int pid, int sig) { r->_errno = ESRCH; /* not implemented yet */ return -1; } +/** + * @brief Send a signal to a given thread (non-reentrant syscall) + * + * @param r TODO + * @param pid TODO + * @param sig TODO + * + * @return TODO + */ +__attribute__ ((weak)) +int _kill(int pid, int sig) +{ + errno = ESRCH; /* not implemented yet */ + return -1; +} + /** * @brief Open a file * From c7a1dede8666e8e3149712c1e6c3725d8fea23aa Mon Sep 17 00:00:00 2001 From: Pham Huu Dang Nhat Date: Wed, 12 Nov 2014 10:41:07 +0700 Subject: [PATCH 2/2] boards/iot-lab_M3: provided c++ feature --- boards/iot-lab_M3/Makefile.features | 2 +- boards/iot-lab_M3/Makefile.include | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/boards/iot-lab_M3/Makefile.features b/boards/iot-lab_M3/Makefile.features index 10585ddac4..1fd4646dd7 100644 --- a/boards/iot-lab_M3/Makefile.features +++ b/boards/iot-lab_M3/Makefile.features @@ -1 +1 @@ -FEATURES_PROVIDED += transceiver periph_gpio periph_uart periph_spi periph_i2c periph_rtt periph_cpuid +FEATURES_PROVIDED += transceiver periph_gpio periph_uart periph_spi periph_i2c periph_rtt periph_cpuid cpp diff --git a/boards/iot-lab_M3/Makefile.include b/boards/iot-lab_M3/Makefile.include index 32ea808781..c44a05b97f 100644 --- a/boards/iot-lab_M3/Makefile.include +++ b/boards/iot-lab_M3/Makefile.include @@ -17,6 +17,7 @@ export PORT # define tools used for building the project export PREFIX = arm-none-eabi- export CC = $(PREFIX)gcc +export CXX = $(PREFIX)g++ export AR = $(PREFIX)ar export AS = $(PREFIX)as export LINK = $(PREFIX)gcc @@ -32,6 +33,11 @@ export CPU_USAGE = -mcpu=cortex-m3 export FPU_USAGE = export CFLAGS += -ggdb -g3 -std=gnu99 -Os -Wall -Wstrict-prototypes $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles export CFLAGS += -ffunction-sections -fdata-sections -fno-builtin + +# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++ +export CXXUWFLAGS += +export CXXEXFLAGS += + export ASFLAGS += -ggdb -g3 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian export LINKFLAGS += -ggdb -g3 -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mthumb-interwork -nostartfiles # $(LINKERSCRIPT) is specified in cpu/Makefile.include