summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/cross.bbclass36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
index 9d951076a7..a292a98335 100644
--- a/meta/classes/cross.bbclass
+++ b/meta/classes/cross.bbclass
@@ -95,3 +95,39 @@ addtask addto_recipe_sysroot after do_populate_sysroot
95do_addto_recipe_sysroot[deptask] = "do_populate_sysroot" 95do_addto_recipe_sysroot[deptask] = "do_populate_sysroot"
96 96
97PATH:prepend = "${COREBASE}/scripts/cross-intercept:" 97PATH:prepend = "${COREBASE}/scripts/cross-intercept:"
98
99#
100# Cross task outputs can call native dependencies and even when cross
101# recipe output doesn't change it might produce different results when
102# the called native dependency is changed, e.g. clang-cross-${TARGET_ARCH}
103# contains symlink to clang binary from clang-native, but when clang-native
104# outhash is changed, clang-cross-${TARGET_ARCH} will still be considered
105# equivalent and target recipes aren't rebuilt with new clang binary, see
106# work around in https://github.com/kraj/meta-clang/pull/1140 to make target
107# recipes to depend directly not only on clang-cross-${TARGET_ARCH} but
108# clang-native as well.
109#
110# This can cause poor interactions with hash equivalence, since this recipes
111# output-changing dependency is "hidden" and downstream task only see that this
112# recipe has the same outhash and therefore is equivalent. This can result in
113# different output in different cases.
114#
115# To resolve this, unhide the output-changing dependency by adding its unihash
116# to this tasks outhash calculation. Unfortunately, don't know specifically
117# know which dependencies are output-changing, so we have to add all of them.
118#
119python cross_add_do_populate_sysroot_deps () {
120 current_task = "do_" + d.getVar("BB_CURRENTTASK")
121 if current_task != "do_populate_sysroot":
122 return
123
124 taskdepdata = d.getVar("BB_TASKDEPDATA", False)
125 pn = d.getVar("PN")
126 deps = {
127 dep[0]:dep[6] for dep in taskdepdata.values() if
128 dep[1] == current_task and dep[0] != pn
129 }
130
131 d.setVar("HASHEQUIV_EXTRA_SIGDATA", "\n".join("%s: %s" % (k, deps[k]) for k in sorted(deps.keys())))
132}
133SSTATECREATEFUNCS += "cross_add_do_populate_sysroot_deps"