diff mbox series

[U-Boot] arm: armv7m: Clean up some thumb / compiler flag options

Message ID 1525740412-26351-1-git-send-email-trini@konsulko.com
State Accepted
Commit ea37f0b3129bb21c5d4bd11a14bfcf2537e8ec29
Delegated to: Tom Rini
Headers show
Series [U-Boot] arm: armv7m: Clean up some thumb / compiler flag options | expand

Commit Message

Tom Rini May 8, 2018, 12:46 a.m. UTC
- The correct way to build with thumb mode is to select SYS_THUMB_BUILD
- We should be setting -march=armv7-m in arch/arm/Makefile not the
  sub-config.mk file.

Signed-off-by: Tom Rini <trini@konsulko.com>
---
 arch/arm/Kconfig              | 1 +
 arch/arm/Makefile             | 1 +
 arch/arm/cpu/armv7m/config.mk | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

Comments

Tom Rini May 24, 2018, 12:40 p.m. UTC | #1
On Mon, May 07, 2018 at 08:46:52PM -0400, Tom Rini wrote:

> - The correct way to build with thumb mode is to select SYS_THUMB_BUILD
> - We should be setting -march=armv7-m in arch/arm/Makefile not the
>   sub-config.mk file.
> 
> Signed-off-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2bbb86c462dd..efc9108a5a3a 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -221,6 +221,7 @@  config CPU_V7M
 	select THUMB2_KERNEL
 	select SYS_CACHE_SHIFT_5
 	select SYS_ARM_MPU
+	select SYS_THUMB_BUILD
 
 config CPU_V7R
 	bool
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 3b1dd85716de..913d23048f1f 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -16,6 +16,7 @@  arch-$(CONFIG_CPU_ARM1136)	=-march=armv5
 arch-$(CONFIG_CPU_ARM1176)	=-march=armv5t
 arch-$(CONFIG_CPU_V7A)		=$(call cc-option, -march=armv7-a, \
 				 $(call cc-option, -march=armv7, -march=armv5))
+arch-$(CONFIG_CPU_V7M)		=-march=armv7-m
 arch-$(CONFIG_CPU_V7R)		=-march=armv7-r
 arch-$(CONFIG_ARM64)		=-march=armv8-a
 
diff --git a/arch/arm/cpu/armv7m/config.mk b/arch/arm/cpu/armv7m/config.mk
index 4e46df5a2844..f50964cfb92e 100644
--- a/arch/arm/cpu/armv7m/config.mk
+++ b/arch/arm/cpu/armv7m/config.mk
@@ -3,4 +3,4 @@ 
 # (C) Copyright 2015
 # Kamil Lulko, <kamil.lulko@gmail.com>
 
-PLATFORM_CPPFLAGS += -march=armv7-m -mthumb -mno-unaligned-access
+PLATFORM_CPPFLAGS += -mno-unaligned-access