aboutsummaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorGravatar Jamie Cunliffe <Jamie.Cunliffe@arm.com> 2023-10-20 16:50:55 +0100
committerGravatar Catalin Marinas <catalin.marinas@arm.com> 2024-02-09 16:11:07 +0000
commitf82811e22b480a203a438d8e1f29af9c93ccbb0c (patch)
tree5453ae31f6bf6b0ed1f1b979d7e51f0f47b81b69 /rust
parentLinux 6.8-rc3 (diff)
downloadlinux-f82811e22b480a203a438d8e1f29af9c93ccbb0c.tar.gz
linux-f82811e22b480a203a438d8e1f29af9c93ccbb0c.tar.bz2
linux-f82811e22b480a203a438d8e1f29af9c93ccbb0c.zip
rust: Refactor the build target to allow the use of builtin targets
Eventually we want all architectures to be using the target as defined by rustc. However currently some architectures can't do that and are using the target.json specification. This puts in place the foundation to allow the use of the builtin target definition or a target.json specification. Signed-off-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com> Acked-by: Masahiro Yamada <masahiroy@kernel.org> Tested-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20231020155056.3495121-2-Jamie.Cunliffe@arm.com [catalin.marinas@arm.com: squashed loongarch ifneq fix from WANG Rui] Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'rust')
-rw-r--r--rust/Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/rust/Makefile b/rust/Makefile
index 9d2a16cc91cb..88f88a26e503 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -434,8 +434,11 @@ $(obj)/core.o: private skip_clippy = 1
$(obj)/core.o: private skip_flags = -Dunreachable_pub
$(obj)/core.o: private rustc_objcopy = $(foreach sym,$(redirect-intrinsics),--redefine-sym $(sym)=__rust$(sym))
$(obj)/core.o: private rustc_target_flags = $(core-cfgs)
-$(obj)/core.o: $(RUST_LIB_SRC)/core/src/lib.rs scripts/target.json FORCE
+$(obj)/core.o: $(RUST_LIB_SRC)/core/src/lib.rs FORCE
$(call if_changed_dep,rustc_library)
+ifneq ($(or $(CONFIG_X86_64),$(CONFIG_LOONGARCH)),)
+$(obj)/core.o: scripts/target.json
+endif
$(obj)/compiler_builtins.o: private rustc_objcopy = -w -W '__*'
$(obj)/compiler_builtins.o: $(src)/compiler_builtins.rs $(obj)/core.o FORCE