summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2017-11-10 17:23:57 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-12-23 22:15:42 +0100
commit2f7474025df62453379da6ae51387c42fc90d5b7 (patch)
treefd7489b19a394487cd5c9a07245ee6765a32f9fc
parent4c0d2081dd60976d3ad14783816ae9a1ca88d020 (diff)
u-boot-toradex-fsl-fw-utils_git.bb: unify with meta-tdx-tegra
Unify the way the fw-utils are cross compiled. While at it format the file identically. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r--recipes-bsp/u-boot/files/default-gcc.patch39
-rw-r--r--recipes-bsp/u-boot/u-boot-toradex-fsl-fw-utils_git.bb19
2 files changed, 53 insertions, 5 deletions
diff --git a/recipes-bsp/u-boot/files/default-gcc.patch b/recipes-bsp/u-boot/files/default-gcc.patch
new file mode 100644
index 0000000..04184df
--- /dev/null
+++ b/recipes-bsp/u-boot/files/default-gcc.patch
@@ -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))) \
diff --git a/recipes-bsp/u-boot/u-boot-toradex-fsl-fw-utils_git.bb b/recipes-bsp/u-boot/u-boot-toradex-fsl-fw-utils_git.bb
index 0264ac8..df75475 100644
--- a/recipes-bsp/u-boot/u-boot-toradex-fsl-fw-utils_git.bb
+++ b/recipes-bsp/u-boot/u-boot-toradex-fsl-fw-utils_git.bb
@@ -16,29 +16,30 @@ DEFAULT_PREFERENCE_colibri-vf = "1"
FILESPATHPKG =. "git:"
+# This revision is based on upstream "v2016.11"
SRCREV = "52259cf22a165c0721bb26c723c0dc5e2659eaa7"
SRCBRANCH = "2016.11-toradex"
SRCREV_use-head-next = "${AUTOREV}"
SRCBRANCH_use-head-next = "2016.11-toradex-next"
SRC_URI = " \
git://git.toradex.com/u-boot-toradex.git;protocol=git;branch=${SRCBRANCH} \
+ file://default-gcc.patch \
file://fw_env.config \
file://fw_unlock_mmc.sh \
"
-PV = "2016.11+gitr${SRCPV}"
+PV = "2016.11+git${SRCPV}"
LOCALVERSION ?= "-${TDX_VER_INT}"
S = "${WORKDIR}/git"
-EXTRA_OEMAKE = 'CC="${CC}" STRIP="${STRIP}"'
-
-INSANE_SKIP_${PN} = "already-stripped ldflags"
+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 pkgconfig uboot-config
do_compile () {
- ln -fs `which gcc` ${STAGING_BINDIR_NATIVE}/cc
oe_runmake ${UBOOT_MACHINE}
oe_runmake env
}
@@ -63,4 +64,12 @@ do_install_append_colibri-imx7-emmc() {
install_unlock_emmc
}
+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}"