From a6177b46d08f140c3287e79d4b99f78621ddfa5e Mon Sep 17 00:00:00 2001
From: guowenxue <guowenxue@gmail.com>
Date: Sat, 24 Aug 2019 22:15:09 +0800
Subject: [PATCH] add u-boot crosstool to fix u-boot can not build by buildroot crosstool 7.0 bug

---
 linux-bsp/patches/u-boot-at91-sama5d4.patch                    |   12 ++++++------
 tools/setup_env.sh                                             |    4 ++++
 tools/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz |    0 
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/linux-bsp/patches/u-boot-at91-sama5d4.patch b/linux-bsp/patches/u-boot-at91-sama5d4.patch
index f7a7fc2..71f6582 100644
--- a/linux-bsp/patches/u-boot-at91-sama5d4.patch
+++ b/linux-bsp/patches/u-boot-at91-sama5d4.patch
@@ -1,6 +1,6 @@
 diff -Nuar u-boot-at91/build.sh u-boot-at91-sama5d4/build.sh
 --- u-boot-at91/build.sh	1970-01-01 08:00:00.000000000 +0800
-+++ u-boot-at91-sama5d4/build.sh	2019-08-22 19:29:07.323275389 +0800
++++ u-boot-at91-sama5d4/build.sh	2019-08-24 22:12:39.162778324 +0800
 @@ -0,0 +1,67 @@
 +#!/bin/bash
 +
@@ -9,7 +9,7 @@
 +IMGS_PATH=../images
 +IMG_NAME=u-boot-${BOARD}.bin
 +
-+CROSSTOOL=/opt/buildroot/cortex-a5/bin/arm-linux-
++CROSSTOOL=/opt/crosstool/cortex-a7/bin/arm-linux-gnueabi-
 +JOBS=`cat /proc/cpuinfo |grep "processor"|wc -l`
 +
 +
@@ -71,7 +71,7 @@
 +
 diff -Nuar u-boot-at91/include/configs/sama5d4_xplained.h u-boot-at91-sama5d4/include/configs/sama5d4_xplained.h
 --- u-boot-at91/include/configs/sama5d4_xplained.h	2019-08-04 21:52:13.000000000 +0800
-+++ u-boot-at91-sama5d4/include/configs/sama5d4_xplained.h	2019-08-22 23:56:21.299582959 +0800
++++ u-boot-at91-sama5d4/include/configs/sama5d4_xplained.h	2019-08-24 21:56:35.594759841 +0800
 @@ -38,7 +38,7 @@
  #define CONFIG_USART_BASE		ATMEL_BASE_USART3
  #define	CONFIG_USART_ID			ATMEL_ID_USART3
@@ -148,7 +148,7 @@
  #define CONFIG_BAUDRATE			115200
 diff -Nuar u-boot-at91/include/env_default.h u-boot-at91-sama5d4/include/env_default.h
 --- u-boot-at91/include/env_default.h	2019-08-04 21:52:13.000000000 +0800
-+++ u-boot-at91-sama5d4/include/env_default.h	2019-08-22 23:47:56.027573267 +0800
++++ u-boot-at91-sama5d4/include/env_default.h	2019-08-24 21:56:35.594759841 +0800
 @@ -76,6 +76,30 @@
  #ifdef	CONFIG_SERVERIP
  	"serverip="	__stringify(CONFIG_SERVERIP)	"\0"
@@ -182,13 +182,13 @@
  #endif
 diff -Nuar u-boot-at91/Makefile u-boot-at91-sama5d4/Makefile
 --- u-boot-at91/Makefile	2019-08-04 21:52:12.000000000 +0800
-+++ u-boot-at91-sama5d4/Makefile	2019-08-22 19:29:07.323275389 +0800
++++ u-boot-at91-sama5d4/Makefile	2019-08-24 22:12:55.098778630 +0800
 @@ -194,6 +194,9 @@
  
  #########################################################################
  
 +ARCH=arm
-+CROSS_COMPILE=/opt/buildroot/cortex-a5/bin/arm-linux-
++CROSS_COMPILE=/opt/crosstool/cortex-a7/bin/arm-linux-gnueabi-
 +
  # set default to nothing for native builds
  ifeq ($(HOSTARCH),$(ARCH))
diff --git a/tools/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz b/tools/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz
new file mode 100644
index 0000000..e5c5e62
--- /dev/null
+++ b/tools/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabi.tar.xz
Binary files differ
diff --git a/tools/setup_env.sh b/tools/setup_env.sh
index f3b1dd7..32748a8 100755
--- a/tools/setup_env.sh
+++ b/tools/setup_env.sh
@@ -124,6 +124,10 @@
 
 install_systools
 
+# u-boot must use arm-linux-gcc 4.9
+install_crosstool
+
+# bootstrap and linux kernel use arm-linux-gcc 7.4.0 in buildroot
 install_buildroot
 
 exit;

--
Gitblit v1.9.1