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