From 863f8ebdc1af60ca64e0cf4474bfea4b9e6b45b1 Mon Sep 17 00:00:00 2001 From: arighi Date: Tue, 6 Apr 2010 09:28:15 +0000 Subject: [PATCH] CM3: add -mthumb to the linker option. This instructs the linker to link the binary with thumb code only, so we can use all the built-in C functions. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3390 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cpu/attr.h | 15 --------------- examples/lm3s1968/lm3s1968.mk | 10 +++++----- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/bertos/cpu/attr.h b/bertos/cpu/attr.h index a317f1e8..a02600f3 100644 --- a/bertos/cpu/attr.h +++ b/bertos/cpu/attr.h @@ -190,21 +190,6 @@ #define PAUSE asm volatile ("wfi" ::: "memory") #define BREAKPOINT /* asm("bkpt 0") DOES NOT WORK */ - /* - * FIXME: builtin GCC memset() can be buggy! We need to redefine it - * here for this architecture. :( - */ - #include - #define memset __cm3_memset - INLINE void *__cm3_memset(void *s, int c, size_t n) - { - uint8_t *p = (uint8_t *)s; - - while (n--) - *p++ = c; - return s; - } - #elif CPU_PPC #define CPU_REG_BITS (CPU_PPC32 ? 32 : 64) diff --git a/examples/lm3s1968/lm3s1968.mk b/examples/lm3s1968/lm3s1968.mk index db952703..eff79bfe 100644 --- a/examples/lm3s1968/lm3s1968.mk +++ b/examples/lm3s1968/lm3s1968.mk @@ -44,9 +44,9 @@ lm3s1968_CPPASRC = \ # This is an hosted application lm3s1968_PREFIX = arm-none-eabi- -lm3s1968_CPPAFLAGS = -g -gdwarf-2 -mthumb -fno-strict-aliasing -fwrapv -lm3s1968_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_LM3S1968__ -D'CPU_FREQ=(50000000L)' -D'WIZ_AUTOGEN' -g3 -gdwarf-2 -fverbose-asm -mthumb -Iexamples/lm3s1968 -Ibertos/cpu/cortex-m3 -fno-strict-aliasing -fwrapv -lm3s1968_LDFLAGS = -nostartfiles -T bertos/cpu/cortex-m3/scripts/lm3s1968_rom.ld -Wl,--no-warn-mismatch -fno-strict-aliasing -fwrapv +lm3s1968_CPPAFLAGS = -g -gdwarf-2 -mthumb -mno-thumb-interwork -falign-functions=16 -fno-strict-aliasing -fwrapv +lm3s1968_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_LM3S1968__ -D'CPU_FREQ=(50000000L)' -D'WIZ_AUTOGEN' -g3 -gdwarf-2 -fverbose-asm -mthumb -mno-thumb-interwork -falign-functions=16 -Iexamples/lm3s1968 -Ibertos/cpu/cortex-m3 -fno-strict-aliasing -fwrapv +lm3s1968_LDFLAGS = -nostartfiles -T bertos/cpu/cortex-m3/scripts/lm3s1968_rom.ld -Wl,--no-warn-mismatch -fno-strict-aliasing -fwrapv -mthumb -mno-thumb-interwork -falign-functions=16 lm3s1968_CPU = cortex-m3 @@ -59,6 +59,6 @@ lm3s1968_STOPDEBUG_SCRIPT = bertos/prg_scripts/arm/stopopenocd.sh # Debug stuff ifeq ($(lm3s1968_DEBUG),0) - demo_CFLAGS += -O1 -fomit-frame-pointer - demo_CXXFLAGS += -O1 -fomit-frame-pointer + demo_CFLAGS += -Os -fomit-frame-pointer + demo_CXXFLAGS += -Os -fomit-frame-pointer endif -- 2.25.1