@@ -29,6 +29,11 @@ obj-$(CONFIG_RUST) += exports.o
2929# Avoids running `$(RUSTC)` for the sysroot when it may not be available.
3030ifdef CONFIG_RUST
3131
32+ # `$(rust_flags)` is passed in case the user added `--sysroot`.
33+ rustc_sysroot := $(shell $(RUSTC ) $(rust_flags ) --print sysroot)
34+ rustc_host_target := $(shell $(RUSTC ) --version --verbose | grep -F 'host: ' | cut -d' ' -f2)
35+ RUST_LIB_SRC ?= $(rustc_sysroot ) /lib/rustlib/src/rust/library
36+
3237ifeq ($(quiet ) ,silent_)
3338cargo_quiet =-q
3439rust_test_quiet =-q
@@ -52,8 +57,9 @@ quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host),H, ) $<
5257 cmd_rustdoc = \
5358 OBJTREE=$(abspath $(objtree ) ) \
5459 $(RUSTDOC ) $(if $(rustdoc_host ) ,$(rust_common_flags ) ,$(rust_flags ) ) \
55- $(rustc_target_flags ) -L $(objtree ) /rust \
56- --output $(objtree ) /rust/doc --crate-name $(subst rustdoc-,,$@ ) \
60+ $(rustc_target_flags ) -L$(objtree ) /$(obj ) \
61+ --output $(objtree ) /$(obj ) /doc \
62+ --crate-name $(subst rustdoc-,,$@ ) \
5763 @$(objtree ) /include/generated/rustc_cfg $<
5864
5965# The `html_logo_url` and `html_favicon_url` forms of the `doc` attribute
@@ -67,20 +73,25 @@ quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host),H, ) $<
6773# The https://github.com/rust-lang/rfcs/pull/3226 RFC suggests two new
6874# command-like flags to solve the issue. Meanwhile, we use the non-custom case
6975# and then retouch the generated files.
70- rustdoc : rustdoc-core rustdoc-macros rustdoc-compiler_builtins rustdoc-alloc rustdoc-kernel
71- $(Q ) cp $(srctree ) /Documentation/rust/logo.svg $(objtree ) /rust/doc
72- $(Q ) find $(objtree ) /rust/doc -name ' *.html' -type f -print0 | xargs -0 sed -Ei \
76+ rustdoc : rustdoc-core rustdoc-macros rustdoc-compiler_builtins \
77+ rustdoc-alloc rustdoc-kernel
78+ $(Q)cp $(srctree)/Documentation/rust/logo.svg $(objtree)/$(obj)/doc
79+ $(Q)find $(objtree)/$(obj)/doc -name '*.html' -type f -print0 | xargs -0 sed -Ei \
7380 -e 's:rust-logo\.png:logo.svg:g' \
7481 -e 's:favicon\.svg:logo.svg:g' \
7582 -e 's:<link rel="alternate icon" type="image/png" href="[./]*favicon-(16x16|32x32)\.png">::g'
7683
7784rustdoc-macros : private rustdoc_host = yes
7885rustdoc-macros : private rustc_target_flags = --crate-type proc-macro \
7986 --extern proc_macro
80- rustdoc-macros : $(srctree ) /rust /macros/lib.rs FORCE
87+ rustdoc-macros : $(src ) /macros/lib.rs FORCE
8188 $(call if_changed,rustdoc)
8289
83- rustdoc-compiler_builtins : $(srctree ) /rust/compiler_builtins.rs rustdoc-core FORCE
90+ rustdoc-core : private rustc_target_flags = $(core-cfgs )
91+ rustdoc-core : $(RUST_LIB_SRC ) /core/src/lib.rs FORCE
92+ $(call if_changed,rustdoc)
93+
94+ rustdoc-compiler_builtins : $(src ) /compiler_builtins.rs rustdoc-core FORCE
8495 $(call if_changed,rustdoc)
8596
8697# We need to allow `rustdoc::broken_intra_doc_links` because some
@@ -89,35 +100,33 @@ rustdoc-compiler_builtins: $(srctree)/rust/compiler_builtins.rs rustdoc-core FOR
89100# due to things that are "configured out" vs. entirely non-existing ones.
90101rustdoc-alloc : private rustc_target_flags = $(alloc-cfgs ) \
91102 -Arustdoc ::broken_intra_doc_links
92- rustdoc-alloc : $(srctree ) /rust/alloc/lib.rs rustdoc-core \
93- rustdoc-compiler_builtins FORCE
103+ rustdoc-alloc : $(src ) /alloc/lib.rs rustdoc-core rustdoc-compiler_builtins FORCE
94104 $(call if_changed,rustdoc)
95105
96106rustdoc-kernel : private rustc_target_flags = --extern alloc \
97- --extern build_error \
98- --extern macros=$(objtree)/rust/libmacros.so
99- rustdoc-kernel : $(srctree ) /rust/kernel/lib.rs rustdoc-core \
100- rustdoc-macros rustdoc-compiler_builtins rustdoc-alloc \
101- $(objtree)/rust/libmacros.so $(objtree)/rust/bindings_generated.rs \
102- $(objtree)/rust/bindings_helpers_generated.rs FORCE
107+ --extern build_error --extern macros=$(objtree)/$(obj)/libmacros.so
108+ rustdoc-kernel : $(src ) /kernel/lib.rs rustdoc-core rustdoc-macros \
109+ rustdoc-compiler_builtins rustdoc-alloc $(obj)/libmacros.so \
110+ $(obj)/bindings_generated.rs $(obj)/bindings_helpers_generated.rs FORCE
103111 $(call if_changed,rustdoc)
104112
105113quiet_cmd_rustc_test_library = RUSTC TL $<
106114 cmd_rustc_test_library = \
107115 OBJTREE=$(abspath $(objtree ) ) \
108116 $(RUSTC ) $(rust_common_flags ) \
109- @$(objtree ) /include/generated/rustc_cfg \
110- $(rustc_target_flags ) --crate-type $(if $(rustc_test_library_proc ) ,proc-macro,rlib) \
111- --out-dir $(objtree ) /rust/test/ --cfg testlib \
112- --sysroot $(objtree ) /rust/test/sysroot \
113- -L $(objtree ) /rust/test/ --crate-name $(subst rusttest-,,$(subst rusttestlib-,,$@ ) ) $<
114-
115- rusttestlib-build_error : $(srctree ) /rust/build_error.rs rusttest-prepare FORCE
117+ @$(objtree ) /include/generated/rustc_cfg $(rustc_target_flags ) \
118+ --crate-type $(if $(rustc_test_library_proc ) ,proc-macro,rlib) \
119+ --out-dir $(objtree ) /$(obj ) /test --cfg testlib \
120+ --sysroot $(objtree ) /$(obj ) /test/sysroot \
121+ -L$(objtree ) /$(obj ) /test \
122+ --crate-name $(subst rusttest-,,$(subst rusttestlib-,,$@ ) ) $<
123+
124+ rusttestlib-build_error : $(src ) /build_error.rs rusttest-prepare FORCE
116125 $(call if_changed,rustc_test_library)
117126
118127rusttestlib-macros : private rustc_target_flags = --extern proc_macro
119128rusttestlib-macros : private rustc_test_library_proc = yes
120- rusttestlib-macros : $(srctree ) /rust /macros/lib.rs rusttest-prepare FORCE
129+ rusttestlib-macros : $(src ) /macros/lib.rs rusttest-prepare FORCE
121130 $(call if_changed,rustc_test_library)
122131
123132quiet_cmd_rustdoc_test = RUSTDOC T $<
@@ -126,10 +135,9 @@ quiet_cmd_rustdoc_test = RUSTDOC T $<
126135 $(RUSTDOC ) --test $(rust_common_flags ) \
127136 @$(objtree ) /include/generated/rustc_cfg \
128137 $(rustc_target_flags ) $(rustdoc_test_target_flags ) \
129- --sysroot $(objtree ) /rust/test/sysroot $(rustdoc_test_quiet ) \
130- -L $(objtree ) /rust/test \
131- --output $(objtree ) /rust/doc --crate-name $(subst rusttest-,,$@ ) \
132- @$(objtree ) /include/generated/rustc_cfg $<
138+ --sysroot $(objtree ) /$(obj ) /test/sysroot $(rustdoc_test_quiet ) \
139+ -L$(objtree ) /$(obj ) /test --output $(objtree ) /$(obj ) /doc \
140+ --crate-name $(subst rusttest-,,$@ ) $<
133141
134142# We cannot use `-Zpanic-abort-tests` because some tests are dynamic,
135143# so for the moment we skip `-Cpanic=abort`.
@@ -138,10 +146,11 @@ quiet_cmd_rustc_test = RUSTC T $<
138146 OBJTREE=$(abspath $(objtree ) ) \
139147 $(RUSTC ) --test $(rust_common_flags ) \
140148 @$(objtree ) /include/generated/rustc_cfg \
141- $(rustc_target_flags ) --out-dir $(objtree ) /rust/test \
142- --sysroot $(objtree ) /rust/test/sysroot \
143- -L $(objtree ) /rust/test/ --crate-name $(subst rusttest-,,$@ ) $< ; \
144- $(objtree ) /rust/test/$(subst rusttest-,,$@ ) $(rust_test_quiet ) \
149+ $(rustc_target_flags ) --out-dir $(objtree ) /$(obj ) /test \
150+ --sysroot $(objtree ) /$(obj ) /test/sysroot \
151+ -L$(objtree ) /$(obj ) /test \
152+ --crate-name $(subst rusttest-,,$@ ) $< ; \
153+ $(objtree ) /$(obj ) /test/$(subst rusttest-,,$@ ) $(rust_test_quiet ) \
145154 $(rustc_test_run_flags )
146155
147156rusttest : rusttest-macros rusttest-kernel
@@ -175,45 +184,44 @@ rusttest: rusttest-macros rusttest-kernel
175184# `-Zbuild-std` and related hacks are not needed.
176185quiet_cmd_rustsysroot = RUSTSYSROOT
177186 cmd_rustsysroot = \
178- rm -rf $(objtree ) /rust /test; \
179- mkdir -p $(objtree ) /rust /test; \
180- cp -a $(rustc_sysroot ) $(objtree ) /rust /test/sysroot; \
181- cp -r $(srctree ) /rust /alloc/* \
182- $(objtree ) /rust /test/sysroot/lib/rustlib/src/rust/library/alloc/src; \
183- echo '\# !/bin/sh' > $(objtree)/rust /test/rustc_sysroot; \
184- echo "$(RUSTC) --sysroot=$(abspath $(objtree)/rust /test/sysroot) \"\$$@\"" \
185- >> $(objtree)/rust /test/rustc_sysroot; \
186- chmod u+x $(objtree)/rust /test/rustc_sysroot; \
187- $(CARGO) -q new $(objtree)/rust /test/dummy; \
188- RUSTC=$(objtree)/rust /test/rustc_sysroot $(CARGO) $(cargo_quiet) \
187+ rm -rf $(objtree ) /$( obj ) /test; \
188+ mkdir -p $(objtree ) /$( obj ) /test; \
189+ cp -a $(rustc_sysroot ) $(objtree ) /$( obj ) /test/sysroot; \
190+ cp -r $(srctree ) /$( src ) /alloc/* \
191+ $(objtree ) /$( obj ) /test/sysroot/lib/rustlib/src/rust/library/alloc/src; \
192+ echo '\# !/bin/sh' > $(objtree)/$(obj) /test/rustc_sysroot; \
193+ echo "$(RUSTC) --sysroot=$(abspath $(objtree)/$(obj) /test/sysroot) \"\$$@\"" \
194+ >> $(objtree)/$(obj) /test/rustc_sysroot; \
195+ chmod u+x $(objtree)/$(obj) /test/rustc_sysroot; \
196+ $(CARGO) -q new $(objtree)/$(obj) /test/dummy; \
197+ RUSTC=$(objtree)/$(obj) /test/rustc_sysroot $(CARGO) $(cargo_quiet) \
189198 test -Zbuild-std --target $(rustc_host_target) \
190- --manifest-path $(objtree)/rust /test/dummy/Cargo.toml; \
191- rm $(objtree)/rust /test/sysroot/lib/rustlib/$(rustc_host_target)/lib/*; \
192- cp $(objtree)/rust /test/dummy/target/$(rustc_host_target)/debug/deps/* \
193- $(objtree)/rust /test/sysroot/lib/rustlib/$(rustc_host_target)/lib
199+ --manifest-path $(objtree)/$(obj) /test/dummy/Cargo.toml; \
200+ rm $(objtree)/$(obj) /test/sysroot/lib/rustlib/$(rustc_host_target)/lib/*; \
201+ cp $(objtree)/$(obj) /test/dummy/target/$(rustc_host_target)/debug/deps/* \
202+ $(objtree)/$(obj) /test/sysroot/lib/rustlib/$(rustc_host_target)/lib
194203
195204rusttest-prepare : FORCE
196205 $(call if_changed,rustsysroot)
197206
198207rusttest-macros : private rustc_target_flags = --extern proc_macro
199208rusttest-macros : private rustdoc_test_target_flags = --crate-type proc-macro
200- rusttest-macros : $(srctree ) /rust /macros/lib.rs rusttest-prepare FORCE
209+ rusttest-macros : $(src ) /macros/lib.rs rusttest-prepare FORCE
201210 $(call if_changed,rustc_test)
202211 $(call if_changed,rustdoc_test)
203212
204213rusttest-kernel : private rustc_target_flags = --extern alloc \
205214 --extern build_error --extern macros
206- rusttest-kernel : private rustc_test_run_flags = \
207- --skip bindgen_test_layout_
208- rusttest-kernel : $(srctree ) /rust/kernel/lib.rs rusttest-prepare \
215+ rusttest-kernel : private rustc_test_run_flags = --skip bindgen_test_layout_
216+ rusttest-kernel : $(src ) /kernel/lib.rs rusttest-prepare \
209217 rusttestlib-build_error rusttestlib-macros FORCE
210218 $(call if_changed,rustc_test)
211219 $(call if_changed,rustc_test_library)
212220 $(call if_changed,rustdoc_test)
213221
214222filechk_rust_target = $(objtree ) /scripts/generate_rust_target < $<
215223
216- $(objtree ) /rust /target.json : $(objtree ) /include/config/auto.conf FORCE
224+ $(obj ) /target.json : $(objtree ) /include/config/auto.conf FORCE
217225 $(call filechk,rust_target)
218226
219227ifdef CONFIG_CC_IS_CLANG
227235# if we end up using one of those structs).
228236bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
229237 -mskip-rax-setup -mgeneral-regs-only -msign-return-address=% \
230- -mindirect-branch=thunk-extern -mindirect-branch-register -mrecord-mcount \
231- -mabi=lp64 -mstack-protector-guard% -mtraceback=no \
238+ -mindirect-branch=thunk-extern -mindirect-branch-register \
239+ -mrecord-mcount - mabi=lp64 -mstack-protector-guard% -mtraceback=no \
232240 -mno-pointers-to-nested-functions -mno-string -mno-strict-align \
233241 -mstrict-align \
234242 -fconserve-stack -falign-jumps=% -falign-loops=% \
@@ -239,7 +247,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
239247 -fno-inline-functions-called-once \
240248 --param=% --param asan-%
241249
242- # Derived from `scripts/Makefile.clang`
250+ # Derived from `scripts/Makefile.clang`.
243251BINDGEN_TARGET_arm := arm-linux-gnueabi
244252BINDGEN_TARGET_arm64 := aarch64-linux-gnu
245253BINDGEN_TARGET_powerpc := powerpc64le-linux-gnu
@@ -272,23 +280,24 @@ quiet_cmd_bindgen = BINDGEN $@
272280 --size_t-is-usize -o $@ -- $(bindgen_c_flags_final ) -DMODULE \
273281 $(bindgen_target_cflags ) $(bindgen_target_extra )
274282
275- $(objtree ) /rust /bindings_generated.rs : private bindgen_target_flags = \
276- $(shell grep -v '^\# \|^$$' $(srctree)/rust /bindgen_parameters)
277- $(objtree ) /rust/ bindings_generated.rs : $(srctree ) /rust /kernel/bindings_helper.h \
278- $(srctree)/rust /bindgen_parameters FORCE
283+ $(obj ) /bindings_generated.rs : private bindgen_target_flags = \
284+ $(shell grep -v '^\# \|^$$' $(srctree)/$(src) /bindgen_parameters)
285+ $(obj ) / bindings_generated.rs : $(src ) /kernel/bindings_helper.h \
286+ $(src) /bindgen_parameters FORCE
279287 $(call if_changed_dep,bindgen)
280288
281289# See `CFLAGS_REMOVE_helpers.o` above. In addition, Clang on C does not warn
282290# with `-Wmissing-declarations` (unlike GCC), so it is not strictly needed here
283291# given it is `libclang`; but for consistency, future Clang changes and/or
284292# a potential future GCC backend for `bindgen`, we disable it too.
285- $(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_flags = \
286- --blacklist-type '.*' --whitelist-var '' --whitelist-function 'rust_helper_.*'
287- $(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_cflags = \
288- -I$(objtree)/rust/ -Wno-missing-prototypes -Wno-missing-declarations
289- $(objtree ) /rust/bindings_helpers_generated.rs : private bindgen_target_extra = ; \
293+ $(obj ) /bindings_helpers_generated.rs : private bindgen_target_flags = \
294+ --blacklist-type '.*' --whitelist-var '' \
295+ --whitelist-function 'rust_helper_.*'
296+ $(obj ) /bindings_helpers_generated.rs : private bindgen_target_cflags = \
297+ -I$(objtree)/$(obj) -Wno-missing-prototypes -Wno-missing-declarations
298+ $(obj ) /bindings_helpers_generated.rs : private bindgen_target_extra = ; \
290299 sed -Ei 's/pub fn rust_helper_([a-zA-Z0-9_]*)/# [link_name="rust_helper_\1"]\n pub fn \1/g' $@
291- $(objtree ) /rust/ bindings_helpers_generated.rs : $(srctree ) /rust /helpers.c FORCE
300+ $(obj ) / bindings_helpers_generated.rs : $(src ) /helpers.c FORCE
292301 $(call if_changed_dep,bindgen)
293302
294303quiet_cmd_exports = EXPORTS $@
@@ -298,85 +307,70 @@ quiet_cmd_exports = EXPORTS $@
298307 | xargs -Isymbol \
299308 echo 'EXPORT_SYMBOL_RUST_GPL(symbol);' > $@
300309
301- $(objtree ) /rust/ exports_core_generated.h : $(objtree ) /rust /core.o FORCE
310+ $(obj ) / exports_core_generated.h : $(obj ) /core.o FORCE
302311 $(call if_changed,exports)
303312
304- $(objtree ) /rust/ exports_alloc_generated.h : $(objtree ) /rust /alloc.o FORCE
313+ $(obj ) / exports_alloc_generated.h : $(obj ) /alloc.o FORCE
305314 $(call if_changed,exports)
306315
307- $(objtree ) /rust/ exports_kernel_generated.h : $(objtree ) /rust /kernel.o FORCE
316+ $(obj ) / exports_kernel_generated.h : $(obj ) /kernel.o FORCE
308317 $(call if_changed,exports)
309318
310319quiet_cmd_rustc_procmacro = $(RUSTC_OR_CLIPPY_QUIET ) P $@
311320 cmd_rustc_procmacro = \
312321 $(RUSTC_OR_CLIPPY ) $(rust_common_flags ) \
313322 --emit=dep-info,link --extern proc_macro \
314- --crate-type proc-macro --out-dir $(objtree ) /rust/ \
323+ --crate-type proc-macro --out-dir $(objtree ) /$( obj ) \
315324 --crate-name $(patsubst lib% .so,% ,$(notdir $@ ) ) $< ; \
316- mv $(objtree ) /rust /$(patsubst lib% .so,% ,$(notdir $@ ) ) .d $(depfile ) ; \
325+ mv $(objtree ) /$( obj ) /$(patsubst lib% .so,% ,$(notdir $@ ) ) .d $(depfile ) ; \
317326 sed -i '/^\# /d' $(depfile)
318327
319328# Procedural macros can only be used with the `rustc` that compiled it.
320329# Therefore, to get `libmacros.so` automatically recompiled when the compiler
321330# version changes, we add `core.o` as a dependency (even if it is not needed).
322- $(objtree ) /rust/libmacros.so : $(srctree ) /rust/macros/lib.rs \
323- $(objtree ) /rust/core.o FORCE
331+ $(obj ) /libmacros.so : $(src ) /macros/lib.rs $(obj ) /core.o FORCE
324332 $(call if_changed_dep,rustc_procmacro)
325333
326334quiet_cmd_rustc_library = $(if $(skip_clippy ) ,RUSTC,$(RUSTC_OR_CLIPPY_QUIET ) ) L $@
327335 cmd_rustc_library = \
328336 OBJTREE=$(abspath $(objtree ) ) \
329337 $(if $(skip_clippy ) ,$(RUSTC ) ,$(RUSTC_OR_CLIPPY ) ) \
330338 $(filter-out $(skip_flags ) ,$(rust_flags ) $(rustc_target_flags ) ) \
331- --emit=dep-info,obj,metadata \
332- --crate-type rlib -- out-dir $(objtree ) /rust/ -L $(objtree ) /rust/ \
339+ --emit=dep-info,obj,metadata --crate-type rlib \
340+ --out-dir $(objtree ) /$( obj ) -L$(objtree ) /$( obj ) \
333341 --crate-name $(patsubst % .o,% ,$(notdir $@ ) ) $< ; \
334- mv $(objtree ) /rust /$(patsubst % .o,% ,$(notdir $@ ) ) .d $(depfile ) ; \
342+ mv $(objtree ) /$( obj ) /$(patsubst % .o,% ,$(notdir $@ ) ) .d $(depfile ) ; \
335343 sed -i '/^\# /d' $(depfile) \
336344 $(if $(rustc_objcopy),;$(OBJCOPY) $(rustc_objcopy) $@)
337345
338- # `$(rust_flags)` is passed in case the user added `--sysroot`.
339- rustc_sysroot := $(shell $(RUSTC ) $(rust_flags ) --print sysroot)
340- rustc_host_target := $(shell $(RUSTC ) --version --verbose | grep -F 'host: ' | cut -d' ' -f2)
341- RUST_LIB_SRC ?= $(rustc_sysroot ) /lib/rustlib/src/rust/library
342-
343346rust-analyzer :
344- $(Q )$(srctree ) /scripts/generate_rust_analyzer.py $(srctree ) $(objtree ) $(RUST_LIB_SRC ) > $(objtree ) /rust-project.json
347+ $(Q )$(srctree ) /scripts/generate_rust_analyzer.py $(srctree ) $(objtree ) \
348+ $(RUST_LIB_SRC ) > $(objtree ) /rust-project.json
345349
346- $(objtree ) /rust/compiler_builtins.o : private rustc_objcopy = -w -W '__* '
347- $(objtree ) /rust/compiler_builtins.o : $(srctree ) /rust/compiler_builtins.rs \
348- $(objtree)/rust/core.o FORCE
350+ $(obj ) /core.o : private skip_clippy = 1
351+ $(obj ) /core.o : private skip_flags = -Dunreachable_pub --edition=2021
352+ $(obj ) /core.o : private rustc_target_flags = $(core-cfgs ) --edition=2018
353+ $(obj ) /core.o : $(RUST_LIB_SRC ) /core/src/lib.rs $(obj ) /target.json FORCE
349354 $(call if_changed_dep,rustc_library)
350355
351- $(objtree ) /rust/alloc.o : private skip_clippy = 1
352- $(objtree ) /rust/alloc.o : private skip_flags = -Dunreachable_pub
353- $(objtree ) /rust/alloc.o : private rustc_target_flags = $(alloc-cfgs )
354- $(objtree ) /rust/alloc.o : $(srctree ) /rust/alloc/lib.rs \
355- $(objtree)/rust/compiler_builtins.o FORCE
356+ $(obj ) /compiler_builtins.o : private rustc_objcopy = -w -W '__* '
357+ $(obj ) /compiler_builtins.o : $(src ) /compiler_builtins.rs $(obj ) /core.o FORCE
356358 $(call if_changed_dep,rustc_library)
357359
358- $(objtree ) /rust/build_error.o : $(srctree ) /rust/build_error.rs \
359- $(objtree)/rust/compiler_builtins.o FORCE
360+ $(obj ) /alloc.o : private skip_clippy = 1
361+ $(obj ) /alloc.o : private skip_flags = -Dunreachable_pub
362+ $(obj ) /alloc.o : private rustc_target_flags = $(alloc-cfgs )
363+ $(obj ) /alloc.o : $(src ) /alloc/lib.rs $(obj ) /compiler_builtins.o FORCE
360364 $(call if_changed_dep,rustc_library)
361365
362- $(objtree ) /rust/kernel.o : private rustc_target_flags = --extern alloc \
363- --extern build_error \
364- --extern macros
365- $(objtree ) /rust/kernel.o : $(srctree ) /rust/kernel/lib.rs $(objtree ) /rust/alloc.o \
366- $(objtree)/rust/build_error.o \
367- $(objtree)/rust/libmacros.so $(objtree)/rust/bindings_generated.rs \
368- $(objtree)/rust/bindings_helpers_generated.rs FORCE
366+ $(obj ) /build_error.o : $(src ) /build_error.rs $(obj ) /compiler_builtins.o FORCE
369367 $(call if_changed_dep,rustc_library)
370368
371- $(objtree ) /rust/core .o : private skip_clippy = 1
372- $( objtree ) /rust/core.o : private skip_flags = -Dunreachable_pub --edition=2021
373- $(objtree ) /rust/core .o : private rustc_target_flags = $( core-cfgs ) --edition=2018
374- $( objtree ) /rust/core.o : $(RUST_LIB_SRC ) /core/src/lib .rs \
375- $(objtree)/rust/target.json FORCE
369+ $(obj ) /kernel .o : private rustc_target_flags = --extern alloc \
370+ --extern build_error --extern macros
371+ $(obj ) /kernel .o : $( src ) /kernel/lib.rs $( obj ) /alloc.o $( obj ) /build_error.o \
372+ $(obj)/libmacros.so $(obj)/bindings_generated .rs \
373+ $(obj)/bindings_helpers_generated.rs FORCE
376374 $(call if_changed_dep,rustc_library)
377375
378- rustdoc-core : private rustc_target_flags = $(core-cfgs )
379- rustdoc-core : $(RUST_LIB_SRC ) /core/src/lib.rs FORCE
380- $(call if_changed,rustdoc)
381-
382376endif # CONFIG_RUST
0 commit comments