From fda46f68009bbac52aaa530bab38e8cb7ad10145 Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Sun, 18 Oct 2009 11:34:38 +0000 Subject: [PATCH] - cc65 2.13. allows to define all necessary paths through the single env var CC65_HOME. - cc65 2.13. allows to override the stacksize from the linker command line thus eliminating the need for linker configs maintained by Contiki. - cc65 2.13. integrates the startup code with the library. In 2.12. the startup code pulled in main(). Now main() is supposed to pull in the startup code. But if main() resides itself in a library (as with Contiki) then nothing is pulled in at all :-(. The workaround is to pull in main() explicitly through the new option -u (working like the same GCC option). --- cpu/6502/Makefile.6502 | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/cpu/6502/Makefile.6502 b/cpu/6502/Makefile.6502 index 020ad92b3..eedea4e2c 100644 --- a/cpu/6502/Makefile.6502 +++ b/cpu/6502/Makefile.6502 @@ -30,19 +30,11 @@ # # Author: Oliver Schmidt # -# $Id: Makefile.6502,v 1.29 2009/07/26 21:27:43 oliverschmidt Exp $ +# $Id: Makefile.6502,v 1.30 2009/10/18 11:34:38 oliverschmidt Exp $ # -ifndef CC65_INC - ${error CC65_INC not defined! You must specify where the cc65 headers reside} -endif - -ifndef LD65_LIB - ${error LD65_LIB not defined! You must specify where the cc65 libraries reside} -endif - -ifndef LD65_OBJ - ${error LD65_OBJ not defined! You must specify where the cc65 objects reside} +ifndef CC65_HOME + ${error CC65_HOME not defined! You must specify where cc65 resides} endif all: cs8900a.eth lan91c96.eth @@ -58,8 +50,7 @@ CONTIKI_CPU_SOURCEFILES = log.c error.c config.c clock.c ctk-mouse.c \ CONTIKI_SOURCEFILES += $(CTK) ctk-conio.c petsciiconv.c cfs-posix-dir.c \ $(CONTIKI_TARGET_SOURCEFILES) $(CONTIKI_CPU_SOURCEFILES) -TARGET_STARTFILES = $(TARGET).o --start-group -TARGET_LIBFILES = $(TARGET).lib --end-group +TARGET_LIBFILES = $(TARGET).lib ### Compiler definitions @@ -68,9 +59,12 @@ CC = cc65 LD = ld65 AR = ar65 +# Contiki is carefully designed to use extremely little stack. +# The apps coming with Contiki run even on a 0x100 byte stack. + ASFLAGS = -t $(TARGET) CFLAGS += -t $(TARGET) -Or -LDFLAGS = -C $(CONTIKI)/platform/$(TARGET)/linker.cfg -m contiki-$(TARGET).map +LDFLAGS = -D __STACKSIZE__=0x200 -u _main -m contiki-$(TARGET).map AROPTS = a ### Compilation rules