From ec3f682d79a38b29ef51b7cdbc9fb9afbe2c9c63 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 22 Oct 2014 12:06:37 -0500 Subject: rework toolchain support for ARM. Use --with-cpu for gcc to have optimized code for requested ARM cpus. Add some basic support for cortex-m3. --- toolchain/gcc/Makefile | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'toolchain/gcc') diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile index dc59bfd35..110ef9d16 100644 --- a/toolchain/gcc/Makefile +++ b/toolchain/gcc/Makefile @@ -126,28 +126,20 @@ GCC_CONFOPTS+= --with-fpu=$(ADK_TARGET_FPU) endif endif -ifeq ($(ADK_CPU_ARMV5TE),y) -GCC_CONFOPTS+= --with-arch=armv5te -endif - -ifeq ($(ADK_CPU_ARMV6),y) -GCC_CONFOPTS+= --with-arch=armv6 -endif - -ifeq ($(ADK_CPU_ARMV7A),y) -GCC_CONFOPTS+= --with-arch=armv7-a -endif - ifeq ($(ADK_CPU_ARM926EJ_S),y) -GCC_CONFOPTS+= --with-arch=armv5te --with-tune=arm926ej-s +GCC_CONFOPTS+= --with-cpu=arm926ej-s endif ifeq ($(ADK_CPU_ARM1176JZF_S),y) -GCC_CONFOPTS+= --with-arch=armv6 --with-tune=arm1176jzf-s +GCC_CONFOPTS+= --with-cpu=arm1176jzf-s +endif + +ifeq ($(ADK_CPU_CORTEX_M3),y) +GCC_CONFOPTS+= --with-cpu=cortex-m3 endif ifeq ($(ADK_CPU_CORTEX_A9),y) -GCC_CONFOPTS+= --with-arch=armv7-a --with-tune=cortex-a9 +GCC_CONFOPTS+= --with-cpu=cortex-a9 endif ifeq ($(ADK_CPU_SPARC_V9),y) -- cgit v1.2.3 From ffffb0121dbf54f491560c3539e6269e432517ae Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 22 Oct 2014 13:40:09 -0500 Subject: use thumb mode for cortex-m3 by default. Fix error: r7 cannot be used in asm here by using -fomit-frame-pointer. --- toolchain/gcc/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'toolchain/gcc') diff --git a/toolchain/gcc/Makefile b/toolchain/gcc/Makefile index 110ef9d16..ccf0b4b69 100644 --- a/toolchain/gcc/Makefile +++ b/toolchain/gcc/Makefile @@ -135,7 +135,7 @@ GCC_CONFOPTS+= --with-cpu=arm1176jzf-s endif ifeq ($(ADK_CPU_CORTEX_M3),y) -GCC_CONFOPTS+= --with-cpu=cortex-m3 +GCC_CONFOPTS+= --with-cpu=cortex-m3 --with-mode=thumb endif ifeq ($(ADK_CPU_CORTEX_A9),y) @@ -194,8 +194,8 @@ endif $(SED) '/k prot/agcc_cv_libc_provides_ssp=yes' $(WRKBUILD)/gcc/configure cd $(GCC_BUILD_DIR_MINIMAL); \ PATH='$(TARGET_PATH)' \ - CFLAGS="-O0 -g0" \ - CXXFLAGS="-O0 -g0" \ + CFLAGS="-O0 -g0 -fomit-frame-pointer" \ + CXXFLAGS="-O0 -g0 -fomit-frame-pointer" \ $(WRKBUILD)/configure \ ${GCC_CONFOPTS} \ --enable-languages=c \ @@ -216,8 +216,8 @@ $(GCC_BUILD_DIR_INITIAL)/.configured: mkdir -p $(GCC_BUILD_DIR_INITIAL) cd $(GCC_BUILD_DIR_INITIAL); \ PATH='$(TARGET_PATH)' \ - CFLAGS="-O0 -g0" \ - CXXFLAGS="-O0 -g0" \ + CFLAGS="-O0 -g0 -fomit-frame-pointer" \ + CXXFLAGS="-O0 -g0 -fomit-frame-pointer" \ $(WRKBUILD)/configure \ ${GCC_CONFOPTS} \ ${GCC_FINAL_CONFOPTS} \ -- cgit v1.2.3