mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-23 07:23:12 +02:00
kbuild: rust: add rustc-min-version support function
commitac954145e1
upstream. Introduce `rustc-min-version` support function that mimics `{gcc,clang}-min-version` ones, following commit88b61e3bff
("Makefile.compiler: replace cc-ifversion with compiler-specific macros"). In addition, use it in the first use case we have in the kernel (which was done independently to minimize the changes needed for the fix). Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Reviewed-by: Fiona Behrens <me@Kloenk.dev> Reviewed-by: Nicolas Schier <n.schier@avm.de> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cef081c823
commit
1814e71a4e
|
@ -656,6 +656,20 @@ cc-cross-prefix
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
$(RUSTC) support functions
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
rustc-min-version
|
||||||
|
rustc-min-version tests if the value of $(CONFIG_RUSTC_VERSION) is greater
|
||||||
|
than or equal to the provided value and evaluates to y if so.
|
||||||
|
|
||||||
|
Example::
|
||||||
|
|
||||||
|
rustflags-$(call rustc-min-version, 108500) := -Cfoo
|
||||||
|
|
||||||
|
In this example, rustflags-y will be assigned the value -Cfoo if
|
||||||
|
$(CONFIG_RUSTC_VERSION) is >= 1.85.0.
|
||||||
|
|
||||||
$(LD) support functions
|
$(LD) support functions
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ KBUILD_CFLAGS += $(CC_FLAGS_NO_FPU) \
|
||||||
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
|
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
|
||||||
KBUILD_AFLAGS += $(compat_vdso)
|
KBUILD_AFLAGS += $(compat_vdso)
|
||||||
|
|
||||||
ifeq ($(call test-ge, $(CONFIG_RUSTC_VERSION), 108500),y)
|
ifeq ($(call rustc-min-version, 108500),y)
|
||||||
KBUILD_RUSTFLAGS += --target=aarch64-unknown-none-softfloat
|
KBUILD_RUSTFLAGS += --target=aarch64-unknown-none-softfloat
|
||||||
else
|
else
|
||||||
KBUILD_RUSTFLAGS += --target=aarch64-unknown-none -Ctarget-feature="-neon"
|
KBUILD_RUSTFLAGS += --target=aarch64-unknown-none -Ctarget-feature="-neon"
|
||||||
|
|
|
@ -67,6 +67,10 @@ gcc-min-version = $(call test-ge, $(CONFIG_GCC_VERSION), $1)
|
||||||
# Usage: cflags-$(call clang-min-version, 110000) += -foo
|
# Usage: cflags-$(call clang-min-version, 110000) += -foo
|
||||||
clang-min-version = $(call test-ge, $(CONFIG_CLANG_VERSION), $1)
|
clang-min-version = $(call test-ge, $(CONFIG_CLANG_VERSION), $1)
|
||||||
|
|
||||||
|
# rustc-min-version
|
||||||
|
# Usage: rustc-$(call rustc-min-version, 108500) += -Cfoo
|
||||||
|
rustc-min-version = $(call test-ge, $(CONFIG_RUSTC_VERSION), $1)
|
||||||
|
|
||||||
# ld-option
|
# ld-option
|
||||||
# Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y)
|
# Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y)
|
||||||
ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3))
|
ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user