All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v9 1/8] rustc: new virtual package
Date: Thu, 28 Dec 2017 17:27:49 +0100	[thread overview]
Message-ID: <20171228172749.4b376a8c@windsurf.home> (raw)
In-Reply-To: <20171228155146.18193-2-eric.le.bihan.dev@free.fr>

Hello,

On Thu, 28 Dec 2017 16:51:39 +0100, Eric Le Bihan wrote:

> diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host
> new file mode 100644
> index 0000000000..16c95fa0b4
> --- /dev/null
> +++ b/package/rustc/Config.in.host
> @@ -0,0 +1,17 @@
> +config BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
> +	bool
> +	default y
> +	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
> +	depends on BR2_i386 || BR2_x86_64 \
> +		|| BR2_arm  || BR2_aarch64 \
> +		|| BR2_powerpc  || BR2_powerpc64 \
> +		|| BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el

This would be more readable as:

	default y if BR2_aarch64
	default y if BR2_arm && !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5
	default y if BR2_i386
	default y if ...
	default y if BR2_mips || BR2_mipsel
	default y if (BR2_mips64 || BR2_mips64el) && BR2_MIPS_NABI64
	default y if BR2_x86_64

> +	depends on !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5
> +	depends on !BR2_MIPS_NABI32
> +	depends on BR2_TOOLCHAIN_USES_GLIBC

Since it's weird for a host package to have a target architecture
dependency and target C library dependency, it would be good to have a
comment that explains this. I assume it's because of the Rust standard
library, so something like:

	# The pre-built Rust standard library is only available for the
	# following architectures/ABIs, and is built against glibc.

> diff --git a/package/rustc/rustc.mk b/package/rustc/rustc.mk
> new file mode 100644
> index 0000000000..4163a44bc1
> --- /dev/null
> +++ b/package/rustc/rustc.mk
> @@ -0,0 +1,31 @@
> +################################################################################
> +#
> +# rustc
> +#
> +################################################################################
> +
> +RUST_ARCH := $(call qstrip,$(BR2_ARCH))
> +
> +ifeq ($(BR2_ARM_CPU_ARMV7A),y)
> +RUST_ARCH := armv7
> +endif
> +
> +ifeq ($(BR2_ARM_EABI),y)
> +RUST_ABI := eabi
> +else ifeq ($(BR2_ARM_EABIHF),y)
> +RUST_ABI := eabihf
> +else ifeq ($(BR2_mips64)$(BR2_mips64el),y)
> +RUST_ABI := abi64
> +endif

Perhaps this could be defined in the Config.in file as well ?

config BR2_PACKAGE_HOST_RUSTC_ARCH
	string
	default "armv7" 	if BR2_ARM_CPU_ARMV7A
	default BR2_ARCH 	if !BR2_ARM_CPU_ARMV7A

config BR2_PACKAGE_HOST_RUSTC_ABI
	string
	default "eabi" 		if BR2_ARM_EABI
	default "eabihf" 	if BR2_ARM_EABIHF
	default "abi64" 	if BR2_MIPS_NABI64

> +RUST_TARGET_NAME := $(RUST_ARCH)-unknown-linux-gnu$(RUST_ABI)

Why are you using := in this file instead of = ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2017-12-28 16:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28 15:51 [Buildroot] [PATCH v9 0/8] Add support for the Rust programming Eric Le Bihan
2017-12-28 15:51 ` [Buildroot] [PATCH v9 1/8] rustc: new virtual package Eric Le Bihan
2017-12-28 16:27   ` Thomas Petazzoni [this message]
2018-01-01 16:11     ` Eric Le Bihan
2017-12-28 15:51 ` [Buildroot] [PATCH v9 2/8] rust-bin: new package Eric Le Bihan
2017-12-28 20:37   ` Thomas Petazzoni
2018-01-01 20:13     ` Eric Le Bihan
2017-12-28 15:51 ` [Buildroot] [PATCH v9 3/8] cargo-bin: " Eric Le Bihan
2017-12-28 20:38   ` Thomas Petazzoni
2018-01-01 20:14     ` Eric Le Bihan
2017-12-28 15:51 ` [Buildroot] [PATCH v9 4/8] rust: " Eric Le Bihan
2017-12-28 21:08   ` Thomas Petazzoni
2018-01-01 20:23     ` Eric Le Bihan
2017-12-28 15:51 ` [Buildroot] [PATCH v9 5/8] libssh2: add host variant Eric Le Bihan
2017-12-28 21:11   ` Thomas Petazzoni
2017-12-28 15:51 ` [Buildroot] [PATCH v9 6/8] libhttpparser: " Eric Le Bihan
2017-12-28 21:19   ` Thomas Petazzoni
2017-12-28 15:51 ` [Buildroot] [PATCH v9 7/8] libcurl: " Eric Le Bihan
2017-12-28 21:19   ` Thomas Petazzoni
2017-12-28 15:51 ` [Buildroot] [PATCH v9 8/8] cargo: new package Eric Le Bihan
2017-12-28 21:32   ` Thomas Petazzoni
2018-01-02 17:49     ` Eric Le Bihan
2017-12-28 16:21 ` [Buildroot] [PATCH v9 0/8] Add support for the Rust programming Thomas Petazzoni
2017-12-28 17:52   ` Eric Le Bihan
2017-12-28 21:36     ` Thomas Petazzoni
2018-01-02 17:51       ` Eric Le Bihan
2018-01-18  7:48       ` Eric Le Bihan
2018-01-18  8:03         ` Thomas Petazzoni
2018-01-18 22:41           ` Eric Le Bihan
2018-01-19  8:03             ` Thomas Petazzoni
2018-01-22 21:57               ` Arnout Vandecappelle

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=20171228172749.4b376a8c@windsurf.home \
    --to=thomas.petazzoni@free-electrons.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.