40e6e08d0b
The compiler for the Rust programming language is called rustc. There is only one reference implementation for it, based on LLVM, from the Rust project [1]. It can generate code for various architectures so it can be labeled as a cross-compiler. But, as for GCC, building it from source takes time. So it would be sensible to have at least one package which provides it as a pre-built version, fetched from the upstream project. Later another package can be added, to build it from source code. In addition to the compiler, the standard library for the host and/or the target should also be fetched/built. So, add a virtual package named rustc to enable support for multiple providers. Currently, only the host variant will be available to allow the user to cross-compile Rust programs for the target. [1] http://rust-lang.org Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
21 lines
531 B
Makefile
21 lines
531 B
Makefile
################################################################################
|
|
#
|
|
# rustc
|
|
#
|
|
################################################################################
|
|
|
|
RUSTC_ARCH = $(call qstrip,$(BR2_PACKAGE_HOST_RUSTC_ARCH))
|
|
RUSTC_ABI = $(call qstrip,$(BR2_PACKAGE_HOST_RUSTC_ABI))
|
|
|
|
RUST_TARGET_NAME = $(RUSTC_ARCH)-unknown-linux-gnu$(RUSTC_ABI)
|
|
|
|
ifeq ($(HOSTARCH),x86)
|
|
RUSTC_HOST_ARCH = i686
|
|
else
|
|
RUSTC_HOST_ARCH = $(HOSTARCH)
|
|
endif
|
|
|
|
RUST_HOST_NAME = $(RUSTC_HOST_ARCH)-unknown-linux-gnu
|
|
|
|
$(eval $(host-virtual-package))
|