diff mbox

am33x-cm3: Enforce correct -march option

Message ID 1370775458-31863-1-git-send-email-thomas.petazzoni@free-electrons.com
State Accepted
Commit c73c5fc90d0d40c86ea7690e23fa34409c39f4bf
Headers show

Commit Message

Thomas Petazzoni June 9, 2013, 10:57 a.m. UTC
Buildroot uses a normal ARM compiler to build the AM33X CM3 firmware
(which runs on a Cortex-M3 processor), but Buildroot will have a
default -march value that doesn't necessarily match the one needed for
Cortex-M3, leading to build failures (gcc complains that the
-mcpu=cortex-m3 option being passed is not compatible with the
selected -march).

Fix this by explicitly indicating -march=armv7-m.

Fixes:

   http://autobuild.buildroot.net/results/db1/db13623b1701bfe678c302e8f88c7473cb2345f9/build-end.log

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../am33x-cm3/am33x-cm3-0001-fix-makefile.patch    | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 package/am33x-cm3/am33x-cm3-0001-fix-makefile.patch

Comments

Peter Korsgaard June 9, 2013, 6:59 p.m. UTC | #1
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> Buildroot uses a normal ARM compiler to build the AM33X CM3 firmware
 Thomas> (which runs on a Cortex-M3 processor), but Buildroot will have a
 Thomas> default -march value that doesn't necessarily match the one needed for
 Thomas> Cortex-M3, leading to build failures (gcc complains that the
 Thomas> -mcpu=cortex-m3 option being passed is not compatible with the
 Thomas> selected -march).

 Thomas> Fix this by explicitly indicating -march=armv7-m.

Committed, thanks.
diff mbox

Patch

diff --git a/package/am33x-cm3/am33x-cm3-0001-fix-makefile.patch b/package/am33x-cm3/am33x-cm3-0001-fix-makefile.patch
new file mode 100644
index 0000000..77ba11c
--- /dev/null
+++ b/package/am33x-cm3/am33x-cm3-0001-fix-makefile.patch
@@ -0,0 +1,26 @@ 
+Enforce correct -march option
+
+Buildroot uses a normal ARM compiler to build the AM33X CM3 firmware
+(which runs on a Cortex-M3 processor), but Buildroot will have a
+default -march value that doesn't necessarily match the one needed for
+Cortex-M3, leading to build failures (gcc complains that the
+-mcpu=cortex-m3 option being passed is not compatible with the
+selected -march).
+
+Fix this by explicitly indicating -march=armv7-m.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/Makefile
+===================================================================
+--- a/Makefile
++++ b/Makefile
+@@ -13,7 +13,7 @@
+ BINDIR = bin
+ 
+ INCLUDES = $(SRCDIR)/include
+-CFLAGS =-mcpu=cortex-m3 -mthumb -nostdlib -Wall -g -I$(INCLUDES)
++CFLAGS =-march=armv7-m -mcpu=cortex-m3 -mthumb -nostdlib -Wall -g -I$(INCLUDES)
+ LDFLAGS =-nostartfiles -fno-exceptions -Tfirmware.ld
+ 
+ EXECUTABLE=am335x-pm-firmware.elf