HOST_RUST_BIN_SOURCE = rustc-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz
HOST_RUST_BIN_EXTRA_DOWNLOADS = \
- rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz \
- rust-std-$(RUST_BIN_VERSION)-$(RUSTC_TARGET_NAME).tar.xz
+ rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz
+
+ifeq ($(BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS),y)
+HOST_RUST_BIN_EXTRA_DOWNLOADS += rust-std-$(RUST_BIN_VERSION)-$(RUSTC_TARGET_NAME).tar.xz
+endif
HOST_RUST_BIN_LIBSTD_HOST_PREFIX = rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME)/rust-std-$(RUSTC_HOST_NAME)
--prefix=$(HOST_DIR) \
--disable-ldconfig
-ifeq ($(BR2_PACKAGE_HOST_RUST_BIN),y)
define HOST_RUST_BIN_INSTALL_RUSTC
(cd $(@D); \
./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
endef
+ifeq ($(BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS),y)
define HOST_RUST_BIN_INSTALL_LIBSTD_TARGET
(cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUSTC_TARGET_NAME); \
./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
+# All host rust packages should depend on this option
config BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
+ bool
+ default y if BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+
+# All target rust packages should depend on this option
+config BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
bool
# The pre-built Rust standard library is only available for the
# following architectures/ABIs, and is built against glibc.
default y if (BR2_mips64 || BR2_mips64el) && !BR2_MIPS_CPU_MIPS64R6 \
&& BR2_MIPS_NABI64
depends on BR2_TOOLCHAIN_USES_GLIBC
- depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+ depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
config BR2_PACKAGE_HOST_RUSTC_ARCH
string
endchoice
+endif
+
config BR2_PACKAGE_PROVIDES_HOST_RUSTC
string
default "host-rust" if BR2_PACKAGE_HOST_RUST
- default "host-rust-bin" if BR2_PACKAGE_HOST_RUST_BIN
-
-endif
+ # Default to host-rust-bin as long as host arch supports it
+ default "host-rust-bin" if !BR2_PACKAGE_HOST_RUST
+ depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
RUSTC_ARCH = $(call qstrip,$(BR2_PACKAGE_HOST_RUSTC_ARCH))
RUSTC_ABI = $(call qstrip,$(BR2_PACKAGE_HOST_RUSTC_ABI))
+ifeq ($(BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS),y)
RUSTC_TARGET_NAME = $(RUSTC_ARCH)-unknown-linux-gnu$(RUSTC_ABI)
+endif
ifeq ($(HOSTARCH),x86)
RUSTC_HOST_ARCH = i686