From patchwork Thu Dec 28 15:51:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Le Bihan X-Patchwork-Id: 853470 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z6vNj5x75z9s4s for ; Fri, 29 Dec 2017 02:52:05 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 295D983CC9; Thu, 28 Dec 2017 15:52:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HkjJmu+hG5Fn; Thu, 28 Dec 2017 15:51:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 57A8782FFB; Thu, 28 Dec 2017 15:51:58 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 5589B1C0A6E for ; Thu, 28 Dec 2017 15:51:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 522DD26370 for ; Thu, 28 Dec 2017 15:51:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 599Id0o77oYp for ; Thu, 28 Dec 2017 15:51:54 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by silver.osuosl.org (Postfix) with ESMTPS id D716322EC1 for ; Thu, 28 Dec 2017 15:51:53 +0000 (UTC) Received: from localhost.localdomain (unknown [169.50.62.69]) (Authenticated sender: eric.le.bihan.dev) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 03EC919F57E for ; Thu, 28 Dec 2017 16:51:49 +0100 (CET) From: Eric Le Bihan To: buildroot@buildroot.org Date: Thu, 28 Dec 2017 16:51:39 +0100 Message-Id: <20171228155146.18193-2-eric.le.bihan.dev@free.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> References: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> Subject: [Buildroot] [PATCH v9 1/8] rustc: new virtual package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 --- package/Config.in.host | 1 + package/rustc/Config.in.host | 17 +++++++++++++++++ package/rustc/rustc.mk | 31 +++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 package/rustc/Config.in.host create mode 100644 package/rustc/rustc.mk diff --git a/package/Config.in.host b/package/Config.in.host index dd6415bba5..2f20dd0e48 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -46,6 +46,7 @@ menu "Host utilities" source "package/qemu/Config.in.host" source "package/raspberrypi-usbboot/Config.in.host" source "package/rauc/Config.in.host" + source "package/rustc/Config.in.host" source "package/s6-rc/Config.in.host" source "package/sam-ba/Config.in.host" source "package/squashfs/Config.in.host" 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 + depends on !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5 + depends on !BR2_MIPS_NABI32 + depends on BR2_TOOLCHAIN_USES_GLIBC + +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 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 + +RUST_TARGET_NAME := $(RUST_ARCH)-unknown-linux-gnu$(RUST_ABI) + +ifeq ($(HOSTARCH),x86) +RUST_HOST_ARCH = i686 +else +RUST_HOST_ARCH = $(HOSTARCH) +endif + +RUST_HOST_NAME = $(RUST_HOST_ARCH)-unknown-linux-gnu + +$(eval $(host-virtual-package)) From patchwork Thu Dec 28 15:51:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Le Bihan X-Patchwork-Id: 853469 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z6vNg2n3qz9s75 for ; Fri, 29 Dec 2017 02:52:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4E61886C82; Thu, 28 Dec 2017 15:52:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HaVQmBc539nF; Thu, 28 Dec 2017 15:51:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 690CA866A4; Thu, 28 Dec 2017 15:51:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 702A01C0A6E for ; Thu, 28 Dec 2017 15:51:57 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6CD6282731 for ; Thu, 28 Dec 2017 15:51:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NSuowwASpYa4 for ; Thu, 28 Dec 2017 15:51:56 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by hemlock.osuosl.org (Postfix) with ESMTPS id EA70F82145 for ; Thu, 28 Dec 2017 15:51:55 +0000 (UTC) Received: from localhost.localdomain (unknown [169.50.62.69]) (Authenticated sender: eric.le.bihan.dev) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 581FB19F4EA for ; Thu, 28 Dec 2017 16:51:52 +0100 (CET) From: Eric Le Bihan To: buildroot@buildroot.org Date: Thu, 28 Dec 2017 16:51:40 +0100 Message-Id: <20171228155146.18193-3-eric.le.bihan.dev@free.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> References: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> Subject: [Buildroot] [PATCH v9 2/8] rust-bin: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This package provides a pre-built version of rustc, the compiler for the Rust programming language, fetched from the upstream project. A pre-built version of the standard library for the host as well as one for the chosen target are also fetched and installed. Only the host variant is provided to allow the user to cross-compile Rust programs and run them on the target. This package could also be used to provide a bootstrap compiler when building Rust from source. So, in order to add it as a build dependency, the compiler and standard libraries are only installed in $(HOST_DIR) if the package is explicitly selected. The menuconfig entry for rustc is also updated to expose this provider. Signed-off-by: Eric Le Bihan --- DEVELOPERS | 1 + package/rust-bin/rust-bin.hash | 30 ++++++++++++++++++++ package/rust-bin/rust-bin.mk | 63 ++++++++++++++++++++++++++++++++++++++++++ package/rustc/Config.in.host | 29 +++++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100644 package/rust-bin/rust-bin.hash create mode 100644 package/rust-bin/rust-bin.mk diff --git a/DEVELOPERS b/DEVELOPERS index 9f4f282203..bf4766886d 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -543,6 +543,7 @@ F: package/execline/ F: package/hicolor-icon-theme/ F: package/jemalloc/ F: package/ninja/ +F: package/rust-bin/ F: package/s6/ F: package/s6-dns/ F: package/s6-linux-init/ diff --git a/package/rust-bin/rust-bin.hash b/package/rust-bin/rust-bin.hash new file mode 100644 index 0000000000..211f9fbbe0 --- /dev/null +++ b/package/rust-bin/rust-bin.hash @@ -0,0 +1,30 @@ +# From https://static.rust-lang.org/dist/rustc-1.22.1-i686-unknown-linux-gnu.tar.xz.sha256 +sha256 d87e15a8f8b3d53270866076824559926d01145733144c4a5905affff3819b47 rustc-1.22.1-i686-unknown-linux-gnu.tar.xz +# From https://static.rust-lang.org/dist/rustc-1.22.1-x86_64-unknown-linux-gnu.tar.xz.sha256 +sha256 9730e46b2301417a5c5e1410f8ab8b8b6979f448b7fffc5e63221bd1bdaa15a3 rustc-1.22.1-x86_64-unknown-linux-gnu.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-aarch64-unknown-linux-gnu.tar.xz.sha256 +sha256 b9c004288c5516dae88e325d24f26c10702dc617268e35b51b4bc83f4f2fc30d rust-std-1.22.1-aarch64-unknown-linux-gnu.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-arm-unknown-linux-gnueabi.tar.xz.sha256 +sha256 d48e918af118cacd2074c1c357cea46f2db73d42510c54fdfdcdf0ff60ba58ec rust-std-1.22.1-arm-unknown-linux-gnueabi.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-arm-unknown-linux-gnueabihf.tar.xz.sha256 +sha256 b64b4047dcdfa4aa617f7606a92320c95cdd44cadadac72d3e7d162addc62c92 rust-std-1.22.1-arm-unknown-linux-gnueabihf.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-armv7-unknown-linux-gnueabihf.tar.xz.sha256 +sha256 e85b649aa18e1903e3c9c899ded55652713017a1e3a35e6fd58a7f40738805be rust-std-1.22.1-armv7-unknown-linux-gnueabihf.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-i686-unknown-linux-gnu.tar.xz.sha256 +sha256 112e17646bc5c513e81396b2c8042a44071a268b0d77810e378bdc9122abedc1 rust-std-1.22.1-i686-unknown-linux-gnu.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-mips-unknown-linux-gnu.tar.xz.sha256 +sha256 80f0bc95273805e1ffe424b004b71a23d6d36acac2999d7361ce3cd3b17f39e9 rust-std-1.22.1-mips-unknown-linux-gnu.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-mips64-unknown-linux-gnuabi64.tar.xz.sha256 +sha256 d50e4b52133b58235ff6f2c9de18d2ca81647fc2ef50aeaf9c1df5d726b3b2a3 rust-std-1.22.1-mips64-unknown-linux-gnuabi64.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-mips64el-unknown-linux-gnuabi64.tar.xz.sha256 +sha256 6f61b30cd54c24fcdffddb67eb4073b2199dbea487c7be2c9ab6dd4bab46dabf rust-std-1.22.1-mips64el-unknown-linux-gnuabi64.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-mipsel-unknown-linux-gnu.tar.xz.sha256 +sha256 01278fa6596d8193bff76ddaacb78c339d610c5dbe035a38f7d0d9ebcf2bcce7 rust-std-1.22.1-mipsel-unknown-linux-gnu.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-powerpc-unknown-linux-gnu.tar.xz.sha256 +sha256 39b26eaa3006aea11539d63bffdeada7078d79a4a06916cc8e6f6d66434e0a91 rust-std-1.22.1-powerpc-unknown-linux-gnu.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-powerpc64-unknown-linux-gnu.tar.xz.sha256 +sha256 dcaf8f636ad4290bc761566d5fac77f4d6757046fe0ee539417fc6543246877b rust-std-1.22.1-powerpc64-unknown-linux-gnu.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-powerpc64le-unknown-linux-gnu.tar.xz.sha256 +sha256 9f5f047c8817b9c9bb45465fdccf55be9a551ebae5859100fdfa2c429f9d0574 rust-std-1.22.1-powerpc64le-unknown-linux-gnu.tar.xz +# From https://static.rust-lang.org/dist/rust-std-1.22.1-x86_64-unknown-linux-gnu.tar.xz.sha256 +sha256 edd3313eb6523b2c08c84fc9cd7a80e4fb14c32168639d1833fd1b46e088a9a1 rust-std-1.22.1-x86_64-unknown-linux-gnu.tar.xz diff --git a/package/rust-bin/rust-bin.mk b/package/rust-bin/rust-bin.mk new file mode 100644 index 0000000000..29f94b7f2d --- /dev/null +++ b/package/rust-bin/rust-bin.mk @@ -0,0 +1,63 @@ +################################################################################ +# +# rust-bin +# +################################################################################ + +RUST_BIN_VERSION = 1.22.1 +RUST_BIN_SITE = https://static.rust-lang.org/dist +RUST_BIN_LICENSE = Apache-2.0 or MIT +RUST_BIN_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT + +HOST_RUST_BIN_PROVIDES = host-rustc + +HOST_RUST_BIN_SOURCE = rustc-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME).tar.xz +HOST_RUST_BIN_LIBSTD_SOURCES = \ + rust-std-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME).tar.xz \ + rust-std-$(RUST_BIN_VERSION)-$(RUST_TARGET_NAME).tar.xz + +HOST_RUST_BIN_EXTRA_DOWNLOADS = $(HOST_RUST_BIN_LIBSTD_SOURCES) + +HOST_RUST_BIN_LIBSTD_HOST_PREFIX = rust-std-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME)/rust-std-$(RUST_HOST_NAME) + +define HOST_RUST_BIN_LIBSTD_EXTRACT + mkdir -p $(@D)/std + for file in $(addprefix $(DL_DIR)/,$(HOST_RUST_BIN_LIBSTD_SOURCES)); do \ + $(TAR) -C $(@D)/std -xJf $${file}; \ + done + (\ + cd $(@D)/rustc/lib/rustlib; \ + ln -sf ../../../std/$(HOST_RUST_BIN_LIBSTD_HOST_PREFIX)/lib/rustlib/$(RUST_HOST_NAME) \ + ) +endef + +HOST_RUST_BIN_POST_EXTRACT_HOOKS += HOST_RUST_BIN_LIBSTD_EXTRACT + +HOST_RUST_BIN_INSTALL_OPTS = \ + --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)) +endef + +define HOST_RUST_BIN_INSTALL_LIBSTD_HOST + (cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUST_HOST_NAME); \ + ./install.sh $(HOST_RUST_BIN_INSTALL_OPTS)) +endef + +define HOST_RUST_BIN_INSTALL_LIBSTD_TARGET + (cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUST_TARGET_NAME); \ + ./install.sh $(HOST_RUST_BIN_INSTALL_OPTS)) +endef +endif + +define HOST_RUST_BIN_INSTALL_CMDS + $(HOST_RUST_BIN_INSTALL_RUSTC) + $(HOST_RUST_BIN_INSTALL_LIBSTD_HOST) + $(HOST_RUST_BIN_INSTALL_LIBSTD_TARGET) +endef + +$(eval $(host-generic-package)) diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host index 16c95fa0b4..e42187d477 100644 --- a/package/rustc/Config.in.host +++ b/package/rustc/Config.in.host @@ -10,8 +10,37 @@ config BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS depends on !BR2_MIPS_NABI32 depends on BR2_TOOLCHAIN_USES_GLIBC +config BR2_PACKAGE_HOST_RUSTC + bool "host rustc" + depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS + help + Compiler for the Rust language + + http://www.rust-lang.org + +if BR2_PACKAGE_HOST_RUSTC + +choice + prompt "Rust compiler variant" + default BR2_PACKAGE_HOST_RUST_BIN + help + Select a Rust compiler + +config BR2_PACKAGE_HOST_RUST_BIN + bool "host rust (pre-built)" + select BR2_PACKAGE_HAS_HOST_RUSTC + help + This package will install pre-built versions of the compiler + for the host and the Rust standard library for the target. + +endchoice + config BR2_PACKAGE_HAS_HOST_RUSTC bool config BR2_PACKAGE_PROVIDES_HOST_RUSTC string + default "host-rust-bin" if BR2_PACKAGE_HOST_RUST_BIN + +endif + From patchwork Thu Dec 28 15:51:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Le Bihan X-Patchwork-Id: 853471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z6vNl3pJ0z9s4s for ; Fri, 29 Dec 2017 02:52:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D645986E71; Thu, 28 Dec 2017 15:52:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IJbtQz3FbdEy; Thu, 28 Dec 2017 15:52:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 55EBF86E19; Thu, 28 Dec 2017 15:52:03 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id AE10E1C0A6E for ; Thu, 28 Dec 2017 15:51:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AB13D872A5 for ; Thu, 28 Dec 2017 15:51:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9y7b-1ECg-Oi for ; Thu, 28 Dec 2017 15:51:58 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by hemlock.osuosl.org (Postfix) with ESMTPS id 5BDE382731 for ; Thu, 28 Dec 2017 15:51:58 +0000 (UTC) Received: from localhost.localdomain (unknown [169.50.62.69]) (Authenticated sender: eric.le.bihan.dev) by smtp4-g21.free.fr (Postfix) with ESMTPSA id BCD6819F54D for ; Thu, 28 Dec 2017 16:51:54 +0100 (CET) From: Eric Le Bihan To: buildroot@buildroot.org Date: Thu, 28 Dec 2017 16:51:41 +0100 Message-Id: <20171228155146.18193-4-eric.le.bihan.dev@free.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> References: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> Subject: [Buildroot] [PATCH v9 3/8] cargo-bin: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This new package fetches a binary version of Cargo, suitable to bootstrap the host variants of the Rust compiler and Cargo, the package manager. Signed-off-by: Eric Le Bihan --- DEVELOPERS | 1 + package/cargo-bin/cargo-bin.hash | 4 ++++ package/cargo-bin/cargo-bin.mk | 14 ++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 package/cargo-bin/cargo-bin.hash create mode 100644 package/cargo-bin/cargo-bin.mk diff --git a/DEVELOPERS b/DEVELOPERS index bf4766886d..0374e45eda 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -537,6 +537,7 @@ F: package/xxhash/ N: Eric Le Bihan F: package/adwaita-icon-theme/ +F: package/cargo-bin/ F: package/darkhttpd/ F: package/eudev/ F: package/execline/ diff --git a/package/cargo-bin/cargo-bin.hash b/package/cargo-bin/cargo-bin.hash new file mode 100644 index 0000000000..70fb101be7 --- /dev/null +++ b/package/cargo-bin/cargo-bin.hash @@ -0,0 +1,4 @@ +# From https://static.rust-lang.org/dist/cargo-0.23.0-i686-unknown-linux-gnu.tar.gz.sha256 +sha256 7ebe231e5da2a06370f17050285ee694cf09ac2010d87dab334ae7eb7fb2d975 cargo-0.23.0-i686-unknown-linux-gnu.tar.gz +# From https://static.rust-lang.org/dist/cargo-0.23.0-x86_64-unknown-linux-gnu.tar.xz.sha256 +sha256 4f33d9e511cfcbb370f470d3813e4877da10761d5f75460e538503fa07fa64f8 cargo-0.23.0-x86_64-unknown-linux-gnu.tar.xz diff --git a/package/cargo-bin/cargo-bin.mk b/package/cargo-bin/cargo-bin.mk new file mode 100644 index 0000000000..e0f6381070 --- /dev/null +++ b/package/cargo-bin/cargo-bin.mk @@ -0,0 +1,14 @@ +################################################################################ +# +# cargo-bin +# +################################################################################ + +CARGO_BIN_VERSION = 0.23.0 +CARGO_BIN_SITE = https://static.rust-lang.org/dist +CARGO_BIN_SOURCE = cargo-$(CARGO_BIN_VERSION)-$(RUST_HOST_NAME).tar.xz +CARGO_BIN_LICENSE = Apache-2.0 or MIT +CARGO_BIN_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT +CARGO_BIN_STRIP_COMPONENTS = 1 + +$(eval $(host-generic-package)) From patchwork Thu Dec 28 15:51:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Le Bihan X-Patchwork-Id: 853472 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z6vNn4wzPz9s4s for ; Fri, 29 Dec 2017 02:52:09 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A00CB8477C; Thu, 28 Dec 2017 15:52:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n5H81xt1JurU; Thu, 28 Dec 2017 15:52:05 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2D84883584; Thu, 28 Dec 2017 15:52:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 64AF71C0A6E for ; Thu, 28 Dec 2017 15:52:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5C971830B3 for ; Thu, 28 Dec 2017 15:52:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IIt30imZ3EA0 for ; Thu, 28 Dec 2017 15:52:01 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by whitealder.osuosl.org (Postfix) with ESMTPS id 882A684176 for ; Thu, 28 Dec 2017 15:52:01 +0000 (UTC) Received: from localhost.localdomain (unknown [169.50.62.69]) (Authenticated sender: eric.le.bihan.dev) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 2CD8D19F5D3 for ; Thu, 28 Dec 2017 16:51:57 +0100 (CET) From: Eric Le Bihan To: buildroot@buildroot.org Date: Thu, 28 Dec 2017 16:51:42 +0100 Message-Id: <20171228155146.18193-5-eric.le.bihan.dev@free.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> References: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> Subject: [Buildroot] [PATCH v9 4/8] rust: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This new package provides rustc, the compiler for the Rust programming language, built from source. Currently, only the host variant is built. The Rust compiler uses LLVM as its backend: a copy of LLVM source code is provided and CMake is used to build it. It is possible to use a pre-built external copy. When LLVM/clang will be available in Buildroot, it would be possible to benefit from this feature and thus decrease build time. LLVM is configured to generate code for x86, ARM, PowerPC and MIPS architectures. The Rust compiler uses Cargo as its build system and is written in Rust. Therefore this package depends on cargo-bin and rust-bin. The internal build process is as follows: 1. rustc-stage0, provided by rust-bin, is used to build rustc-stage1. 2. rust-stage1 builds the final Rust compiler (rust-stage2) and the standard library for the host architecture. 3. the standard library for the target architecture is built. The target architecture to support is given by the GNU/LLVM target triple. Rust supports some predefined targets [1]. As the build system expects the triple to be in the form of -unknown- and Buildroot toolchain wrapper uses -buildroot-, the package Makefile uses $(RUST_TARGET_NAME) defined in the rustc package and uses it instead of $(GNU_TARGET_NAME). When compiling Rust code with this compiler, the generated program only depends on the target C library, as it is statically linked to the Rust standard library and any other code from Rust packages (a.k.a. "crates"). If the jemalloc package is selected, support for this memory allocator will be enabled in the target standard library. The menuconfig entry for rustc is also updated to expose this provider. [1] https://forge.rust-lang.org/platform-support.html Signed-off-by: Eric Le Bihan --- DEVELOPERS | 1 + package/rust/rust.hash | 2 ++ package/rust/rust.mk | 82 ++++++++++++++++++++++++++++++++++++++++++++ package/rustc/Config.in.host | 16 +++++++++ 4 files changed, 101 insertions(+) create mode 100644 package/rust/rust.hash create mode 100644 package/rust/rust.mk diff --git a/DEVELOPERS b/DEVELOPERS index 0374e45eda..1c16ec9598 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -545,6 +545,7 @@ F: package/hicolor-icon-theme/ F: package/jemalloc/ F: package/ninja/ F: package/rust-bin/ +F: package/rust/ F: package/s6/ F: package/s6-dns/ F: package/s6-linux-init/ diff --git a/package/rust/rust.hash b/package/rust/rust.hash new file mode 100644 index 0000000000..51aa9e3361 --- /dev/null +++ b/package/rust/rust.hash @@ -0,0 +1,2 @@ +# From https://static.rust-lang.org/dist/rustc-1.22.1-src.tar.xz.sha256 +sha256 80ee9ecc1e03ee63ea13c2612b61fc04fce9240476836f70c553ebaebd58fed6 rustc-1.22.1-src.tar.xz diff --git a/package/rust/rust.mk b/package/rust/rust.mk new file mode 100644 index 0000000000..8dbec99bc5 --- /dev/null +++ b/package/rust/rust.mk @@ -0,0 +1,82 @@ +################################################################################ +# +# rust +# +################################################################################ + +RUST_VERSION = 1.22.1 +RUST_SOURCE = rustc-$(RUST_VERSION)-src.tar.xz +RUST_SITE = https://static.rust-lang.org/dist +RUST_LICENSE = Apache-2.0 or MIT +RUST_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT + +HOST_RUST_PROVIDES = host-rustc + +HOST_RUST_DEPENDENCIES = \ + toolchain \ + host-rust-bin \ + host-cargo-bin \ + host-python \ + host-cmake + +ifeq ($(BR2_PACKAGE_JEMALLOC),y) +HOST_RUST_DEPENDENCIES += jemalloc +HOST_RUST_JEMALLOC_ENABLED = true +HOST_RUST_JEMALLOC_CONF = 'jemalloc = "$(STAGING_DIR)/usr/lib/libjemalloc_pic.a"' +else +HOST_RUST_JEMALLOC_ENABLED = false +endif + +HOST_RUST_VERBOSITY = $(if $(VERBOSE),2,0) + +# Some vendored crates contain Cargo.toml.orig files. The associated +# .cargo-checksum.json file will contain a checksum for Cargo.toml.orig but +# support/scripts/apply-patches.sh will delete them. This will cause the build +# to fail, as Cargo will not be able to find the file and verify the checksum. +# So, remove all Cargo.toml.orig entries from the affected .cargo-checksum.json +# files +define HOST_RUST_EXCLUDE_ORIG_FILES + for file in $$(find $(@D) -name '*.orig'); do \ + crate=$$(dirname $${file}); \ + fn=$${crate}/.cargo-checksum.json; \ + sed -i -e 's/"Cargo.toml.orig":"[a-z0-9]\+",//g' $${fn}; \ + done +endef + +HOST_RUST_POST_EXTRACT_HOOKS += HOST_RUST_EXCLUDE_ORIG_FILES + +define HOST_RUST_CONFIGURE_CMDS + ( \ + echo '[build]'; \ + echo 'target = ["$(RUST_TARGET_NAME)"]'; \ + echo 'cargo = "$(HOST_CARGO_BIN_DIR)/cargo/bin/cargo"'; \ + echo 'rustc = "$(HOST_RUST_BIN_DIR)/rustc/bin/rustc"'; \ + echo 'python = "$(HOST_DIR)/bin/python2"'; \ + echo 'submodules = false'; \ + echo 'vendor = true'; \ + echo 'compiler-docs = false'; \ + echo 'docs = false'; \ + echo 'verbose = $(HOST_RUST_VERBOSITY)'; \ + echo '[install]'; \ + echo 'prefix = "$(HOST_DIR)"'; \ + echo '[rust]'; \ + echo 'use-jemalloc = $(HOST_RUST_JEMALLOC_ENABLED)'; \ + echo '[target.$(RUST_TARGET_NAME)]'; \ + echo 'cc = "$(TARGET_CROSS)gcc"'; \ + echo $(HOST_RUST_JEMALLOC_CONF); \ + ) > $(@D)/config.toml +endef + +define HOST_RUST_BUILD_CMDS + (cd $(@D); $(HOST_MAKE_ENV) $(HOST_DIR)/bin/python2 x.py \ + build $(HOST_RUST_BUILD_OPTS)) +endef + +define HOST_RUST_INSTALL_CMDS + (cd $(@D); $(HOST_MAKE_ENV) $(HOST_DIR)/bin/python2 x.py \ + dist $(HOST_RUST_BUILD_OPTS)) + (cd $(@D); $(HOST_MAKE_ENV) $(HOST_DIR)/bin/python2 x.py \ + install $(HOST_RUST_BUILD_OPTS)) +endef + +$(eval $(host-generic-package)) diff --git a/package/rustc/Config.in.host b/package/rustc/Config.in.host index e42187d477..3a03140bcd 100644 --- a/package/rustc/Config.in.host +++ b/package/rustc/Config.in.host @@ -26,6 +26,21 @@ choice help Select a Rust compiler +config BR2_PACKAGE_HOST_RUST + bool "host rust" + depends on BR2_HOST_GCC_AT_LEAST_4_7 # required by LLVM + # triggers ICE on trunc_int_for_mode, at explow.c:56 + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 || !BR2_aarch64 + select BR2_PACKAGE_HAS_HOST_RUSTC + help + This package will build the compiler for the host as well as + two flavors of the standard library: one for the host, another + for the target. Both are installed in the host directory. + +comment "host-rust needs a toolchain w/ gcc >= 5" + depends on BR2_aarch64 + depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_5 + config BR2_PACKAGE_HOST_RUST_BIN bool "host rust (pre-built)" select BR2_PACKAGE_HAS_HOST_RUSTC @@ -40,6 +55,7 @@ config BR2_PACKAGE_HAS_HOST_RUSTC 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 From patchwork Thu Dec 28 15:51:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Le Bihan X-Patchwork-Id: 853473 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z6vNp4knnz9s7G for ; Fri, 29 Dec 2017 02:52:10 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 1815A86E4C; Thu, 28 Dec 2017 15:52:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SM_phe1eLc_e; Thu, 28 Dec 2017 15:52:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8785186E66; Thu, 28 Dec 2017 15:52:06 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id B6CAF1C0A6E for ; Thu, 28 Dec 2017 15:52:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B3EEC82731 for ; Thu, 28 Dec 2017 15:52:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1-sar1Wmi+aB for ; Thu, 28 Dec 2017 15:52:03 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by hemlock.osuosl.org (Postfix) with ESMTPS id 188F08242E for ; Thu, 28 Dec 2017 15:52:03 +0000 (UTC) Received: from localhost.localdomain (unknown [169.50.62.69]) (Authenticated sender: eric.le.bihan.dev) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 8EADF19F5CA for ; Thu, 28 Dec 2017 16:51:59 +0100 (CET) From: Eric Le Bihan To: buildroot@buildroot.org Date: Thu, 28 Dec 2017 16:51:43 +0100 Message-Id: <20171228155146.18193-6-eric.le.bihan.dev@free.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> References: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> Subject: [Buildroot] [PATCH v9 5/8] libssh2: add host variant X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Allow build of host variant of libssh2, which depends on host-openssl. Signed-off-by: Eric Le Bihan Reviewed-by: Thomas Petazzoni --- package/libssh2/libssh2.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/libssh2/libssh2.mk b/package/libssh2/libssh2.mk index 18e772c722..c5b0bd855e 100644 --- a/package/libssh2/libssh2.mk +++ b/package/libssh2/libssh2.mk @@ -40,4 +40,10 @@ else LIBSSH2_CONF_OPTS += --without-libz endif +HOST_LIBSSH2_DEPENDENCIES += host-openssl +HOST_LIBSSH2_CONF_OPTS += --with-openssl \ + --with-libssl-prefix=$(HOST_DIR)/usr \ + --without-libgcrypt + $(eval $(autotools-package)) +$(eval $(host-autotools-package)) From patchwork Thu Dec 28 15:51:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Le Bihan X-Patchwork-Id: 853474 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z6vNw6JQHz9s75 for ; Fri, 29 Dec 2017 02:52:16 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 359BC86E10; Thu, 28 Dec 2017 15:52:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bzy3MPNIeSlg; Thu, 28 Dec 2017 15:52:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 538F386E81; Thu, 28 Dec 2017 15:52:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 02DA71C0A6E for ; Thu, 28 Dec 2017 15:52:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id F26AA2675C for ; Thu, 28 Dec 2017 15:52:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XbkSHywbAKIW for ; Thu, 28 Dec 2017 15:52:05 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by silver.osuosl.org (Postfix) with ESMTPS id 808E626730 for ; Thu, 28 Dec 2017 15:52:05 +0000 (UTC) Received: from localhost.localdomain (unknown [169.50.62.69]) (Authenticated sender: eric.le.bihan.dev) by smtp4-g21.free.fr (Postfix) with ESMTPSA id DEBCD19F54D for ; Thu, 28 Dec 2017 16:52:01 +0100 (CET) From: Eric Le Bihan To: buildroot@buildroot.org Date: Thu, 28 Dec 2017 16:51:44 +0100 Message-Id: <20171228155146.18193-7-eric.le.bihan.dev@free.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> References: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> Subject: [Buildroot] [PATCH v9 6/8] libhttpparser: add host variant X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Allow build of host variant of libhttpparser. Signed-off-by: Eric Le Bihan Reviewed-by: Thomas Petazzoni --- package/libhttpparser/libhttpparser.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/libhttpparser/libhttpparser.mk b/package/libhttpparser/libhttpparser.mk index 8ff0413322..1df26017e7 100644 --- a/package/libhttpparser/libhttpparser.mk +++ b/package/libhttpparser/libhttpparser.mk @@ -23,4 +23,13 @@ define LIBHTTPPARSER_INSTALL_TARGET_CMDS $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) PREFIX=$(TARGET_DIR)/usr install endef +define HOST_LIBHTTPPARSER_BUILD_CMDS + $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) library package +endef + +define HOST_LIBHTTPPARSER_INSTALL_CMDS + $(MAKE) $(HOST_CONFIGURE_OPTS) -C $(@D) PREFIX=$(HOST_DIR)/usr install +endef + $(eval $(generic-package)) +$(eval $(host-generic-package)) From patchwork Thu Dec 28 15:51:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Le Bihan X-Patchwork-Id: 853476 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z6vNx75Lwz9s75 for ; Fri, 29 Dec 2017 02:52:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E869F82FFB; Thu, 28 Dec 2017 15:52:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sc7MeegZxqnz; Thu, 28 Dec 2017 15:52:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 228DB84485; Thu, 28 Dec 2017 15:52:11 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 576581C0A6E for ; Thu, 28 Dec 2017 15:52:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 545C12675C for ; Thu, 28 Dec 2017 15:52:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WF24-7+uaRE9 for ; Thu, 28 Dec 2017 15:52:08 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by silver.osuosl.org (Postfix) with ESMTPS id D58EC26730 for ; Thu, 28 Dec 2017 15:52:07 +0000 (UTC) Received: from localhost.localdomain (unknown [169.50.62.69]) (Authenticated sender: eric.le.bihan.dev) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 53A0019F54D for ; Thu, 28 Dec 2017 16:52:04 +0100 (CET) From: Eric Le Bihan To: buildroot@buildroot.org Date: Thu, 28 Dec 2017 16:51:45 +0100 Message-Id: <20171228155146.18193-8-eric.le.bihan.dev@free.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> References: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> Subject: [Buildroot] [PATCH v9 7/8] libcurl: add host variant X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Eric Le Bihan Reviewed-by: Thomas Petazzoni --- package/libcurl/libcurl.mk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/package/libcurl/libcurl.mk b/package/libcurl/libcurl.mk index 0aab58a7de..ea5c99cf70 100644 --- a/package/libcurl/libcurl.mk +++ b/package/libcurl/libcurl.mk @@ -88,4 +88,18 @@ endef LIBCURL_POST_INSTALL_TARGET_HOOKS += LIBCURL_TARGET_CLEANUP endif +HOST_LIBCURL_DEPENDENCIES = host-openssl +HOST_LIBCURL_CONF_OPTS = \ + --disable-manual \ + --disable-ntlm-wb \ + --disable-curldebug \ + --with-ssl \ + --without-gnutls \ + --without-mbedtls \ + --without-polarssl \ + --without-nss + +HOST_LIBCURL_POST_PATCH_HOOKS += LIBCURL_FIX_DOT_PC + $(eval $(autotools-package)) +$(eval $(host-autotools-package)) From patchwork Thu Dec 28 15:51:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Le Bihan X-Patchwork-Id: 853477 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3z6vP06jQ6z9s4s for ; Fri, 29 Dec 2017 02:52:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A996681485; Thu, 28 Dec 2017 15:52:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id caWo+jXpnI-F; Thu, 28 Dec 2017 15:52:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 8B2CB8329B; Thu, 28 Dec 2017 15:52:16 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id B60001C0A6E for ; Thu, 28 Dec 2017 15:52:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B09E98329B for ; Thu, 28 Dec 2017 15:52:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fAluUG-O5QCo for ; Thu, 28 Dec 2017 15:52:10 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [212.27.42.4]) by whitealder.osuosl.org (Postfix) with ESMTPS id 4E6FE81485 for ; Thu, 28 Dec 2017 15:52:10 +0000 (UTC) Received: from localhost.localdomain (unknown [169.50.62.69]) (Authenticated sender: eric.le.bihan.dev) by smtp4-g21.free.fr (Postfix) with ESMTPSA id A31C719F4F8 for ; Thu, 28 Dec 2017 16:52:06 +0100 (CET) From: Eric Le Bihan To: buildroot@buildroot.org Date: Thu, 28 Dec 2017 16:51:46 +0100 Message-Id: <20171228155146.18193-9-eric.le.bihan.dev@free.fr> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> References: <20171228155146.18193-1-eric.le.bihan.dev@free.fr> Subject: [Buildroot] [PATCH v9 8/8] cargo: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This new package provides Cargo, the Rust official package manager. Cargo is written in Rust and uses Cargo as its build system. It also depends on other Rust packages. Normally, a previously installed version of Cargo would be used to: 1. Fetch the dependencies. 2. Build the new version of Cargo, using the available Rust compiler. But the fetching step prevents offline builds. So instead two features of Cargo are levelled: vendoring [1] and local registry. First, a tarball of the build dependencies generated using `cargo vendor` is fetched along with Cargo source code. Then, the build process is as follows: 1. The tarball of the build dependencies is uncompressed in a local registry. 2. A snapshot of Cargo, provided by cargo-bin, builds the final version of Cargo. 3. A configuration file telling Cargo how to cross-compile programs for the target is generated and installed. Currently, only the host variant is provided. [1] https://github.com/alexcrichton/cargo-vendor Signed-off-by: Eric Le Bihan --- DEVELOPERS | 1 + package/Config.in.host | 1 + package/cargo/Config.in.host | 8 ++++ package/cargo/cargo.hash | 4 ++ package/cargo/cargo.mk | 96 ++++++++++++++++++++++++++++++++++++++++++++ package/cargo/config.in | 2 + 6 files changed, 112 insertions(+) create mode 100644 package/cargo/Config.in.host create mode 100644 package/cargo/cargo.hash create mode 100644 package/cargo/cargo.mk create mode 100644 package/cargo/config.in diff --git a/DEVELOPERS b/DEVELOPERS index 1c16ec9598..0902fd2fd4 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -538,6 +538,7 @@ F: package/xxhash/ N: Eric Le Bihan F: package/adwaita-icon-theme/ F: package/cargo-bin/ +F: package/cargo/ F: package/darkhttpd/ F: package/eudev/ F: package/execline/ diff --git a/package/Config.in.host b/package/Config.in.host index 2f20dd0e48..199a8e9856 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -2,6 +2,7 @@ menu "Host utilities" source "package/aespipe/Config.in.host" source "package/android-tools/Config.in.host" + source "package/cargo/Config.in.host" source "package/cbootimage/Config.in.host" source "package/checkpolicy/Config.in.host" source "package/cmake/Config.in.host" diff --git a/package/cargo/Config.in.host b/package/cargo/Config.in.host new file mode 100644 index 0000000000..0f1ca305c6 --- /dev/null +++ b/package/cargo/Config.in.host @@ -0,0 +1,8 @@ +config BR2_PACKAGE_HOST_CARGO + bool "host cargo" + depends on BR2_PACKAGE_HAS_HOST_RUSTC + help + Cargo is the package manager for the Rust programming + language. + + https://crates.io/ diff --git a/package/cargo/cargo.hash b/package/cargo/cargo.hash new file mode 100644 index 0000000000..2b2ae43f6b --- /dev/null +++ b/package/cargo/cargo.hash @@ -0,0 +1,4 @@ +# Locally generated +sha256 f4bbe2a8719dbb8da20842235093f7f70f034d01633189e83f75897d68cd274f cargo-0.23.0.tar.gz +sha512 9060ec6e67b54f7fad7da8dd8450dd051d62b3f8ed4606196fc238a98beba1c3b43087c787f35d012d9b641c8572e70f50b95b0e01fdd75ed82932b6e6efbbf0 cargo-0.23.0-vendor.tar.xz +sha256 dc7240d60a869fa24a68c8734fb7c810c27cca0a6dad52df6279865e4e8e7fae rust-installer-4f994850808a572e2cc8d43f968893c8e942e9bf.tar.gz diff --git a/package/cargo/cargo.mk b/package/cargo/cargo.mk new file mode 100644 index 0000000000..3794f450c1 --- /dev/null +++ b/package/cargo/cargo.mk @@ -0,0 +1,96 @@ +################################################################################ +# +# cargo +# +################################################################################ + +CARGO_VERSION = 0.23.0 +CARGO_SITE = $(call github,rust-lang,cargo,$(CARGO_VERSION)) +CARGO_LICENSE = Apache-2.0 or MIT +CARGO_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT + +CARGO_DEPS_SHA512 = 9060ec6e67b54f7fad7da8dd8450dd051d62b3f8ed4606196fc238a98beba1c3b43087c787f35d012d9b641c8572e70f50b95b0e01fdd75ed82932b6e6efbbf0 +CARGO_DEPS_SITE = http://pkgs.fedoraproject.org/repo/pkgs/cargo/$(CARGO_DEPS_SOURCE)/sha512/$(CARGO_DEPS_SHA512) +CARGO_DEPS_SOURCE = cargo-$(CARGO_VERSION)-vendor.tar.xz + +CARGO_INSTALLER_VERSION = 4f994850808a572e2cc8d43f968893c8e942e9bf +CARGO_INSTALLER_SITE = $(call github,rust-lang,rust-installer,$(CARGO_INSTALLER_VERSION)) +CARGO_INSTALLER_SOURCE = rust-installer-$(CARGO_INSTALLER_VERSION).tar.gz + +HOST_CARGO_EXTRA_DOWNLOADS = \ + $(CARGO_DEPS_SITE)/$(CARGO_DEPS_SOURCE) \ + $(CARGO_INSTALLER_SITE)/$(CARGO_INSTALLER_SOURCE) + +HOST_CARGO_DEPENDENCIES = \ + host-cmake \ + host-pkgconf \ + host-openssl \ + host-libhttpparser \ + host-libssh2 \ + host-libcurl \ + host-rustc \ + host-cargo-bin + +HOST_CARGO_SNAP_BIN = $(HOST_CARGO_BIN_DIR)/cargo/bin/cargo +HOST_CARGO_HOME = $(HOST_DIR)/share/cargo + +define HOST_CARGO_EXTRACT_DEPS + @mkdir -p $(@D)/vendor + $(call suitable-extractor,$(CARGO_DEPS_SOURCE)) \ + $(DL_DIR)/$(CARGO_DEPS_SOURCE) | \ + $(TAR) --strip-components=1 -C $(@D)/vendor $(TAR_OPTIONS) - +endef + +HOST_CARGO_POST_EXTRACT_HOOKS += HOST_CARGO_EXTRACT_DEPS + +define HOST_CARGO_EXTRACT_INSTALLER + @mkdir -p $(@D)/src/rust-installer + $(call suitable-extractor,$(CARGO_INSTALLER_SOURCE)) \ + $(DL_DIR)/$(CARGO_INSTALLER_SOURCE) | \ + $(TAR) --strip-components=1 -C $(@D)/src/rust-installer $(TAR_OPTIONS) - +endef + +HOST_CARGO_POST_EXTRACT_HOOKS += HOST_CARGO_EXTRACT_INSTALLER + +define HOST_CARGO_SETUP_DEPS + mkdir -p $(@D)/.cargo + ( \ + echo "[source.crates-io]"; \ + echo "registry = 'https://github.com/rust-lang/crates.io-index'"; \ + echo "replace-with = 'vendored-sources'"; \ + echo "[source.vendored-sources]"; \ + echo "directory = '$(@D)/vendor'"; \ + ) > $(@D)/.cargo/config +endef + +HOST_CARGO_PRE_CONFIGURE_HOOKS += HOST_CARGO_SETUP_DEPS + +HOST_CARGO_SNAP_OPTS = --release +HOST_CARGO_SNAP_OPTS += $(if $(VERBOSE),--verbose) + +HOST_CARGO_ENV = \ + RUSTFLAGS="-Clink-arg=-Wl,-rpath,$(HOST_DIR)/lib" \ + CARGO_HOME=$(HOST_DIR)/share/cargo + +define HOST_CARGO_BUILD_CMDS + (cd $(@D); $(HOST_MAKE_ENV) $(HOST_CARGO_ENV) $(HOST_CARGO_SNAP_BIN) \ + build $(HOST_CARGO_SNAP_OPTS)) +endef + +define HOST_CARGO_INSTALL_CMDS + $(INSTALL) -d -m 0755 $(HOST_DIR)/bin + $(INSTALL) -m 0755 $(@D)/target/release/cargo $(HOST_DIR)/bin/cargo +endef + +define HOST_CARGO_INSTALL_CONF_FILE + $(INSTALL) -D package/cargo/config.in \ + $(HOST_DIR)/share/cargo/config + $(SED) 's/@RUST_TARGET_NAME@/$(RUST_TARGET_NAME)/' \ + $(HOST_DIR)/share/cargo/config + $(SED) 's/@CROSS_PREFIX@/$(notdir $(TARGET_CROSS))/' \ + $(HOST_DIR)/share/cargo/config +endef + +HOST_CARGO_POST_INSTALL_HOOKS += HOST_CARGO_INSTALL_CONF_FILE + +$(eval $(host-generic-package)) diff --git a/package/cargo/config.in b/package/cargo/config.in new file mode 100644 index 0000000000..cc048c71c4 --- /dev/null +++ b/package/cargo/config.in @@ -0,0 +1,2 @@ +[target.@RUST_TARGET_NAME@] +linker = "@CROSS_PREFIX@gcc"