diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-11 10:37:38 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-11 16:09:13 +0000 |
commit | 21db71990bdaac6740873f591fc11b2e54caa217 (patch) | |
tree | 3cf72fb657761c19fed11a899baa340252fd9b0c /meta/recipes-bsp/u-boot | |
parent | 760e81678cec80dcdaab12c2a0a0148e3e0ba275 (diff) | |
download | poky-21db71990bdaac6740873f591fc11b2e54caa217.tar.gz |
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.
(From OE-Core rev: e777d6873ce9a8a80288ecbcfc86239e0ed0e2f9)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/u-boot')
-rw-r--r-- | meta/recipes-bsp/u-boot/files/default-gcc.patch | 25 | ||||
-rw-r--r-- | meta/recipes-bsp/u-boot/u-boot-mkimage_2017.01.bb | 4 |
2 files changed, 28 insertions, 1 deletions
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 0000000000..76d192e355 --- /dev/null +++ b/meta/recipes-bsp/u-boot/files/default-gcc.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | OE needs to be able to change the default compiler. If we pass in HOSTCC | ||
2 | through the make command, it overwrites not only this setting but also the | ||
3 | setting in tools/Makefile wrapped in ifneq ($(CROSS_BUILD_TOOLS),) which | ||
4 | breaks the build. | ||
5 | |||
6 | We therefore add a way of changing the default in the top level Makefile | ||
7 | without interfering with the other setting. | ||
8 | |||
9 | Upstream-Status: Submitted [emailed to Masahiro Yamada for discussion] | ||
10 | RP 2017/3/11 | ||
11 | |||
12 | Index: git/Makefile | ||
13 | =================================================================== | ||
14 | --- git.orig/Makefile | ||
15 | +++ git/Makefile | ||
16 | @@ -254,7 +254,8 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" | ||
17 | else if [ -x /bin/bash ]; then echo /bin/bash; \ | ||
18 | else echo sh; fi ; fi) | ||
19 | |||
20 | -HOSTCC = cc | ||
21 | +DEFAULTHOSTCC = cc | ||
22 | +HOSTCC = $(DEFAULTHOSTCC) | ||
23 | HOSTCXX = c++ | ||
24 | HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \ | ||
25 | $(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 c110226710..9b5772ec39 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 @@ | |||
1 | require u-boot-common_${PV}.inc | 1 | require u-boot-common_${PV}.inc |
2 | 2 | ||
3 | SRC_URI += "file://default-gcc.patch" | ||
4 | |||
3 | SUMMARY = "U-Boot bootloader image creation tool" | 5 | SUMMARY = "U-Boot bootloader image creation tool" |
4 | DEPENDS = "openssl" | 6 | DEPENDS = "openssl" |
5 | 7 | ||
6 | EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1' | 8 | EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" DEFAULTHOSTCC="${BUILD_CC}" STRIP=true V=1' |
7 | EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' | 9 | EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' |
8 | EXTRA_OEMAKE_class-nativesdk = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' | 10 | EXTRA_OEMAKE_class-nativesdk = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' |
9 | 11 | ||