locking/atomic: Correct (cmp)xchg() instrumentation
[linux-block.git] / scripts / Makefile.build
index a0d5c6cca76ded48984bb25b703e0c51058b0fc7..76323201232a5402b8918fb4cbc27de20701a766 100644 (file)
@@ -285,12 +285,9 @@ rust_common_cmd = \
        -Zcrate-attr=no_std \
        -Zcrate-attr='feature($(rust_allowed_features))' \
        --extern alloc --extern kernel \
-       --crate-type rlib --out-dir $(obj) -L $(objtree)/rust/ \
-       --crate-name $(basename $(notdir $@))
-
-rust_handle_depfile = \
-       mv $(obj)/$(basename $(notdir $@)).d $(depfile); \
-       sed -i '/^\#/d' $(depfile)
+       --crate-type rlib -L $(objtree)/rust/ \
+       --crate-name $(basename $(notdir $@)) \
+       --emit=dep-info=$(depfile)
 
 # `--emit=obj`, `--emit=asm` and `--emit=llvm-ir` imply a single codegen unit
 # will be used. We explicitly request `-Ccodegen-units=1` in any case, and
@@ -301,34 +298,27 @@ rust_handle_depfile = \
 # would not match each other.
 
 quiet_cmd_rustc_o_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@
-      cmd_rustc_o_rs = \
-       $(rust_common_cmd) --emit=dep-info,obj $<; \
-       $(rust_handle_depfile)
+      cmd_rustc_o_rs = $(rust_common_cmd) --emit=obj=$@ $<
 
 $(obj)/%.o: $(src)/%.rs FORCE
        $(call if_changed_dep,rustc_o_rs)
 
 quiet_cmd_rustc_rsi_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@
       cmd_rustc_rsi_rs = \
-       $(rust_common_cmd) --emit=dep-info -Zunpretty=expanded $< >$@; \
-       command -v $(RUSTFMT) >/dev/null && $(RUSTFMT) $@; \
-       $(rust_handle_depfile)
+       $(rust_common_cmd) -Zunpretty=expanded $< >$@; \
+       command -v $(RUSTFMT) >/dev/null && $(RUSTFMT) $@
 
 $(obj)/%.rsi: $(src)/%.rs FORCE
        $(call if_changed_dep,rustc_rsi_rs)
 
 quiet_cmd_rustc_s_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@
-      cmd_rustc_s_rs = \
-       $(rust_common_cmd) --emit=dep-info,asm $<; \
-       $(rust_handle_depfile)
+      cmd_rustc_s_rs = $(rust_common_cmd) --emit=asm=$@ $<
 
 $(obj)/%.s: $(src)/%.rs FORCE
        $(call if_changed_dep,rustc_s_rs)
 
 quiet_cmd_rustc_ll_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@
-      cmd_rustc_ll_rs = \
-       $(rust_common_cmd) --emit=dep-info,llvm-ir $<; \
-       $(rust_handle_depfile)
+      cmd_rustc_ll_rs = $(rust_common_cmd) --emit=llvm-ir=$@ $<
 
 $(obj)/%.ll: $(src)/%.rs FORCE
        $(call if_changed_dep,rustc_ll_rs)