xref: /OK3568_Linux_fs/buildroot/package/am33x-cm3/0001-fix-makefile.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunEnforce correct -march option
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunBuildroot uses a normal ARM compiler to build the AM33X CM3 firmware
4*4882a593Smuzhiyun(which runs on a Cortex-M3 processor), but Buildroot will have a
5*4882a593Smuzhiyundefault -march value that doesn't necessarily match the one needed for
6*4882a593SmuzhiyunCortex-M3, leading to build failures (gcc complains that the
7*4882a593Smuzhiyun-mcpu=cortex-m3 option being passed is not compatible with the
8*4882a593Smuzhiyunselected -march).
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunFix this by explicitly indicating -march=armv7-m.
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunSigned-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunUpdated the patch to the latest version of the Makefile
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunSigned-off-by: Anders Darander <anders@chargestorm.se>
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunIndex: b/Makefile
19*4882a593Smuzhiyun===================================================================
20*4882a593Smuzhiyun--- a/Makefile
21*4882a593Smuzhiyun+++ b/Makefile
22*4882a593Smuzhiyun@@ -13,7 +13,7 @@ SRCDIR = src
23*4882a593Smuzhiyun BINDIR = bin
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun INCLUDES = $(SRCDIR)/include
26*4882a593Smuzhiyun-CFLAGS =-mcpu=cortex-m3 -mthumb -nostdlib -Wall -Wundef \
27*4882a593Smuzhiyun+CFLAGS =-march=armv7-m -mcpu=cortex-m3 -mthumb -nostdlib -Wall -Wundef \
28*4882a593Smuzhiyun 	-Werror-implicit-function-declaration -Wstrict-prototypes \
29*4882a593Smuzhiyun 	-Wdeclaration-after-statement -fno-delete-null-pointer-checks \
30*4882a593Smuzhiyun 	-Wempty-body -fno-strict-overflow  -g -I$(INCLUDES) -O2
31