diff --git a/meta/classes-global/staging.bbclass b/meta/classes-global/staging.bbclass
index 20340a16e1..558d808243 100644
--- a/meta/classes-global/staging.bbclass
+++ b/meta/classes-global/staging.bbclass
@@ -338,6 +338,9 @@ python extend_recipe_sysroot() {
             start.add(dep2)
         start.remove(dep)
 
+    # Don't stage the sysroots of the recipes the do_rm_work tasks depend on
+    start = set(dep for dep in start if not setscenedeps[dep][1].startswith("do_rm_work"))
+
     #bb.note(" start3 is %s" % str(start))
 
     # Create collapsed do_populate_sysroot -> do_populate_sysroot tree
diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass
index 7cb8a325b2..12cb70d55d 100644
--- a/meta/classes/rm_work.bbclass
+++ b/meta/classes/rm_work.bbclass
@@ -131,6 +131,20 @@ do_rm_work_all[recrdeptask] = "do_rm_work"
 do_rm_work_all[noexec] = "1"
 addtask rm_work_all before do_build
 
+# Remove the work directories of the recipes do_populate_sdk depends on.
+# Only the dependencies on other recipes are copied, so the image isn't built.
+do_rm_work_populate_sdk () {
+    :
+}
+do_rm_work_populate_sdk[recrdeptask] = "do_rm_work"
+do_rm_work_populate_sdk[depends] = "${@d.getVarFlag('do_populate_sdk', 'depends') or ''}"
+do_rm_work_populate_sdk[rdepends] = "${@d.getVarFlag('do_populate_sdk', 'rdepends') or ''}"
+do_rm_work_populate_sdk[noexec] = "1"
+python () {
+    if d.getVarFlag('do_populate_sdk', 'task'):
+        bb.build.addtask('do_rm_work_populate_sdk', 'do_populate_sdk', '', d)
+}
+
 do_populate_sdk[postfuncs] += "rm_work_populatesdk"
 rm_work_populatesdk () {
     :
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index c0e581d0c8..cbe210215e 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -39,6 +39,11 @@ def sstate_rundepfilter(siggen, fn, recipename, task, dep, depname, dataCaches):
     if task == "do_rm_work":
         return False
 
+    # Skip the do_rm_work_populate_sdk task signature, it only removes work
+    # directories and must not change the do_populate_sdk signature
+    if deptaskname == "do_rm_work_populate_sdk":
+        return False
+
     # (Almost) always include our own inter-task dependencies (unless it comes
     # from a mcdepends). The exception is the special
     # do_kernel_configme->do_unpack_and_patch dependency from archiver.bbclass.
