Skip to content

Commit 246f942

Browse files
authored
Merge pull request torvalds#845 from ojeda/i-to-rsi
rust: use `.rsi` for macro expanded outputs
2 parents 2fe0366 + 814f8b5 commit 246f942

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,12 @@ jobs:
404404
rm ${{ env.BUILD_DIR }}samples/rust/rust_minimal.o
405405
406406
make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_LLVM_IAS }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 samples/rust/rust_minimal.o
407-
make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_LLVM_IAS }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 samples/rust/rust_minimal.i
407+
make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_LLVM_IAS }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 samples/rust/rust_minimal.rsi
408408
make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_LLVM_IAS }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 samples/rust/rust_minimal.s
409409
make ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_LLVM_IAS }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_SYSROOT }} -j3 samples/rust/rust_minimal.ll
410410
411411
file ${{ env.BUILD_DIR }}samples/rust/rust_minimal.o | grep -F 'ELF'
412-
grep -F '#![feature(prelude_import)]' ${{ env.BUILD_DIR }}samples/rust/rust_minimal.i
412+
grep -F '#![feature(prelude_import)]' ${{ env.BUILD_DIR }}samples/rust/rust_minimal.rsi
413413
grep -F '.text' ${{ env.BUILD_DIR }}samples/rust/rust_minimal.s
414414
grep -F '; ModuleID' ${{ env.BUILD_DIR }}samples/rust/rust_minimal.ll
415415

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
*.o.*
3939
*.patch
4040
*.rmeta
41+
*.rsi
4142
*.s
4243
*.so
4344
*.so.dbg

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ no-compiler-targets := $(no-dot-config-targets) install dtbs_install \
283283
headers_install modules_install kernelrelease image_name
284284
no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease \
285285
image_name
286-
single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
286+
single-targets := %.a %.i %.rsi %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
287287

288288
config-build :=
289289
mixed-build :=
@@ -1724,7 +1724,7 @@ help:
17241724
@echo ' rust-analyzer - Generate rust-project.json rust-analyzer support file'
17251725
@echo ' (requires kernel .config)'
17261726
@echo ' dir/file.[os] - Build specified target only'
1727-
@echo ' dir/file.i - Build macro expanded source, similar to C preprocessing'
1727+
@echo ' dir/file.rsi - Build macro expanded source, similar to C preprocessing'
17281728
@echo ' (run with RUSTFMT=n to skip reformatting if needed)'
17291729
@echo ' dir/file.ll - Build the LLVM assembly file'
17301730
@echo ''
@@ -2013,7 +2013,7 @@ $(clean-dirs):
20132013
clean: $(clean-dirs)
20142014
$(call cmd,rmfiles)
20152015
@find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
2016-
\( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \
2016+
\( -name '*.[aios]' -o -name '*.rsi' -o -name '*.ko' -o -name '.*.cmd' \
20172017
-o -name '*.ko.*' \
20182018
-o -name '*.dtb' -o -name '*.dtbo' -o -name '*.dtb.S' -o -name '*.dt.yaml' \
20192019
-o -name '*.dwo' -o -name '*.lst' \

scripts/Makefile.build

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,14 @@ quiet_cmd_rustc_o_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@
306306
$(obj)/%.o: $(src)/%.rs FORCE
307307
$(call if_changed_dep,rustc_o_rs)
308308

309-
quiet_cmd_rustc_i_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@
310-
cmd_rustc_i_rs = \
309+
quiet_cmd_rustc_rsi_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@
310+
cmd_rustc_rsi_rs = \
311311
$(rust_common_cmd) --emit=dep-info -Zunpretty=expanded $< >$@; \
312312
command -v $(RUSTFMT) >/dev/null && $(RUSTFMT) $@; \
313313
$(rust_handle_depfile)
314314

315-
$(obj)/%.i: $(src)/%.rs FORCE
316-
$(call if_changed_dep,rustc_i_rs)
315+
$(obj)/%.rsi: $(src)/%.rs FORCE
316+
$(call if_changed_dep,rustc_rsi_rs)
317317

318318
quiet_cmd_rustc_s_rs = $(RUSTC_OR_CLIPPY_QUIET) $(quiet_modtag) $@
319319
cmd_rustc_s_rs = \

0 commit comments

Comments
 (0)