CM3: add -mthumb to the linker option.
authorarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 6 Apr 2010 09:28:15 +0000 (09:28 +0000)
committerarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 6 Apr 2010 09:28:15 +0000 (09:28 +0000)
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
examples/lm3s1968/lm3s1968.mk

index a317f1e810f1d9d86243df4a33efaf0a0f0d88fb..a02600f37f30cdee8878d52563eb4657d7767c10 100644 (file)
        #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 <cfg/compiler.h>
-       #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)
index db952703b21b1d1308c8fc01805f411078a83199..eff79bfe4e385ac1acf2e82911fecc109d6b0dc7 100644 (file)
@@ -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