From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [Patch v7 01/10] rustc: new virtual package
Date: Sun, 23 Jul 2017 10:11:57 +0200 [thread overview]
Message-ID: <20170723081206.7774-2-eric.le.bihan.dev@free.fr> (raw)
In-Reply-To: <20170723081206.7774-1-eric.le.bihan.dev@free.fr>
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>
---
package/rustc/Config.in.host | 5 +++++
package/rustc/rustc.mk | 25 +++++++++++++++++++++++++
2 files changed, 30 insertions(+)
create mode 100644 package/rustc/Config.in.host
create mode 100644 package/rustc/rustc.mk
diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
new file mode 100644
index 0000000..fef78a7
--- /dev/null
+++ b/package/rustc/Config.in.host
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_HAS_HOST_RUSTC
+ bool
+
+config BR2_PACKAGE_PROVIDES_HOST_RUSTC
+ string
diff --git a/package/rustc/rustc.mk b/package/rustc/rustc.mk
new file mode 100644
index 0000000..9bbe29f
--- /dev/null
+++ b/package/rustc/rustc.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# rustc
+#
+################################################################################
+
+RUST_TARGET_NAME := $(subst buildroot,unknown,$(GNU_TARGET_NAME))
+
+ifeq ($(BR2_ARM_CPU_ARMV7A),y)
+RUST_TARGET_NAME := $(subst arm-,armv7-,$(RUST_TARGET_NAME))
+endif
+
+ifeq ($(BR2_mips64)$(BR2_mips64el),y)
+RUST_TARGET_NAME := $(subst -gnu,-gnuabi64,$(RUST_TARGET_NAME))
+endif
+
+ifeq ($(HOSTARCH),x86_64)
+RUST_HOST_ARCH = x86_64
+else ifeq ($(HOSTARCH),x86)
+RUST_HOST_ARCH = i686
+endif
+
+RUST_HOST_NAME = $(RUST_HOST_ARCH)-unknown-linux-gnu
+
+$(eval $(host-virtual-package))
--
2.9.4
next prev parent reply other threads:[~2017-07-23 8:11 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-23 8:11 [Buildroot] [Patch v7 00/10] Add support for the Rust programming language Eric Le Bihan
2017-07-23 8:11 ` Eric Le Bihan [this message]
2017-07-23 13:14 ` [Buildroot] [Patch v7 01/10] rustc: new virtual package Jörg Krause
2017-08-10 22:34 ` Arnout Vandecappelle
2017-09-07 17:02 ` Eric Le Bihan
2017-07-23 8:11 ` [Buildroot] [Patch v7 02/10] rust-bin: new package Eric Le Bihan
2017-07-23 13:44 ` Jörg Krause
2017-07-23 14:00 ` Jörg Krause
2017-08-10 23:08 ` Arnout Vandecappelle
2017-09-07 18:13 ` Eric Le Bihan
2017-07-23 8:11 ` [Buildroot] [Patch v7 03/10] rustc: expose host variant in menuconfig Eric Le Bihan
2017-08-10 23:09 ` Arnout Vandecappelle
2017-07-23 8:12 ` [Buildroot] [Patch v7 04/10] rust-bootstrap: new package Eric Le Bihan
2017-08-10 23:13 ` Arnout Vandecappelle
2017-09-07 19:33 ` Eric Le Bihan
2017-07-23 8:12 ` [Buildroot] [Patch v7 05/10] cargo-bootstrap: " Eric Le Bihan
2017-07-23 8:12 ` [Buildroot] [Patch v7 06/10] rust: " Eric Le Bihan
2017-08-10 23:38 ` Arnout Vandecappelle
2017-09-07 19:58 ` Eric Le Bihan
2017-07-23 8:12 ` [Buildroot] [Patch v7 07/10] libssh2: add host variant Eric Le Bihan
2017-07-23 8:19 ` Baruch Siach
2017-08-10 23:40 ` Arnout Vandecappelle
2017-07-23 8:12 ` [Buildroot] [Patch v7 08/10] libhttpparser: " Eric Le Bihan
2017-08-10 23:41 ` Arnout Vandecappelle
2017-07-23 8:12 ` [Buildroot] [Patch v7 09/10] libcurl: " Eric Le Bihan
2017-08-10 23:45 ` Arnout Vandecappelle
2017-07-23 8:12 ` [Buildroot] [Patch v7 10/10] cargo: new package Eric Le Bihan
2017-08-10 23:58 ` Arnout Vandecappelle
2017-09-07 20:20 ` Eric Le Bihan
2017-08-10 23:59 ` [Buildroot] [Patch v7 00/10] Add support for the Rust programming language Arnout Vandecappelle
2017-09-07 20:22 ` Eric Le Bihan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170723081206.7774-2-eric.le.bihan.dev@free.fr \
--to=eric.le.bihan.dev@free.fr \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox