Skip to content

Commit

Permalink
u-boot: switch to 2017.05
Browse files Browse the repository at this point in the history
Signed-off-by: Stefano Babic <[email protected]>
  • Loading branch information
sbabic committed Aug 2, 2017
1 parent 8c976fd commit 71e52ea
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
39 changes: 39 additions & 0 deletions recipes-bsp/u-boot/files/default-gcc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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 use override to ensure the value of HOSTCC is overwritten when
needed.

RP: Updated the patch to the version being submitted to upstream u-boot

Upstream-Status: Submitted [emailed to Masahiro Yamada for discussion]
RP 2017/3/11

Index: git/tools/Makefile
===================================================================
--- git.orig/tools/Makefile
+++ git/tools/Makefile
@@ -262,7 +262,7 @@ $(LICENSE_H): $(obj)/bin2header $(srctre
subdir- += env

ifneq ($(CROSS_BUILD_TOOLS),)
-HOSTCC = $(CC)
+override HOSTCC = $(CC)

quiet_cmd_crosstools_strip = STRIP $^
cmd_crosstools_strip = $(STRIP) $^; touch $@
Index: git/tools/env/Makefile
===================================================================
--- git.orig/tools/env/Makefile
+++ git/tools/env/Makefile
@@ -8,7 +8,7 @@
# fw_printenv is supposed to run on the target system, which means it should be
# built with cross tools. Although it may look weird, we only replace "HOSTCC"
# with "CC" here for the maximum code reuse of scripts/Makefile.host.
-HOSTCC = $(CC)
+override HOSTCC = $(CC)

# Compile for a hosted environment on the target
HOST_EXTRACFLAGS = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
14 changes: 14 additions & 0 deletions recipes-bsp/u-boot/u-boot-common_2017.05.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
SECTION = "bootloaders"

LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
PE = "1"

# We use the revision in order to avoid having to fetch it from the
# repo during parse
SRCREV = "64c4ffa9fa223f7ae8640f9c8f3044bfa0e3bfda"

SRC_URI = "git://git.denx.de/u-boot.git"

S = "${WORKDIR}/git"
36 changes: 36 additions & 0 deletions recipes-bsp/u-boot/u-boot-fw-utils_2017.05.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
require u-boot-common_${PV}.inc

#SRC_URI += "file://default-gcc.patch"

SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
DEPENDS = "mtd-utils"

INSANE_SKIP_${PN} = "already-stripped"
EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
EXTRA_OEMAKE_class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'

inherit uboot-config

do_compile () {
oe_runmake ${UBOOT_MACHINE}
oe_runmake env
}

do_install () {
install -d ${D}${base_sbindir}
install -d ${D}${sysconfdir}
install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
}

do_install_class-cross () {
install -d ${D}${bindir_cross}
install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
}

SYSROOT_DIRS_append_class-cross = " ${bindir_cross}"

PACKAGE_ARCH = "${MACHINE_ARCH}"
BBCLASSEXTEND = "cross"

0 comments on commit 71e52ea

Please sign in to comment.