17b855aac9
This patch modifies the include order to include headers from newlib ahead of those from the core of Contiki. The only header file names that are common between Contiki and newlib are assert.h and config.h, but the config.h files in Contiki are only located in ports for other CPUs so they are irrelevant to this patch. The motivation for this patch is to cause files that include assert.h to include the one from newlib that halts when an assertion fails. The assert implementation in the core of Contiki does not halt when an assertion fails. This patch also adds newlib syscall stubs that are required by the newlib assert implementation and the _exit syscall function that halts the system. Finally, this patch updates some other newlib syscall stubs to properly indicate their status as unsupported syscalls.
24 lines
812 B
Text
24 lines
812 B
Text
BSP_PATH=$(CONTIKI)/platform/galileo/bsp
|
|
LIBC_PATH=$(BSP_PATH)/libc
|
|
LIBC=$(LIBC_PATH)/i586-elf
|
|
LIBGCC_PATH = /usr/lib/gcc/$(shell gcc -dumpmachine)/$(shell gcc -dumpversion)
|
|
|
|
CONTIKI_TARGET_DIRS = . core/sys/
|
|
CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o}
|
|
CONTIKI_SOURCEFILES += contiki-main.c clock.c rtimer-arch.c
|
|
|
|
PROJECT_SOURCEFILES += newlib-syscalls.c
|
|
|
|
CONTIKI_CPU=$(CONTIKI)/cpu/x86
|
|
include $(CONTIKI)/cpu/x86/Makefile.x86_quarkX1000
|
|
|
|
CFLAGS += -fno-stack-protector -nostdinc -I$(LIBC)/include -isystem $(LIBGCC_PATH)/include -isystem $(LIBGCC_PATH)/include-fixed
|
|
LDFLAGS += -nostdlib -L$(LIBC)/lib -L$(LIBGCC_PATH)/32
|
|
|
|
TARGET_LIBFILES += -lm -lc -lgcc
|
|
|
|
-include $(LIBC_PATH)/Makefile.libc
|
|
|
|
ifndef BUILT_LIBC
|
|
$(error Build the C library by executing $(LIBC_PATH)/build_newlib.sh)
|
|
endif
|