[oe-commits] [openembedded-core] 23/24: u-boot-mkimage: Fix use of 'cc' instead of BUILD_CC

git at git.openembedded.org git at git.openembedded.org
Sat Mar 11 10:57:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit a92e37396291151321cb9ea5ab6e435418f60e2c
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Sat Mar 11 10:37:38 2017 +0000

    u-boot-mkimage: Fix use of 'cc' instead of BUILD_CC
    
    OE needs to be able to change the default compiler. If we pass in HOSTCC
    through the make command, it overwrites not only this setting but also the
    setting in tools/Makefile wrapped in ifneq ($(CROSS_BUILD_TOOLS),) which
    breaks the build.
    
    We therefore add a way of changing the default in the top level Makefile
    without interfering with the other setting.
    
    I've emailed this workaround to Masahiro Yamada for discussion.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-bsp/u-boot/files/default-gcc.patch   | 25 +++++++++++++++++++++++
 meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb |  4 +++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-bsp/u-boot/files/default-gcc.patch b/meta/recipes-bsp/u-boot/files/default-gcc.patch
new file mode 100644
index 0000000..76d192e
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/default-gcc.patch
@@ -0,0 +1,25 @@
+OE needs to be able to change the default compiler. If we pass in HOSTCC
+through the make command, it overwrites not only this setting but also the 
+setting in tools/Makefile wrapped in ifneq ($(CROSS_BUILD_TOOLS),) which 
+breaks the build.
+
+We therefore add a way of changing the default in the top level Makefile 
+without interfering with the other setting.
+
+Upstream-Status: Submitted [emailed to Masahiro Yamada for discussion]
+RP 2017/3/11
+
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile
++++ git/Makefile
+@@ -254,7 +254,8 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH"
+ 	  else if [ -x /bin/bash ]; then echo /bin/bash; \
+ 	  else echo sh; fi ; fi)
+ 
+-HOSTCC       = cc
++DEFAULTHOSTCC = cc
++HOSTCC       = $(DEFAULTHOSTCC)
+ HOSTCXX      = c++
+ HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
+ 		$(if $(CONFIG_TOOLS_DEBUG),-g)
diff --git a/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb b/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb
index c110226..9b5772e 100644
--- a/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb
+++ b/meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb
@@ -1,9 +1,11 @@
 require u-boot-common_${PV}.inc
 
+SRC_URI += "file://default-gcc.patch"
+
 SUMMARY = "U-Boot bootloader image creation tool"
 DEPENDS = "openssl"
 
-EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'
+EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" DEFAULTHOSTCC="${BUILD_CC}" STRIP=true V=1'
 EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
 EXTRA_OEMAKE_class-nativesdk = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1'
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list