mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 01:15:20 +02:00
FROMLIST: 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. Bug: 308623796 Change-Id: I4e07024876dadad12be24ab5579b694e884eb638 Signed-off-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com> Link: https://lore.kernel.org/r/20231020155056.3495121-2-Jamie.Cunliffe@arm.com Signed-off-by: Matthew Maurer <mmaurer@google.com>
This commit is contained in:
parent
6dd3b42616
commit
433a394399
1
Makefile
1
Makefile
|
@ -584,7 +584,6 @@ KBUILD_CFLAGS += -fno-strict-aliasing
|
|||
|
||||
KBUILD_CPPFLAGS := -D__KERNEL__
|
||||
KBUILD_RUSTFLAGS := $(rust_common_flags) \
|
||||
--target=$(objtree)/scripts/target.json \
|
||||
-Cpanic=abort -Cembed-bitcode=n -Clto=n \
|
||||
-Cforce-unwind-tables=n -Ccodegen-units=1 \
|
||||
-Csymbol-mangling-version=v0 \
|
||||
|
|
|
@ -68,6 +68,7 @@ export BITS
|
|||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383
|
||||
#
|
||||
KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx
|
||||
KBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json
|
||||
KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2
|
||||
|
||||
ifeq ($(CONFIG_X86_KERNEL_IBT),y)
|
||||
|
|
|
@ -431,8 +431,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)
|
||||
ifdef CONFIG_X86_64
|
||||
$(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
|
||||
|
|
|
@ -11,12 +11,14 @@ hostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
|
|||
hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
|
||||
hostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS) += rustdoc_test_builder
|
||||
hostprogs-always-$(CONFIG_RUST_KERNEL_DOCTESTS) += rustdoc_test_gen
|
||||
always-$(CONFIG_RUST) += target.json
|
||||
|
||||
ifdef CONFIG_X86_64
|
||||
always-$(CONFIG_RUST) += target.json
|
||||
filechk_rust_target = $< < include/config/auto.conf
|
||||
|
||||
$(obj)/target.json: scripts/generate_rust_target include/config/auto.conf FORCE
|
||||
$(call filechk,rust_target)
|
||||
endif
|
||||
|
||||
hostprogs += generate_rust_target
|
||||
generate_rust_target-rust := y
|
||||
|
|
Loading…
Reference in New Issue
Block a user