* [Buildroot] [PATCH 0/2] Add support for Rust programming language
@ 2016-04-24 14:39 Eric Le Bihan
2016-04-24 14:39 ` [Buildroot] [PATCH 1/2] python: enable bzip2 in host variant Eric Le Bihan
2016-04-24 14:39 ` [Buildroot] [PATCH 2/2] rust: new package Eric Le Bihan
0 siblings, 2 replies; 10+ messages in thread
From: Eric Le Bihan @ 2016-04-24 14:39 UTC (permalink / raw)
To: buildroot
This series adds support for the Rust programming language by providing a
package for the host variant of the Rust compiler, able to cross-compile code
for ARM, MIPS and x86_64 architectures.
Best regards,
ELB
Eric Le Bihan (2):
python: enable bzip2 in host variant
rust: new package
package/Config.in.host | 1 +
package/python/python.mk | 3 +-
...monize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch | 53 ++++
.../0002-Expand-CC-to-gcc-in-x86-mk-cfg-.cfg.patch | 71 +++++
...eclaration-in-mipsel-unknown-linux-gnu.mk.patch | 26 ++
package/rust/Config.in.host | 24 ++
package/rust/rust-target-gen | 314 +++++++++++++++++++++
package/rust/rust.hash | 5 +
package/rust/rust.mk | 90 ++++++
9 files changed, 585 insertions(+), 2 deletions(-)
create mode 100644 package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch
create mode 100644 package/rust/0002-Expand-CC-to-gcc-in-x86-mk-cfg-.cfg.patch
create mode 100644 package/rust/0003-Fix-CPP-declaration-in-mipsel-unknown-linux-gnu.mk.patch
create mode 100644 package/rust/Config.in.host
create mode 100755 package/rust/rust-target-gen
create mode 100644 package/rust/rust.hash
create mode 100644 package/rust/rust.mk
--
2.4.11
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 1/2] python: enable bzip2 in host variant
2016-04-24 14:39 [Buildroot] [PATCH 0/2] Add support for Rust programming language Eric Le Bihan
@ 2016-04-24 14:39 ` Eric Le Bihan
2016-06-15 22:01 ` Thomas Petazzoni
2016-04-24 14:39 ` [Buildroot] [PATCH 2/2] rust: new package Eric Le Bihan
1 sibling, 1 reply; 10+ messages in thread
From: Eric Le Bihan @ 2016-04-24 14:39 UTC (permalink / raw)
To: buildroot
Enable support for bzip2 in Python host variant, so the tarfile module
works properly.
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
package/python/python.mk | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/package/python/python.mk b/package/python/python.mk
index 4ecd0d1..09356c5 100644
--- a/package/python/python.mk
+++ b/package/python/python.mk
@@ -31,7 +31,6 @@ HOST_PYTHON_CONF_OPTS += \
--disable-gdbm \
--disable-bsddb \
--disable-test-modules \
- --disable-bz2 \
--disable-ssl \
--disable-ossaudiodev \
--disable-pyo-build
@@ -52,7 +51,7 @@ HOST_PYTHON_MAKE = $(MAKE1)
PYTHON_DEPENDENCIES = host-python libffi
-HOST_PYTHON_DEPENDENCIES = host-expat host-zlib
+HOST_PYTHON_DEPENDENCIES = host-expat host-zlib host-bzip2
PYTHON_INSTALL_STAGING = YES
--
2.4.11
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 2/2] rust: new package
2016-04-24 14:39 [Buildroot] [PATCH 0/2] Add support for Rust programming language Eric Le Bihan
2016-04-24 14:39 ` [Buildroot] [PATCH 1/2] python: enable bzip2 in host variant Eric Le Bihan
@ 2016-04-24 14:39 ` Eric Le Bihan
2016-06-15 22:09 ` Thomas Petazzoni
1 sibling, 1 reply; 10+ messages in thread
From: Eric Le Bihan @ 2016-04-24 14:39 UTC (permalink / raw)
To: buildroot
This new package provides the compiler for the Rust programming language.
Currently, only the host variant is built.
The build process is as follows:
1. a snapshot of the Rust compiler matching the host architecture is
downloaded. This is rustc-stage0.
2. rustc-stage0 is used to build rustc-stage1, which will build the
final Rust compiler (rust-stage2) and the standard library for the
host architecture.
3. the standard library for the target architecture is build.
The Rust compiler uses LLVM as its backend, compiled with support for
x86, ARM, PowerPC and MIPS architectures.
To properly build the standard library for the target, two files are
needed:
- the target configuration: a Makefile fragment telling the build system
about the cross-compiler and such.
- the target specification: a JSON file describing the target
architecture to the LLVM backend.
These files are generated with a Python script which takes info from the
Buildroot configuration: `rust-target-gen`.
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.
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
package/Config.in.host | 1 +
...monize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch | 53 ++++
.../0002-Expand-CC-to-gcc-in-x86-mk-cfg-.cfg.patch | 71 +++++
...eclaration-in-mipsel-unknown-linux-gnu.mk.patch | 26 ++
package/rust/Config.in.host | 24 ++
package/rust/rust-target-gen | 314 +++++++++++++++++++++
package/rust/rust.hash | 5 +
package/rust/rust.mk | 90 ++++++
8 files changed, 584 insertions(+)
create mode 100644 package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch
create mode 100644 package/rust/0002-Expand-CC-to-gcc-in-x86-mk-cfg-.cfg.patch
create mode 100644 package/rust/0003-Fix-CPP-declaration-in-mipsel-unknown-linux-gnu.mk.patch
create mode 100644 package/rust/Config.in.host
create mode 100755 package/rust/rust-target-gen
create mode 100644 package/rust/rust.hash
create mode 100644 package/rust/rust.mk
diff --git a/package/Config.in.host b/package/Config.in.host
index d27242f..4f8c7ad 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -28,6 +28,7 @@ menu "Host utilities"
source "package/patchelf/Config.in.host"
source "package/pwgen/Config.in.host"
source "package/qemu/Config.in.host"
+ source "package/rust/Config.in.host"
source "package/sam-ba/Config.in.host"
source "package/squashfs/Config.in.host"
source "package/sunxi-tools/Config.in.host"
diff --git a/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch b/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch
new file mode 100644
index 0000000..a8dc151
--- /dev/null
+++ b/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch
@@ -0,0 +1,53 @@
+From 23d9dbfb3ad4a8d5d5997738e8b1436d076898e9 Mon Sep 17 00:00:00 2001
+From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
+Date: Tue, 19 Apr 2016 10:49:20 +0200
+Subject: [PATCH 1/3] Harmonize use of CROSS_PREFIX_* in mk/cfg/*.mk
+
+Use CROSS_PREFIX_ in Makefile fragments for cross-compiling on Linux
+wherever possible.
+
+Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
+---
+ mk/cfg/mips-unknown-linux-gnu.mk | 9 +++++----
+ mk/cfg/mipsel-unknown-linux-gnu.mk | 9 +++++----
+ 2 files changed, 10 insertions(+), 8 deletions(-)
+
+diff --git a/mk/cfg/mips-unknown-linux-gnu.mk b/mk/cfg/mips-unknown-linux-gnu.mk
+index 65b0877..0fe95de 100644
+--- a/mk/cfg/mips-unknown-linux-gnu.mk
++++ b/mk/cfg/mips-unknown-linux-gnu.mk
+@@ -1,8 +1,9 @@
+ # mips-unknown-linux-gnu configuration
+-CC_mips-unknown-linux-gnu=mips-linux-gnu-gcc
+-CXX_mips-unknown-linux-gnu=mips-linux-gnu-g++
+-CPP_mips-unknown-linux-gnu=mips-linux-gnu-gcc -E
+-AR_mips-unknown-linux-gnu=mips-linux-gnu-ar
++CROSS_PREFIX_mips-unknown-linux-gnu=mips-linux-gnu-
++CC_mips-unknown-linux-gnu=gcc
++CXX_mips-unknown-linux-gnu=g++
++CPP_mips-unknown-linux-gnu=gcc -E
++AR_mips-unknown-linux-gnu=ar
+ CFG_LIB_NAME_mips-unknown-linux-gnu=lib$(1).so
+ CFG_STATIC_LIB_NAME_mips-unknown-linux-gnu=lib$(1).a
+ CFG_LIB_GLOB_mips-unknown-linux-gnu=lib$(1)-*.so
+diff --git a/mk/cfg/mipsel-unknown-linux-gnu.mk b/mk/cfg/mipsel-unknown-linux-gnu.mk
+index 4dadfc2..9340c46 100644
+--- a/mk/cfg/mipsel-unknown-linux-gnu.mk
++++ b/mk/cfg/mipsel-unknown-linux-gnu.mk
+@@ -1,8 +1,9 @@
+ # mipsel-unknown-linux-gnu configuration
+-CC_mipsel-unknown-linux-gnu=mipsel-linux-gnu-gcc
+-CXX_mipsel-unknown-linux-gnu=mipsel-linux-gnu-g++
+-CPP_mipsel-unknown-linux-gnu=mipsel-linux-gnu-gcc
+-AR_mipsel-unknown-linux-gnu=mipsel-linux-gnu-ar
++CROSS_PREFIX_mipsel-unknown-linux-gnu=mipsel-linux-gnu-
++CC_mipsel-unknown-linux-gnu=gcc
++CXX_mipsel-unknown-linux-gnu=g++
++CPP_mipsel-unknown-linux-gnu=gcc
++AR_mipsel-unknown-linux-gnu=ar
+ CFG_LIB_NAME_mipsel-unknown-linux-gnu=lib$(1).so
+ CFG_STATIC_LIB_NAME_mipsel-unknown-linux-gnu=lib$(1).a
+ CFG_LIB_GLOB_mipsel-unknown-linux-gnu=lib$(1)-*.so
+--
+2.1.4
+
diff --git a/package/rust/0002-Expand-CC-to-gcc-in-x86-mk-cfg-.cfg.patch b/package/rust/0002-Expand-CC-to-gcc-in-x86-mk-cfg-.cfg.patch
new file mode 100644
index 0000000..56689d0
--- /dev/null
+++ b/package/rust/0002-Expand-CC-to-gcc-in-x86-mk-cfg-.cfg.patch
@@ -0,0 +1,71 @@
+From a371eb06fef803dcf9894fa0ad6941341887d2d8 Mon Sep 17 00:00:00 2001
+From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
+Date: Tue, 19 Apr 2016 12:51:29 +0200
+Subject: [PATCH 2/3] Expand $(CC) to gcc in x86 mk/cfg/*.cfg
+
+Expand $(CC) and friends to gcc and introduce empty CROSS_PREFIX_ in
+Makefile fragments for cross-compilation of i586, i686 and x86_64 Linux
+platforms to allow use of Sourcery CodeBench toolchains.
+---
+ mk/cfg/i586-unknown-linux-gnu.mk | 9 +++++----
+ mk/cfg/i686-unknown-linux-gnu.mk | 9 +++++----
+ mk/cfg/x86_64-unknown-linux-gnu.mk | 9 +++++----
+ 3 files changed, 15 insertions(+), 12 deletions(-)
+
+diff --git a/mk/cfg/i586-unknown-linux-gnu.mk b/mk/cfg/i586-unknown-linux-gnu.mk
+index 0609f36..45af3b8 100644
+--- a/mk/cfg/i586-unknown-linux-gnu.mk
++++ b/mk/cfg/i586-unknown-linux-gnu.mk
+@@ -1,8 +1,9 @@
+ # i586-unknown-linux-gnu configuration
+-CC_i586-unknown-linux-gnu=$(CC)
+-CXX_i586-unknown-linux-gnu=$(CXX)
+-CPP_i586-unknown-linux-gnu=$(CPP)
+-AR_i586-unknown-linux-gnu=$(AR)
++CROSS_PREFIX_i686-unknown-linux-gnu=
++CC_i586-unknown-linux-gnu=gcc
++CXX_i586-unknown-linux-gnu=g++
++CPP_i586-unknown-linux-gnu=gcc -E
++AR_i586-unknown-linux-gnu=ar
+ CFG_LIB_NAME_i586-unknown-linux-gnu=lib$(1).so
+ CFG_STATIC_LIB_NAME_i586-unknown-linux-gnu=lib$(1).a
+ CFG_LIB_GLOB_i586-unknown-linux-gnu=lib$(1)-*.so
+diff --git a/mk/cfg/i686-unknown-linux-gnu.mk b/mk/cfg/i686-unknown-linux-gnu.mk
+index 88c0907..aa4ce42 100644
+--- a/mk/cfg/i686-unknown-linux-gnu.mk
++++ b/mk/cfg/i686-unknown-linux-gnu.mk
+@@ -1,8 +1,9 @@
+ # i686-unknown-linux-gnu configuration
+-CC_i686-unknown-linux-gnu=$(CC)
+-CXX_i686-unknown-linux-gnu=$(CXX)
+-CPP_i686-unknown-linux-gnu=$(CPP)
+-AR_i686-unknown-linux-gnu=$(AR)
++CROSS_PREFIX_i686-unknown-linux-gnu=
++CC_i686-unknown-linux-gnu=gcc
++CXX_i686-unknown-linux-gnu=g++
++CPP_i686-unknown-linux-gnu=gcc -E
++AR_i686-unknown-linux-gnu=ar
+ CFG_LIB_NAME_i686-unknown-linux-gnu=lib$(1).so
+ CFG_STATIC_LIB_NAME_i686-unknown-linux-gnu=lib$(1).a
+ CFG_LIB_GLOB_i686-unknown-linux-gnu=lib$(1)-*.so
+diff --git a/mk/cfg/x86_64-unknown-linux-gnu.mk b/mk/cfg/x86_64-unknown-linux-gnu.mk
+index 044c687..bdd88cd 100644
+--- a/mk/cfg/x86_64-unknown-linux-gnu.mk
++++ b/mk/cfg/x86_64-unknown-linux-gnu.mk
+@@ -1,8 +1,9 @@
+ # x86_64-unknown-linux-gnu configuration
+-CC_x86_64-unknown-linux-gnu=$(CC)
+-CXX_x86_64-unknown-linux-gnu=$(CXX)
+-CPP_x86_64-unknown-linux-gnu=$(CPP)
+-AR_x86_64-unknown-linux-gnu=$(AR)
++CROSS_PREFIX_x86_64-unknown-linux-gnu=
++CC_x86_64-unknown-linux-gnu=gcc
++CXX_x86_64-unknown-linux-gnu=g++
++CPP_x86_64-unknown-linux-gnu=gcc -E
++AR_x86_64-unknown-linux-gnu=ar
+ CFG_LIB_NAME_x86_64-unknown-linux-gnu=lib$(1).so
+ CFG_STATIC_LIB_NAME_x86_64-unknown-linux-gnu=lib$(1).a
+ CFG_LIB_GLOB_x86_64-unknown-linux-gnu=lib$(1)-*.so
+--
+2.1.4
+
diff --git a/package/rust/0003-Fix-CPP-declaration-in-mipsel-unknown-linux-gnu.mk.patch b/package/rust/0003-Fix-CPP-declaration-in-mipsel-unknown-linux-gnu.mk.patch
new file mode 100644
index 0000000..003f15d
--- /dev/null
+++ b/package/rust/0003-Fix-CPP-declaration-in-mipsel-unknown-linux-gnu.mk.patch
@@ -0,0 +1,26 @@
+From f6d8c8f6dcdbabead3a06ed8f592143afaad16ba Mon Sep 17 00:00:00 2001
+From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
+Date: Tue, 19 Apr 2016 12:57:24 +0200
+Subject: [PATCH 3/3] Fix CPP declaration in mipsel-unknown-linux-gnu.mk
+
+Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
+---
+ mk/cfg/mipsel-unknown-linux-gnu.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mk/cfg/mipsel-unknown-linux-gnu.mk b/mk/cfg/mipsel-unknown-linux-gnu.mk
+index 9340c46..aaa18c2 100644
+--- a/mk/cfg/mipsel-unknown-linux-gnu.mk
++++ b/mk/cfg/mipsel-unknown-linux-gnu.mk
+@@ -2,7 +2,7 @@
+ CROSS_PREFIX_mipsel-unknown-linux-gnu=mipsel-linux-gnu-
+ CC_mipsel-unknown-linux-gnu=gcc
+ CXX_mipsel-unknown-linux-gnu=g++
+-CPP_mipsel-unknown-linux-gnu=gcc
++CPP_mipsel-unknown-linux-gnu=gcc -E
+ AR_mipsel-unknown-linux-gnu=ar
+ CFG_LIB_NAME_mipsel-unknown-linux-gnu=lib$(1).so
+ CFG_STATIC_LIB_NAME_mipsel-unknown-linux-gnu=lib$(1).a
+--
+2.1.4
+
diff --git a/package/rust/Config.in.host b/package/rust/Config.in.host
new file mode 100644
index 0000000..b9bbe0b
--- /dev/null
+++ b/package/rust/Config.in.host
@@ -0,0 +1,24 @@
+config BR2_PACKAGE_RUST_ARCH_SUPPORTS
+ bool
+ default y
+ depends on BR2_arm || BR2_aarch64 || BR2_i386 \
+ || BR2_mips || BR2_mipsel || BR2_x86_64
+ depends on !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5
+
+config BR2_PACKAGE_HOST_RUST
+ bool "host rust"
+ depends on BR2_PACKAGE_RUST_ARCH_SUPPORTS
+ depends on BR2_TOOLCHAIN_USES_GLIBC
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ help
+ Rust is a systems programming language that runs blazingly fast,
+ prevents segfaults, and guarantees thread safety.
+
+ This option builds a Rust cross-compiler for your selected
+ architecture.
+
+ http://www.rust-lang.org/
+
+comment "host-rust needs a (e)glibc toolchain w/ threads"
+ depends on BR2_PACKAGE_RUST_ARCH_SUPPORTS
+ depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/rust/rust-target-gen b/package/rust/rust-target-gen
new file mode 100755
index 0000000..d36b5b5
--- /dev/null
+++ b/package/rust/rust-target-gen
@@ -0,0 +1,314 @@
+#!/usr/bin/env python2.7
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2016 Eric Le Bihan <eric.le.bihan.dev@free.fr>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+"""
+`rust-target-gen ` generates the target configuration or the specification
+file for the Rust compiler.
+
+These files will be used when cross-compiling the standard library or any
+program.
+
+The name of the target is to be formatted in one of the following schemes:
+
+- <cpu>-<vendor>-<os>-<system>
+- <cpu>-<os>-<system>
+
+By default, the contents of the configuration file is generated and printed to
+standard output. Add *-m spec* to the command line to generate the contents of
+the specification file. Add *-o FILE* to write contents to file FILE.
+
+It is possible to explicitly set the type of CPU using the *--cpu* option. To
+set one or more additional LLVM attributes (a.k.a. "features"), add as many as
+*--feature* options as needed.
+
+"""
+
+import os
+import re
+import sys
+import csv
+import StringIO
+import argparse
+
+__version__ = "0.1.1"
+
+
+class GenerationError(Exception):
+ """Error raised when generating file contents"""
+
+
+class Target:
+ """Store information about a target"""
+ def __init__(self, name):
+ match = re.match(r'([\w]+)(?:-([\w]+))?-linux-([\w]+)', name)
+ if not match:
+ raise ValueError("Invalid target name")
+ self.cpu = match.group(1)
+ self.vendor = match.group(2) or 'unknown'
+ self.system = match.group(3)
+ self.name = name
+ self.prefix = name + "-"
+
+ def to_pattern(self):
+ """Format the target name as search pattern"""
+ if self.vendor == 'unknown':
+ pattern = "{0.cpu}-[\w]+-linux-{0.system}"
+ else:
+ pattern = "{0.cpu}-(?!{0.vendor})[\w]+-linux-{0.system}"
+ return pattern.format(self)
+
+ @property
+ def canonical_name(self):
+ """Return the canonical name of the target"""
+ return "{0.cpu}-{0.vendor}-linux-{0.system}".format(self)
+
+
+#: Default list of pre-link-args
+DEFAULT_PRE_LINK_ARGS = ["-Wl,--as-needed", "-Wl,-z,noexecstack"]
+
+#: Template for the target specifiation JSON file
+SPEC_TEMPLATE = """{{
+ "llvm-target": "{name}",
+ "target-endian": "{endianness}",
+ "target-pointer-width": "{ptr-width}",
+ "target-env": "{environment}",
+ "target-vendor": "{vendor}",
+ "arch": "{arch}",
+ "os": "linux",
+ "cpu": "{cpu}",
+ "features": "{features}",
+ "dynamic-linking": true,
+ "executables": true,
+ "morestack": true,
+ "linker-is-gnu": true,
+ "has-rpath": true,
+ "pre-link-args": [
+ {pre-link-args}
+ ],
+ "position-independent-executables": true,
+ "archive-format": "gnu"
+}}
+"""
+
+#: Contents of the target specifiation database.
+#: The information has been extracted from the Rust source code
+#: (src/libbrust_back/target/*.rs) and formatted as CSV.
+#: The first line is the header of the file, listing the fields of the table.
+SPEC_DATABASE_CONTENTS = """name;arch;endianness;ptr-width;cpu;features;pre-link-args
+aarch64-unknown-linux-gnu;aarch64;little;64;;;;
+arm-unknown-linux-gnueabihf;arm;little;32;;+v6,+vfp2;;
+arm-unknown-linux-gnueabi;arm;little;32;;+v6;;
+i586-unknown-linux-gnu;x86;little;32;pentium;;-m32
+i686-unknown-linux-gnu;x86;little;32;pentium4;;-m32
+mips-unknown-linux-gnu;mips;big;32;;+mips32r2,+soft-float;;
+mipsel-unknown-linux-gnu;mips;little;32;;+mips32;;
+x86_64-unknown-linux-gnu;x86_64;little;64;;;-m64
+"""
+
+
+def join_quoted(strings, delimiter=','):
+ """Quote strings and join them as a single string, using a delimiter.
+
+ :param strings: list of strings
+ :type strings: list
+
+ :param delimiter: optional delimiter
+ :type delimiter: Optional[str]
+
+ :return: a new string
+ :rtype: str
+ """
+ return delimiter.join(["\"{}\"".format(s) for s in strings])
+
+
+def find_similar_spec(target):
+ """Find a target specification similar to a given one.
+
+ :param target: target to be created
+ :type target: Target
+
+ :return: the reference target specification as a dict
+ :rtype: dict of str to str
+ """
+ expr = re.compile(target.to_pattern() + '$')
+ f = StringIO.StringIO(SPEC_DATABASE_CONTENTS)
+ reader = csv.DictReader(f, delimiter=';', quotechar='"')
+ for row in reader:
+ if expr.match(row['name']):
+ spec = dict(row)
+ fields = spec['name'].split('-')
+ spec['vendor'] = fields[1]
+ spec['environment'] = fields[3]
+ pre_links_args = DEFAULT_PRE_LINK_ARGS + spec['pre-link-args'].split()
+ spec['pre-link-args'] = join_quoted(pre_links_args, ', ')
+ spec['cpu'] = spec['cpu'] or 'generic'
+ return spec
+
+ raise GenerationError("Can not find matching specification")
+
+
+def gen_spec(target, cpu=None, features=[]):
+ """Generate target specification file.
+
+ :param target: target to be created
+ :type target: Target
+
+ :param cpu: optional CPU type
+ :type cpu: Optional[str]
+
+ :param features: optional list of additional LLVM features
+ :type features: Optional[list]
+
+ :return: contents of the configuration file
+ :rtype: str
+ """
+ spec = find_similar_spec(target)
+ spec['name'] = target.name
+ spec['vendor'] = target.vendor
+ if features:
+ spec['features'] += ',' + ','.join(features)
+ spec['cpu'] = cpu or spec['cpu']
+ return SPEC_TEMPLATE.format(**spec)
+
+
+def gen_conf_from(target, filename):
+ """Generate target configuration file from an existing one.
+
+ :param target: target to be created
+ :type target: Target
+
+ :param filename: path to an existing configuration file
+ :type str:
+
+ :return: contents of the new configuration file
+ :rtype: str
+ """
+ (name, e) = os.path.splitext(os.path.basename(filename))
+ expr = re.compile(r'CROSS_PREFIX_[-\w]+=(?:[-\w]+)?\n')
+ with open(filename) as input:
+ contents = input.read()
+ contents = contents.replace(name, target.name)
+ line = "CROSS_PREFIX_{}={}\n".format(target.name, target.prefix)
+ if expr.search(contents):
+ contents = expr.sub(line, contents)
+ else:
+ contents += line
+
+ return contents
+
+
+def find_similar_conf(target, srcdir):
+ """Find a configuration file similar to a given target.
+
+ :param target: target to be created
+ :type target: Target
+
+ :param srcdir: path to Rust source code
+ :type srcdir: str
+
+ :return: path to the matching configuration file
+ :rtype: str
+ """
+ cfgdir = os.path.join(srcdir, 'mk', 'cfg')
+ expr = re.compile(target.to_pattern() + '.mk')
+ candidates = filter(lambda f: expr.match(f), os.listdir(cfgdir))
+ if len(candidates) != 1:
+ raise GenerationError("Can not find matching configuration")
+ return os.path.join(cfgdir, candidates[0])
+
+
+def gen_conf(target, srcdir):
+ """Generate target configuration file.
+
+ :param target: target to be created
+ :type target: Target
+
+ :param srcdir: path to Rust source code
+ :type srcdir: str
+
+ :return: contents of the configuration file
+ :rtype: str
+ """
+ reference = find_similar_conf(target, srcdir)
+ return gen_conf_from(target, reference)
+
+
+def save_to_file(filename, text):
+ """Save text to a file.
+
+ :param filename: path to the destination filename
+ :type filename: str
+
+ :param text: contents of the file
+ :type text: str
+ """
+ dstdir = os.path.dirname(filename)
+ if not os.path.exists(dstdir):
+ os.makedirs(dstdir)
+ with open(filename, 'w') as f:
+ f.write(contents)
+
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-v', '--version',
+ action='version',
+ version=__version__)
+ parser.add_argument('-c', '--cpu',
+ help='Set CPU type')
+ parser.add_argument('-f', '--feature',
+ action='append',
+ metavar='FEATURE',
+ dest='features',
+ default=[],
+ help='Add new LLVM feature')
+ parser.add_argument('-i', '--input',
+ dest='srcdir',
+ metavar='DIR',
+ default=os.getcwd(),
+ help='set the path to Rust source code')
+ parser.add_argument('-p', '--prefix',
+ help='set the cross-compiler prefix')
+ parser.add_argument('-m', '--mode',
+ choices=('conf', 'spec'),
+ default='conf',
+ help='set the operating mode')
+ parser.add_argument('-o', '--output',
+ metavar='FILE',
+ help='write generated contents to FILE')
+ parser.add_argument('target',
+ help='target name ("<cpu>-<vendor>-<os>-<system>")')
+
+ args = parser.parse_args()
+
+ target = Target(args.target)
+ if args.prefix:
+ target.prefix = args.prefix
+
+ if args.mode == 'conf':
+ contents = gen_conf(target, args.srcdir)
+ else:
+ contents = gen_spec(target, args.cpu, args.features)
+
+ if not args.output:
+ sys.stdout.write(contents)
+ else:
+ save_to_file(args.output, contents)
+
+# vim: ts=4 sw=4 sts=4 et ai
diff --git a/package/rust/rust.hash b/package/rust/rust.hash
new file mode 100644
index 0000000..552a5fc
--- /dev/null
+++ b/package/rust/rust.hash
@@ -0,0 +1,5 @@
+# Locally calculated
+sha256 af4466147e8d4db4de2a46e07494d2dc2d96313c5b37da34237f511c905f7449 rustc-1.8.0-src.tar.gz
+sha1 d29b7607d13d64078b6324aec82926fb493f59ba rust-stage0-2016-02-17-4d3eebf-linux-x86_64-d29b7607d13d64078b6324aec82926fb493f59ba.tar.bz2
+sha1 5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7 rust-stage0-2016-02-17-4d3eebf-linux-i386-5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7.tar.bz2
+
diff --git a/package/rust/rust.mk b/package/rust/rust.mk
new file mode 100644
index 0000000..90c9e2b
--- /dev/null
+++ b/package/rust/rust.mk
@@ -0,0 +1,90 @@
+################################################################################
+#
+# rust
+#
+################################################################################
+
+RUST_VERSION = 1.8.0
+RUST_SOURCE = rustc-$(RUST_VERSION)-src.tar.gz
+RUST_SITE = https://static.rust-lang.org/dist
+RUST_LICENSE = Apache-2.0, MIT
+RUST_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
+
+HOST_RUST_DEPENDENCIES = host-python
+
+# Taken from src/snapshots.txt
+HOST_RUST_SNAP_SITE = https://static.rust-lang.org/stage0-snapshots
+HOST_RUST_SNAP_DATE = 2016-02-17
+HOST_RUST_SNAP_REV = 4d3eebf
+
+ifeq ($(HOSTARCH),x86_64)
+HOST_RUST_SNAP_HASH = d29b7607d13d64078b6324aec82926fb493f59ba
+else
+HOST_RUST_SNAP_HASH = 5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7
+endif
+
+HOST_RUST_SNAP_SOURCE = \
+ rust-stage0-$(HOST_RUST_SNAP_DATE)-$(HOST_RUST_SNAP_REV)-linux-$(HOSTARCH)-$(HOST_RUST_SNAP_HASH).tar.bz2
+
+HOST_RUST_EXTRA_DOWNLOADS = \
+ $(HOST_RUST_SNAP_SITE)/$(HOST_RUST_SNAP_SOURCE)
+
+define HOST_RUST_SNAP_EXTRACT
+ $(call suitable-extractor,$(HOST_RUST_SNAP_SOURCE)) $(DL_DIR)/$(HOST_RUST_SNAP_SOURCE) | \
+ $(TAR) -C $(@D) $(TAR_OPTIONS) -
+endef
+
+HOST_RUST_POST_EXTRACT_HOOKS += HOST_RUST_SNAP_EXTRACT
+
+define HOST_RUST_GEN_CONF
+ package/rust/rust-target-gen \
+ --mode conf \
+ --prefix=$(notdir $(TARGET_CROSS)) \
+ --input $(@D) \
+ --output $(@D)/mk/cfg/$(GNU_TARGET_NAME).mk \
+ $(GNU_TARGET_NAME)
+endef
+
+define HOST_RUST_GEN_SPEC
+ package/rust/rust-target-gen \
+ --mode spec \
+ --input $(@D) \
+ --output $(HOST_DIR)/etc/rustc/$(GNU_TARGET_NAME).json \
+ $(GNU_TARGET_NAME)
+endef
+
+HOST_RUST_PRE_CONFIGURE_HOOKS += \
+ HOST_RUST_GEN_CONF \
+ HOST_RUST_GEN_SPEC
+
+HOST_RUST_MAKE_ENV = RUST_TARGET_PATH=$(HOST_DIR)/etc/rustc
+HOST_RUST_MAKE_OPTS = VERBOSE=1
+
+define HOST_RUST_CONFIGURE_CMDS
+ (cd $(@D); $(HOST_CONFIGURE_OPTS) \
+ ./configure \
+ --host=$(GNU_HOST_NAME) \
+ --build=$(GNU_HOST_NAME) \
+ --target=$(GNU_TARGET_NAME) \
+ --prefix="$(HOST_DIR)/usr" \
+ --enable-local-rust \
+ --local-rust-root="$(@D)/rust-stage0" \
+ --disable-docs \
+ --disable-manage-submodules \
+ --sysconfdir="$(HOST_DIR)/etc" \
+ --localstatedir="$(HOST_DIR)/var/lib" \
+ --datadir="$(HOST_DIR)/usr/share" \
+ --infodir="$(HOST_DIR)/usr/share/info")
+endef
+
+define HOST_RUST_BUILD_CMDS
+ $(HOST_MAKE_ENV) $(HOST_RUST_MAKE_ENV) $(MAKE) \
+ $(HOST_RUST_MAKE_OPTS) -C $(@D)
+endef
+
+define HOST_RUST_INSTALL_CMDS
+ $(HOST_MAKE_ENV) $(HOST_RUST_MAKE_ENV) $(MAKE) \
+ $(HOST_RUST_MAKE_OPTS) -C $(@D) install
+endef
+
+$(eval $(host-generic-package))
--
2.4.11
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 1/2] python: enable bzip2 in host variant
2016-04-24 14:39 ` [Buildroot] [PATCH 1/2] python: enable bzip2 in host variant Eric Le Bihan
@ 2016-06-15 22:01 ` Thomas Petazzoni
2016-06-16 20:43 ` Eric Le Bihan
0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2016-06-15 22:01 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 24 Apr 2016 16:39:48 +0200, Eric Le Bihan wrote:
> Enable support for bzip2 in Python host variant, so the tarfile module
> works properly.
>
> Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Could you give some more details about this? The tarfile module seems
to only import the bz2 module when a bzip2-compressed file is handled.
Is this actually the case with rust?
I am hesitant between applying your patch (and therefore removing
package/nodejs/0.10.45/0001-remove-python-bz2-dependency.patch), or
adding an hidden BR2_HOST_PACKAGE_PYTHON_BZIP2 that the rust package
could select to make sure bzip2 support is built into host-python.
Indeed, host-python is used by numerous packages, and we're trying to
not add too many dependencies to host-python. On the other hand,
building bzip2 is pretty fast, so maybe it's reasonable to add it as a
mandatory dependency of host-python.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 2/2] rust: new package
2016-04-24 14:39 ` [Buildroot] [PATCH 2/2] rust: new package Eric Le Bihan
@ 2016-06-15 22:09 ` Thomas Petazzoni
2016-06-15 22:42 ` Charles Hardin
2016-06-16 20:25 ` Eric Le Bihan
0 siblings, 2 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2016-06-15 22:09 UTC (permalink / raw)
To: buildroot
Hello,
Thanks Eric for working on Rust. Below a preliminary review with lots
of questions/comments.
On Sun, 24 Apr 2016 16:39:49 +0200, Eric Le Bihan wrote:
> This new package provides the compiler for the Rust programming language.
>
> Currently, only the host variant is built.
>
> The build process is as follows:
>
> 1. a snapshot of the Rust compiler matching the host architecture is
> downloaded. This is rustc-stage0.
OK, this one is downloaded pre-compiled. So your package should have a
dependency on the host architecture, since the pre-compiled rust
compilers are only available on x86 and x86_64 it seems. So you
probably want something like:
depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
> 2. rustc-stage0 is used to build rustc-stage1, which will build the
> final Rust compiler (rust-stage2) and the standard library for the
> host architecture.
Is this all happening inside the rust build process? Because from what
I can see in your package, you're downloading and extracting
rustc-stage0, and then directly building rust.
> 3. the standard library for the target architecture is build.
>
> The Rust compiler uses LLVM as its backend, compiled with support for
> x86, ARM, PowerPC and MIPS architectures.
>
> To properly build the standard library for the target, two files are
> needed:
>
> - the target configuration: a Makefile fragment telling the build system
> about the cross-compiler and such.
> - the target specification: a JSON file describing the target
> architecture to the LLVM backend.
>
> These files are generated with a Python script which takes info from the
> Buildroot configuration: `rust-target-gen`.
It is not entirely clear to me if a separate Python script is needed,
or if they could be generated from rust.mk directly.
> 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.
So where does the glibc dependency comes from?
> diff --git a/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch b/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch
> new file mode 100644
> index 0000000..a8dc151
> --- /dev/null
> +++ b/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch
> @@ -0,0 +1,53 @@
> +From 23d9dbfb3ad4a8d5d5997738e8b1436d076898e9 Mon Sep 17 00:00:00 2001
> +From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> +Date: Tue, 19 Apr 2016 10:49:20 +0200
> +Subject: [PATCH 1/3] Harmonize use of CROSS_PREFIX_* in mk/cfg/*.mk
> +
> +Use CROSS_PREFIX_ in Makefile fragments for cross-compiling on Linux
> +wherever possible.
> +
> +Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> +---
> + mk/cfg/mips-unknown-linux-gnu.mk | 9 +++++----
> + mk/cfg/mipsel-unknown-linux-gnu.mk | 9 +++++----
> + 2 files changed, 10 insertions(+), 8 deletions(-)
Aren't those files generated by your Python script? If so, why are you
patching the existing ones?
> diff --git a/package/rust/Config.in.host b/package/rust/Config.in.host
> new file mode 100644
> index 0000000..b9bbe0b
> --- /dev/null
> +++ b/package/rust/Config.in.host
> @@ -0,0 +1,24 @@
> +config BR2_PACKAGE_RUST_ARCH_SUPPORTS
> + bool
> + default y
> + depends on BR2_arm || BR2_aarch64 || BR2_i386 \
> + || BR2_mips || BR2_mipsel || BR2_x86_64
> + depends on !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5
> +
> +config BR2_PACKAGE_HOST_RUST
> + bool "host rust"
Normally, we wouldn't add visible Config.in options for such host
packages, they should just be used as dependencies of target packages.
Like we did for the host-go package recently.
> diff --git a/package/rust/rust.hash b/package/rust/rust.hash
> new file mode 100644
> index 0000000..552a5fc
> --- /dev/null
> +++ b/package/rust/rust.hash
> @@ -0,0 +1,5 @@
> +# Locally calculated
> +sha256 af4466147e8d4db4de2a46e07494d2dc2d96313c5b37da34237f511c905f7449 rustc-1.8.0-src.tar.gz
> +sha1 d29b7607d13d64078b6324aec82926fb493f59ba rust-stage0-2016-02-17-4d3eebf-linux-x86_64-d29b7607d13d64078b6324aec82926fb493f59ba.tar.bz2
> +sha1 5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7 rust-stage0-2016-02-17-4d3eebf-linux-i386-5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7.tar.bz2
> +
Unneeded empty line. If you're locally calculating the hashes, why not
use sha256 for all of them?
> diff --git a/package/rust/rust.mk b/package/rust/rust.mk
> new file mode 100644
> index 0000000..90c9e2b
> --- /dev/null
> +++ b/package/rust/rust.mk
> @@ -0,0 +1,90 @@
> +################################################################################
> +#
> +# rust
> +#
> +################################################################################
> +
> +RUST_VERSION = 1.8.0
> +RUST_SOURCE = rustc-$(RUST_VERSION)-src.tar.gz
> +RUST_SITE = https://static.rust-lang.org/dist
> +RUST_LICENSE = Apache-2.0, MIT
> +RUST_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
> +
> +HOST_RUST_DEPENDENCIES = host-python
> +
> +# Taken from src/snapshots.txt
> +HOST_RUST_SNAP_SITE = https://static.rust-lang.org/stage0-snapshots
> +HOST_RUST_SNAP_DATE = 2016-02-17
> +HOST_RUST_SNAP_REV = 4d3eebf
> +
> +ifeq ($(HOSTARCH),x86_64)
> +HOST_RUST_SNAP_HASH = d29b7607d13d64078b6324aec82926fb493f59ba
> +else
> +HOST_RUST_SNAP_HASH = 5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7
> +endif
> +
> +HOST_RUST_SNAP_SOURCE = \
> + rust-stage0-$(HOST_RUST_SNAP_DATE)-$(HOST_RUST_SNAP_REV)-linux-$(HOSTARCH)-$(HOST_RUST_SNAP_HASH).tar.bz2
> +
> +HOST_RUST_EXTRA_DOWNLOADS = \
> + $(HOST_RUST_SNAP_SITE)/$(HOST_RUST_SNAP_SOURCE)
> +
> +define HOST_RUST_SNAP_EXTRACT
> + $(call suitable-extractor,$(HOST_RUST_SNAP_SOURCE)) $(DL_DIR)/$(HOST_RUST_SNAP_SOURCE) | \
> + $(TAR) -C $(@D) $(TAR_OPTIONS) -
> +endef
> +
> +HOST_RUST_POST_EXTRACT_HOOKS += HOST_RUST_SNAP_EXTRACT
Alternatively, downloading and installing the rustc-stage0 compiler
could be done in a separate package, perhaps?
> +
> +define HOST_RUST_GEN_CONF
> + package/rust/rust-target-gen \
> + --mode conf \
> + --prefix=$(notdir $(TARGET_CROSS)) \
> + --input $(@D) \
> + --output $(@D)/mk/cfg/$(GNU_TARGET_NAME).mk \
> + $(GNU_TARGET_NAME)
> +endef
> +
> +define HOST_RUST_GEN_SPEC
> + package/rust/rust-target-gen \
> + --mode spec \
> + --input $(@D) \
> + --output $(HOST_DIR)/etc/rustc/$(GNU_TARGET_NAME).json \
> + $(GNU_TARGET_NAME)
> +endef
> +
> +HOST_RUST_PRE_CONFIGURE_HOOKS += \
> + HOST_RUST_GEN_CONF \
> + HOST_RUST_GEN_SPEC
> +
> +HOST_RUST_MAKE_ENV = RUST_TARGET_PATH=$(HOST_DIR)/etc/rustc
> +HOST_RUST_MAKE_OPTS = VERBOSE=1
> +
> +define HOST_RUST_CONFIGURE_CMDS
> + (cd $(@D); $(HOST_CONFIGURE_OPTS) \
> + ./configure \
> + --host=$(GNU_HOST_NAME) \
> + --build=$(GNU_HOST_NAME) \
> + --target=$(GNU_TARGET_NAME) \
> + --prefix="$(HOST_DIR)/usr" \
> + --enable-local-rust \
> + --local-rust-root="$(@D)/rust-stage0" \
> + --disable-docs \
> + --disable-manage-submodules \
> + --sysconfdir="$(HOST_DIR)/etc" \
> + --localstatedir="$(HOST_DIR)/var/lib" \
> + --datadir="$(HOST_DIR)/usr/share" \
> + --infodir="$(HOST_DIR)/usr/share/info")
It's probably good to explain somewhere that the configure script is
not an autoconf-generated configure script.
In any case, I applied your patches, and tried to build the following
defconfig:
BR2_arm=y
BR2_cortex_a8=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
# BR2_TARGET_ROOTFS_TAR is not set
BR2_PACKAGE_HOST_RUST=y
and it fails to build with:
>>> host-rust 1.8.0 Configuring
package/rust/rust-target-gen --mode conf --prefix=arm-linux-gnueabihf- --input /home/thomas/projets/buildroot/output/build/host-rust-1.8.0 --output /home/thomas/projets/buildroot/output/build/host-rust-1.8.0/mk/cfg/arm-buildroot-linux-gnueabihf.mk arm-buildroot-linux-gnueabihf
package/rust/rust-target-gen --mode spec --input /home/thomas/projets/buildroot/output/build/host-rust-1.8.0 --output /home/thomas/projets/buildroot/output/host/etc/rustc/arm-buildroot-linux-gnueabihf.json arm-buildroot-linux-gnueabihf
(cd /home/thomas/projets/buildroot/output/build/host-rust-1.8.0; PATH="/home/thomas/projets/buildroot/output/host/bin:/home/thomas/projets/buildroot/output/host/sbin:/home/thomas/projets/buildroot/output/host/usr/bin:/home/thomas/projets/buildroot/output/host/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/thomas/sys/bin:/home/thomas/.gem/ruby/2.1.0/bin" AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm" CC="/usr/bin/gcc" GCC="/usr/bin/gcc" CXX="/usr/bin/g++" CPP="/usr/bin/cpp" OBJCOPY="/usr/bin/objcopy" RANLIB="/usr/bin/ranlib" CPPFLAGS="-I/home/thomas/projets/buildroot/output/host/usr/include" CFLAGS="-O2 -I/home/thomas/projets/buildroot/output/host/usr/include" CXXFLAGS="-O2 -I/home/thomas/projets/buildroot/output/host/usr/include" LDFLAGS="-L/home/thomas/projets/buildroot/output/host/lib -L/home/thomas/projets/buildroot/output/host/usr/lib -Wl,-rpath,/home/thomas/projets/buildroot/output/ho
st/usr/l
ib" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG="/home/thomas/projets/buildroot/output/host/usr/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_LIBDIR="/home/thomas/projets/buildroot/output/host/usr/lib/pkgconfig:/home/thomas/projets/buildroot/output/host/usr/share/pkgconfig" INTLTOOL_PERL=/usr/bin/perl ./configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --target=arm-buildroot-linux-gnueabihf --prefix="/home/thomas/projets/buildroot/output/host/usr" --enable-local-rust --local-rust-root="/home/thomas/projets/buildroot/output/build/host-rust-1.8.0/rust-stage0" --disable-docs --disable-manage-submodules --sysconfdir="/home/thomas/projets/buildroot/output/host/etc" --localstatedir="/home/thomas/projets/buildroot/output/host/var/lib" --datadir="/home/thomas/projets/buildroot/output/host/usr/share" --infodir="/home/thomas/projets/buildroot/output/host/usr/share/info")
configure: looking for configure programs
configure: found program 'cmp'
configure: found program 'mkdir'
configure: found program 'printf'
configure: found program 'cut'
configure: found program 'head'
configure: found program 'grep'
configure: found program 'xargs'
configure: found program 'cp'
configure: found program 'find'
configure: found program 'uname'
configure: found program 'date'
configure: found program 'tr'
configure: found program 'sed'
configure: found program 'file'
configure: found program 'make'
configure: inspecting environment
configure: recreating config.tmp
configure:
configure: processing ./configure args
configure:
configure: CFG_DISABLE_DOCS := 1
configure: CFG_ENABLE_LOCAL_RUST := 1
configure: CFG_LOCALSTATEDIR := /home/thomas/projets/buildroot/outp ...
configure: CFG_SYSCONFDIR := /home/thomas/projets/buildroot/outp ...
configure: CFG_DATADIR := /home/thomas/projets/buildroot/outp ...
configure: CFG_INFODIR := /home/thomas/projets/buildroot/outp ...
configure: CFG_LLVM_ROOT :=
configure: CFG_PYTHON :=
configure: CFG_JEMALLOC_ROOT :=
configure: CFG_BUILD := x86_64-pc-linux-gnu
configure: CFG_ANDROID_CROSS_PATH :=
configure: CFG_I686_LINUX_ANDROID_NDK :=
configure: CFG_ARM_LINUX_ANDROIDEABI_NDK :=
configure: CFG_AARCH64_LINUX_ANDROID_NDK :=
configure: CFG_NACL_CROSS_PATH :=
configure: CFG_RELEASE_CHANNEL := dev
configure: CFG_MUSL_ROOT := /usr/local
configure: CFG_EXTRA_FILENAME :=
configure: CFG_DEFAULT_LINKER := cc
configure: CFG_DEFAULT_AR := ar
configure: CFG_LIBDIR := /home/thomas/projets/buildroot/outp ...
configure:
configure: validating ./configure args
configure:
configure: CFG_BOOTSTRAP_KEY := 23:44:24
configure:
configure: looking for build programs
configure:
configure: CFG_CURLORWGET := /usr/bin/curl (7.47.0)
configure: CFG_PYTHON := /home/thomas/projets/buildroot/outp ...
configure: CFG_GIT := /usr/bin/git (2.7.4)
configure: git: no git directory. disabling submodules
configure: CFG_MD5 :=
configure: CFG_MD5SUM := /usr/bin/md5sum (8.25)
configure: CFG_HASH_COMMAND := /usr/bin/md5sum | cut -c 1-8
configure: CFG_CLANG :=
configure: CFG_CCACHE :=
configure: CFG_GCC := /usr/bin/gcc (5.3.1-14ubuntu2.1)
configure: CFG_LD := /usr/bin/ld (2.26)
configure: CFG_VALGRIND :=
configure: CFG_PERF :=
configure: CFG_ISCC :=
configure: CFG_ANTLR4 :=
configure: CFG_GRUN :=
configure: CFG_FLEX := /usr/bin/flex (2.6.0)
configure: CFG_BISON := /usr/bin/bison (3.0.4)
configure: CFG_GDB := /usr/bin/gdb (7.11-0ubuntu1)
configure: CFG_LLDB :=
configure: CFG_DISABLE_VALGRIND_RPASS := 1
configure: CFG_GDB_VERSION := GNU gdb (Ubuntu 7.11-0ubuntu1) 7.11
configure:
configure: looking for target specific programs
configure:
configure: CFG_ADB := /usr/bin/adb
configure:
configure: using rustc at: /home/thomas/projets/buildroot/output/build/host-rust-1.8.0/rust-stage0 with version: rustc 1.8.0-dev (4d3eebff9 2016-02-17)
configure:
configure: CFG_LOCAL_RUST_ROOT := /home/thomas/projets/buildroot/outp ...
configure: skipping compiler inference steps; using provided CC=/usr/bin/gcc
configure: CFG_CC := /usr/bin/gcc
configure: CFG_CXX := /usr/bin/g++
configure: CFG_CPP := /usr/bin/cpp
configure: CFG_CFLAGS := -O2 -I/home/thomas/projets/buildroo ...
configure: CFG_CXXFLAGS := -O2 -I/home/thomas/projets/buildroo ...
configure: CFG_LDFLAGS := -L/home/thomas/projets/buildroot/ou ...
configure: CFG_STDCPP_NAME := stdc++
configure: error: unsupported target triples "x86_64-pc-linux-gnu" found
package/pkg-generic.mk:185: recipe for target '/home/thomas/projets/buildroot/output/build/host-rust-1.8.0/.stamp_configured' failed
make[1]: *** [/home/thomas/projets/buildroot/output/build/host-rust-1.8.0/.stamp_configured] Error 1
Makefile:36: recipe for target '_all' failed
make: *** [_all] Error 2
Is this expected?
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 2/2] rust: new package
2016-06-15 22:09 ` Thomas Petazzoni
@ 2016-06-15 22:42 ` Charles Hardin
2016-06-16 20:31 ` Eric Le Bihan
2016-06-16 20:25 ` Eric Le Bihan
1 sibling, 1 reply; 10+ messages in thread
From: Charles Hardin @ 2016-06-15 22:42 UTC (permalink / raw)
To: buildroot
Thomas,
We are already building rust 1.9.0 derived from Eric?s patches - he updated them a bit
ago and we modified them slightly.
I haven?t tried to post any other patches since I don?t want to confuse the issue with
our changes on his changes on buildroot changes.
However, if you or Eric would like/need anything from us - please let us know because
it is alot easier on us if rust goes into buildroot proper.
BTW - I would also really want to know what the proper method is for making an
EXTERNAL rust toolchain option because that llvm compiles is at least 5 expressos
long and by the time it is down - well the hands just jitter.
Regards,
Charles
> On Jun 15, 2016, at 3:09 PM, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
>
> Hello,
>
> Thanks Eric for working on Rust. Below a preliminary review with lots
> of questions/comments.
>
> On Sun, 24 Apr 2016 16:39:49 +0200, Eric Le Bihan wrote:
>> This new package provides the compiler for the Rust programming language.
>>
>> Currently, only the host variant is built.
>>
>> The build process is as follows:
>>
>> 1. a snapshot of the Rust compiler matching the host architecture is
>> downloaded. This is rustc-stage0.
>
> OK, this one is downloaded pre-compiled. So your package should have a
> dependency on the host architecture, since the pre-compiled rust
> compilers are only available on x86 and x86_64 it seems. So you
> probably want something like:
>
> depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
>
>> 2. rustc-stage0 is used to build rustc-stage1, which will build the
>> final Rust compiler (rust-stage2) and the standard library for the
>> host architecture.
>
> Is this all happening inside the rust build process? Because from what
> I can see in your package, you're downloading and extracting
> rustc-stage0, and then directly building rust.
>
>> 3. the standard library for the target architecture is build.
>>
>> The Rust compiler uses LLVM as its backend, compiled with support for
>> x86, ARM, PowerPC and MIPS architectures.
>>
>> To properly build the standard library for the target, two files are
>> needed:
>>
>> - the target configuration: a Makefile fragment telling the build system
>> about the cross-compiler and such.
>> - the target specification: a JSON file describing the target
>> architecture to the LLVM backend.
>>
>> These files are generated with a Python script which takes info from the
>> Buildroot configuration: `rust-target-gen`.
>
> It is not entirely clear to me if a separate Python script is needed,
> or if they could be generated from rust.mk directly.
>
>> 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.
>
> So where does the glibc dependency comes from?
>
>> diff --git a/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch b/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch
>> new file mode 100644
>> index 0000000..a8dc151
>> --- /dev/null
>> +++ b/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch
>> @@ -0,0 +1,53 @@
>> +From 23d9dbfb3ad4a8d5d5997738e8b1436d076898e9 Mon Sep 17 00:00:00 2001
>> +From: Eric Le Bihan <eric.le.bihan.dev@free.fr>
>> +Date: Tue, 19 Apr 2016 10:49:20 +0200
>> +Subject: [PATCH 1/3] Harmonize use of CROSS_PREFIX_* in mk/cfg/*.mk
>> +
>> +Use CROSS_PREFIX_ in Makefile fragments for cross-compiling on Linux
>> +wherever possible.
>> +
>> +Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
>> +---
>> + mk/cfg/mips-unknown-linux-gnu.mk | 9 +++++----
>> + mk/cfg/mipsel-unknown-linux-gnu.mk | 9 +++++----
>> + 2 files changed, 10 insertions(+), 8 deletions(-)
>
> Aren't those files generated by your Python script? If so, why are you
> patching the existing ones?
>
>> diff --git a/package/rust/Config.in.host b/package/rust/Config.in.host
>> new file mode 100644
>> index 0000000..b9bbe0b
>> --- /dev/null
>> +++ b/package/rust/Config.in.host
>> @@ -0,0 +1,24 @@
>> +config BR2_PACKAGE_RUST_ARCH_SUPPORTS
>> + bool
>> + default y
>> + depends on BR2_arm || BR2_aarch64 || BR2_i386 \
>> + || BR2_mips || BR2_mipsel || BR2_x86_64
>> + depends on !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5
>> +
>> +config BR2_PACKAGE_HOST_RUST
>> + bool "host rust"
>
> Normally, we wouldn't add visible Config.in options for such host
> packages, they should just be used as dependencies of target packages.
> Like we did for the host-go package recently.
>
>> diff --git a/package/rust/rust.hash b/package/rust/rust.hash
>> new file mode 100644
>> index 0000000..552a5fc
>> --- /dev/null
>> +++ b/package/rust/rust.hash
>> @@ -0,0 +1,5 @@
>> +# Locally calculated
>> +sha256 af4466147e8d4db4de2a46e07494d2dc2d96313c5b37da34237f511c905f7449 rustc-1.8.0-src.tar.gz
>> +sha1 d29b7607d13d64078b6324aec82926fb493f59ba rust-stage0-2016-02-17-4d3eebf-linux-x86_64-d29b7607d13d64078b6324aec82926fb493f59ba.tar.bz2
>> +sha1 5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7 rust-stage0-2016-02-17-4d3eebf-linux-i386-5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7.tar.bz2
>> +
>
> Unneeded empty line. If you're locally calculating the hashes, why not
> use sha256 for all of them?
>
>> diff --git a/package/rust/rust.mk b/package/rust/rust.mk
>> new file mode 100644
>> index 0000000..90c9e2b
>> --- /dev/null
>> +++ b/package/rust/rust.mk
>> @@ -0,0 +1,90 @@
>> +################################################################################
>> +#
>> +# rust
>> +#
>> +################################################################################
>> +
>> +RUST_VERSION = 1.8.0
>> +RUST_SOURCE = rustc-$(RUST_VERSION)-src.tar.gz
>> +RUST_SITE = https://static.rust-lang.org/dist
>> +RUST_LICENSE = Apache-2.0, MIT
>> +RUST_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
>> +
>> +HOST_RUST_DEPENDENCIES = host-python
>> +
>> +# Taken from src/snapshots.txt
>> +HOST_RUST_SNAP_SITE = https://static.rust-lang.org/stage0-snapshots
>> +HOST_RUST_SNAP_DATE = 2016-02-17
>> +HOST_RUST_SNAP_REV = 4d3eebf
>> +
>> +ifeq ($(HOSTARCH),x86_64)
>> +HOST_RUST_SNAP_HASH = d29b7607d13d64078b6324aec82926fb493f59ba
>> +else
>> +HOST_RUST_SNAP_HASH = 5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7
>> +endif
>> +
>> +HOST_RUST_SNAP_SOURCE = \
>> + rust-stage0-$(HOST_RUST_SNAP_DATE)-$(HOST_RUST_SNAP_REV)-linux-$(HOSTARCH)-$(HOST_RUST_SNAP_HASH).tar.bz2
>> +
>> +HOST_RUST_EXTRA_DOWNLOADS = \
>> + $(HOST_RUST_SNAP_SITE)/$(HOST_RUST_SNAP_SOURCE)
>> +
>> +define HOST_RUST_SNAP_EXTRACT
>> + $(call suitable-extractor,$(HOST_RUST_SNAP_SOURCE)) $(DL_DIR)/$(HOST_RUST_SNAP_SOURCE) | \
>> + $(TAR) -C $(@D) $(TAR_OPTIONS) -
>> +endef
>> +
>> +HOST_RUST_POST_EXTRACT_HOOKS += HOST_RUST_SNAP_EXTRACT
>
> Alternatively, downloading and installing the rustc-stage0 compiler
> could be done in a separate package, perhaps?
>
>> +
>> +define HOST_RUST_GEN_CONF
>> + package/rust/rust-target-gen \
>> + --mode conf \
>> + --prefix=$(notdir $(TARGET_CROSS)) \
>> + --input $(@D) \
>> + --output $(@D)/mk/cfg/$(GNU_TARGET_NAME).mk \
>> + $(GNU_TARGET_NAME)
>> +endef
>> +
>> +define HOST_RUST_GEN_SPEC
>> + package/rust/rust-target-gen \
>> + --mode spec \
>> + --input $(@D) \
>> + --output $(HOST_DIR)/etc/rustc/$(GNU_TARGET_NAME).json \
>> + $(GNU_TARGET_NAME)
>> +endef
>> +
>> +HOST_RUST_PRE_CONFIGURE_HOOKS += \
>> + HOST_RUST_GEN_CONF \
>> + HOST_RUST_GEN_SPEC
>> +
>> +HOST_RUST_MAKE_ENV = RUST_TARGET_PATH=$(HOST_DIR)/etc/rustc
>> +HOST_RUST_MAKE_OPTS = VERBOSE=1
>> +
>> +define HOST_RUST_CONFIGURE_CMDS
>> + (cd $(@D); $(HOST_CONFIGURE_OPTS) \
>> + ./configure \
>> + --host=$(GNU_HOST_NAME) \
>> + --build=$(GNU_HOST_NAME) \
>> + --target=$(GNU_TARGET_NAME) \
>> + --prefix="$(HOST_DIR)/usr" \
>> + --enable-local-rust \
>> + --local-rust-root="$(@D)/rust-stage0" \
>> + --disable-docs \
>> + --disable-manage-submodules \
>> + --sysconfdir="$(HOST_DIR)/etc" \
>> + --localstatedir="$(HOST_DIR)/var/lib" \
>> + --datadir="$(HOST_DIR)/usr/share" \
>> + --infodir="$(HOST_DIR)/usr/share/info")
>
> It's probably good to explain somewhere that the configure script is
> not an autoconf-generated configure script.
>
> In any case, I applied your patches, and tried to build the following
> defconfig:
>
> BR2_arm=y
> BR2_cortex_a8=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_INIT_NONE=y
> BR2_SYSTEM_BIN_SH_NONE=y
> # BR2_PACKAGE_BUSYBOX is not set
> # BR2_TARGET_ROOTFS_TAR is not set
> BR2_PACKAGE_HOST_RUST=y
>
> and it fails to build with:
>
>>>> host-rust 1.8.0 Configuring
> package/rust/rust-target-gen --mode conf --prefix=arm-linux-gnueabihf- --input /home/thomas/projets/buildroot/output/build/host-rust-1.8.0 --output /home/thomas/projets/buildroot/output/build/host-rust-1.8.0/mk/cfg/arm-buildroot-linux-gnueabihf.mk arm-buildroot-linux-gnueabihf
> package/rust/rust-target-gen --mode spec --input /home/thomas/projets/buildroot/output/build/host-rust-1.8.0 --output /home/thomas/projets/buildroot/output/host/etc/rustc/arm-buildroot-linux-gnueabihf.json arm-buildroot-linux-gnueabihf
> (cd /home/thomas/projets/buildroot/output/build/host-rust-1.8.0; PATH="/home/thomas/projets/buildroot/output/host/bin:/home/thomas/projets/buildroot/output/host/sbin:/home/thomas/projets/buildroot/output/host/usr/bin:/home/thomas/projets/buildroot/output/host/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/thomas/sys/bin:/home/thomas/.gem/ruby/2.1.0/bin" AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm" CC="/usr/bin/gcc" GCC="/usr/bin/gcc" CXX="/usr/bin/g++" CPP="/usr/bin/cpp" OBJCOPY="/usr/bin/objcopy" RANLIB="/usr/bin/ranlib" CPPFLAGS="-I/home/thomas/projets/buildroot/output/host/usr/include" CFLAGS="-O2 -I/home/thomas/projets/buildroot/output/host/usr/include" CXXFLAGS="-O2 -I/home/thomas/projets/buildroot/output/host/usr/include" LDFLAGS="-L/home/thomas/projets/buildroot/output/host/lib -L/home/thomas/projets/buildroot/output/host/usr/lib -Wl,-rpath,/home/thomas/projets/buildroot/output/ho
> st/usr/l
> ib" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG="/home/thomas/projets/buildroot/output/host/usr/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_LIBDIR="/home/thomas/projets/buildroot/output/host/usr/lib/pkgconfig:/home/thomas/projets/buildroot/output/host/usr/share/pkgconfig" INTLTOOL_PERL=/usr/bin/perl ./configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --target=arm-buildroot-linux-gnueabihf --prefix="/home/thomas/projets/buildroot/output/host/usr" --enable-local-rust --local-rust-root="/home/thomas/projets/buildroot/output/build/host-rust-1.8.0/rust-stage0" --disable-docs --disable-manage-submodules --sysconfdir="/home/thomas/projets/buildroot/output/host/etc" --localstatedir="/home/thomas/projets/buildroot/output/host/var/lib" --datadir="/home/thomas/projets/buildroot/output/host/usr/share" --infodir="/home/thomas/projets/buildroot/output/host/usr/share/info")
> configure: looking for configure programs
> configure: found program 'cmp'
> configure: found program 'mkdir'
> configure: found program 'printf'
> configure: found program 'cut'
> configure: found program 'head'
> configure: found program 'grep'
> configure: found program 'xargs'
> configure: found program 'cp'
> configure: found program 'find'
> configure: found program 'uname'
> configure: found program 'date'
> configure: found program 'tr'
> configure: found program 'sed'
> configure: found program 'file'
> configure: found program 'make'
> configure: inspecting environment
> configure: recreating config.tmp
> configure:
> configure: processing ./configure args
> configure:
> configure: CFG_DISABLE_DOCS := 1
> configure: CFG_ENABLE_LOCAL_RUST := 1
> configure: CFG_LOCALSTATEDIR := /home/thomas/projets/buildroot/outp ...
> configure: CFG_SYSCONFDIR := /home/thomas/projets/buildroot/outp ...
> configure: CFG_DATADIR := /home/thomas/projets/buildroot/outp ...
> configure: CFG_INFODIR := /home/thomas/projets/buildroot/outp ...
> configure: CFG_LLVM_ROOT :=
> configure: CFG_PYTHON :=
> configure: CFG_JEMALLOC_ROOT :=
> configure: CFG_BUILD := x86_64-pc-linux-gnu
> configure: CFG_ANDROID_CROSS_PATH :=
> configure: CFG_I686_LINUX_ANDROID_NDK :=
> configure: CFG_ARM_LINUX_ANDROIDEABI_NDK :=
> configure: CFG_AARCH64_LINUX_ANDROID_NDK :=
> configure: CFG_NACL_CROSS_PATH :=
> configure: CFG_RELEASE_CHANNEL := dev
> configure: CFG_MUSL_ROOT := /usr/local
> configure: CFG_EXTRA_FILENAME :=
> configure: CFG_DEFAULT_LINKER := cc
> configure: CFG_DEFAULT_AR := ar
> configure: CFG_LIBDIR := /home/thomas/projets/buildroot/outp ...
> configure:
> configure: validating ./configure args
> configure:
> configure: CFG_BOOTSTRAP_KEY := 23:44:24
> configure:
> configure: looking for build programs
> configure:
> configure: CFG_CURLORWGET := /usr/bin/curl (7.47.0)
> configure: CFG_PYTHON := /home/thomas/projets/buildroot/outp ...
> configure: CFG_GIT := /usr/bin/git (2.7.4)
> configure: git: no git directory. disabling submodules
> configure: CFG_MD5 :=
> configure: CFG_MD5SUM := /usr/bin/md5sum (8.25)
> configure: CFG_HASH_COMMAND := /usr/bin/md5sum | cut -c 1-8
> configure: CFG_CLANG :=
> configure: CFG_CCACHE :=
> configure: CFG_GCC := /usr/bin/gcc (5.3.1-14ubuntu2.1)
> configure: CFG_LD := /usr/bin/ld (2.26)
> configure: CFG_VALGRIND :=
> configure: CFG_PERF :=
> configure: CFG_ISCC :=
> configure: CFG_ANTLR4 :=
> configure: CFG_GRUN :=
> configure: CFG_FLEX := /usr/bin/flex (2.6.0)
> configure: CFG_BISON := /usr/bin/bison (3.0.4)
> configure: CFG_GDB := /usr/bin/gdb (7.11-0ubuntu1)
> configure: CFG_LLDB :=
> configure: CFG_DISABLE_VALGRIND_RPASS := 1
> configure: CFG_GDB_VERSION := GNU gdb (Ubuntu 7.11-0ubuntu1) 7.11
> configure:
> configure: looking for target specific programs
> configure:
> configure: CFG_ADB := /usr/bin/adb
> configure:
> configure: using rustc at: /home/thomas/projets/buildroot/output/build/host-rust-1.8.0/rust-stage0 with version: rustc 1.8.0-dev (4d3eebff9 2016-02-17)
> configure:
> configure: CFG_LOCAL_RUST_ROOT := /home/thomas/projets/buildroot/outp ...
> configure: skipping compiler inference steps; using provided CC=/usr/bin/gcc
> configure: CFG_CC := /usr/bin/gcc
> configure: CFG_CXX := /usr/bin/g++
> configure: CFG_CPP := /usr/bin/cpp
> configure: CFG_CFLAGS := -O2 -I/home/thomas/projets/buildroo ...
> configure: CFG_CXXFLAGS := -O2 -I/home/thomas/projets/buildroo ...
> configure: CFG_LDFLAGS := -L/home/thomas/projets/buildroot/ou ...
> configure: CFG_STDCPP_NAME := stdc++
> configure: error: unsupported target triples "x86_64-pc-linux-gnu" found
> package/pkg-generic.mk:185: recipe for target '/home/thomas/projets/buildroot/output/build/host-rust-1.8.0/.stamp_configured' failed
> make[1]: *** [/home/thomas/projets/buildroot/output/build/host-rust-1.8.0/.stamp_configured] Error 1
> Makefile:36: recipe for target '_all' failed
> make: *** [_all] Error 2
>
> Is this expected?
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 2/2] rust: new package
2016-06-15 22:09 ` Thomas Petazzoni
2016-06-15 22:42 ` Charles Hardin
@ 2016-06-16 20:25 ` Eric Le Bihan
1 sibling, 0 replies; 10+ messages in thread
From: Eric Le Bihan @ 2016-06-16 20:25 UTC (permalink / raw)
To: buildroot
Le Thu, 16 Jun 2016 00:09:33 +0200,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> a ?crit :
> On Sun, 24 Apr 2016 16:39:49 +0200, Eric Le Bihan wrote:
> > This new package provides the compiler for the Rust programming
> > language.
> >
> > Currently, only the host variant is built.
> >
> > The build process is as follows:
> >
> > 1. a snapshot of the Rust compiler matching the host architecture is
> > downloaded. This is rustc-stage0.
>
> OK, this one is downloaded pre-compiled. So your package should have a
> dependency on the host architecture, since the pre-compiled rust
> compilers are only available on x86 and x86_64 it seems. So you
> probably want something like:
>
> depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
OK. I will add it to rust/Config.in.host.
> > 2. rustc-stage0 is used to build rustc-stage1, which will build the
> > final Rust compiler (rust-stage2) and the standard library for
> > the host architecture.
>
> Is this all happening inside the rust build process? Because from what
> I can see in your package, you're downloading and extracting
> rustc-stage0, and then directly building rust.
Yes it is. I will reword the commit message to clarify.
> > 3. the standard library for the target architecture is build.
> >
> > The Rust compiler uses LLVM as its backend, compiled with support
> > for x86, ARM, PowerPC and MIPS architectures.
> >
> > To properly build the standard library for the target, two files are
> > needed:
> >
> > - the target configuration: a Makefile fragment telling the build
> > system about the cross-compiler and such.
> > - the target specification: a JSON file describing the target
> > architecture to the LLVM backend.
> >
> > These files are generated with a Python script which takes info
> > from the Buildroot configuration: `rust-target-gen`.
>
> It is not entirely clear to me if a separate Python script is needed,
> or if they could be generated from rust.mk directly.
Though it may be possible, it will make the Makefile more difficult to
read. Besides, Python provides more flexibility.
> > 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.
>
> So where does the glibc dependency comes from?
I will remove it. It is useless.
> > diff --git
> > a/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch
> > b/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch
> > new file mode 100644 index 0000000..a8dc151 --- /dev/null
> > +++
> > b/package/rust/0001-Harmonize-use-of-CROSS_PREFIX_-in-mk-cfg-.mk.patch
> > @@ -0,0 +1,53 @@ +From 23d9dbfb3ad4a8d5d5997738e8b1436d076898e9 Mon
> > Sep 17 00:00:00 2001 +From: Eric Le Bihan
> > <eric.le.bihan.dev@free.fr> +Date: Tue, 19 Apr 2016 10:49:20 +0200
> > +Subject: [PATCH 1/3] Harmonize use of CROSS_PREFIX_* in mk/cfg/*.mk
> > +
> > +Use CROSS_PREFIX_ in Makefile fragments for cross-compiling on
> > Linux +wherever possible.
> > +
> > +Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> > +---
> > + mk/cfg/mips-unknown-linux-gnu.mk | 9 +++++----
> > + mk/cfg/mipsel-unknown-linux-gnu.mk | 9 +++++----
> > + 2 files changed, 10 insertions(+), 8 deletions(-)
>
> Aren't those files generated by your Python script? If so, why are you
> patching the existing ones?
When invoked in target configuration generation mode, the Python script
looks for a configuration file in mk/cfg which matches the input target
(e.g. "mips-unknown-linux-gnu" for "mips-buildroot-linux-gnu"). Then it
will copy this file and update its contents. Unfortunately, all
mk/cfg/*.mk files do not follow the same template. My patches solves
this by harmonizing them, thus making the code of the Python script
simpler. I will try to upstream them.
> > diff --git a/package/rust/Config.in.host
> > b/package/rust/Config.in.host new file mode 100644
> > index 0000000..b9bbe0b
> > --- /dev/null
> > +++ b/package/rust/Config.in.host
> > @@ -0,0 +1,24 @@
> > +config BR2_PACKAGE_RUST_ARCH_SUPPORTS
> > + bool
> > + default y
> > + depends on BR2_arm || BR2_aarch64 || BR2_i386 \
> > + || BR2_mips || BR2_mipsel || BR2_x86_64
> > + depends on !BR2_ARM_CPU_ARMV4 && !BR2_ARM_CPU_ARMV5
> > +
> > +config BR2_PACKAGE_HOST_RUST
> > + bool "host rust"
>
> Normally, we wouldn't add visible Config.in options for such host
> packages, they should just be used as dependencies of target packages.
> Like we did for the host-go package recently.
OK.
> > diff --git a/package/rust/rust.hash b/package/rust/rust.hash
> > new file mode 100644
> > index 0000000..552a5fc
> > --- /dev/null
> > +++ b/package/rust/rust.hash
> > @@ -0,0 +1,5 @@
> > +# Locally calculated
> > +sha256
> > af4466147e8d4db4de2a46e07494d2dc2d96313c5b37da34237f511c905f7449
> > rustc-1.8.0-src.tar.gz +sha1
> > d29b7607d13d64078b6324aec82926fb493f59ba
> > rust-stage0-2016-02-17-4d3eebf-linux-x86_64-d29b7607d13d64078b6324aec82926fb493f59ba.tar.bz2
> > +sha1 5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7
> > rust-stage0-2016-02-17-4d3eebf-linux-i386-5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7.tar.bz2
> > +
>
> Unneeded empty line. If you're locally calculating the hashes, why not
> use sha256 for all of them?
Out of laziness, I copied the sha1, which are included in the file
names. I will use sha256 sums.
> > diff --git a/package/rust/rust.mk b/package/rust/rust.mk
> > new file mode 100644
> > index 0000000..90c9e2b
> > --- /dev/null
> > +++ b/package/rust/rust.mk
> > @@ -0,0 +1,90 @@
> > +################################################################################
> > +#
> > +# rust
> > +#
> > +################################################################################
> > +
> > +RUST_VERSION = 1.8.0
> > +RUST_SOURCE = rustc-$(RUST_VERSION)-src.tar.gz
> > +RUST_SITE = https://static.rust-lang.org/dist
> > +RUST_LICENSE = Apache-2.0, MIT
> > +RUST_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
> > +
> > +HOST_RUST_DEPENDENCIES = host-python
> > +
> > +# Taken from src/snapshots.txt
> > +HOST_RUST_SNAP_SITE = https://static.rust-lang.org/stage0-snapshots
> > +HOST_RUST_SNAP_DATE = 2016-02-17
> > +HOST_RUST_SNAP_REV = 4d3eebf
> > +
> > +ifeq ($(HOSTARCH),x86_64)
> > +HOST_RUST_SNAP_HASH = d29b7607d13d64078b6324aec82926fb493f59ba
> > +else
> > +HOST_RUST_SNAP_HASH = 5f194aa7628c0703f0fd48adc4ec7f3cc64b98c7
> > +endif
> > +
> > +HOST_RUST_SNAP_SOURCE = \
> > +
> > rust-stage0-$(HOST_RUST_SNAP_DATE)-$(HOST_RUST_SNAP_REV)-linux-$(HOSTARCH)-$(HOST_RUST_SNAP_HASH).tar.bz2
> > + +HOST_RUST_EXTRA_DOWNLOADS = \
> > + $(HOST_RUST_SNAP_SITE)/$(HOST_RUST_SNAP_SOURCE)
> > +
> > +define HOST_RUST_SNAP_EXTRACT
> > + $(call suitable-extractor,$(HOST_RUST_SNAP_SOURCE))
> > $(DL_DIR)/$(HOST_RUST_SNAP_SOURCE) | \
> > + $(TAR) -C $(@D) $(TAR_OPTIONS) -
> > +endef
> > +
> > +HOST_RUST_POST_EXTRACT_HOOKS += HOST_RUST_SNAP_EXTRACT
>
> Alternatively, downloading and installing the rustc-stage0 compiler
> could be done in a separate package, perhaps?
For Cargo, the Rust package manager, I introduced cargo-bootstrap. I
will do the same for rust, with rust-bootstrap.
> > +
> > +define HOST_RUST_GEN_CONF
> > + package/rust/rust-target-gen \
> > + --mode conf \
> > + --prefix=$(notdir $(TARGET_CROSS)) \
> > + --input $(@D) \
> > + --output $(@D)/mk/cfg/$(GNU_TARGET_NAME).mk \
> > + $(GNU_TARGET_NAME)
> > +endef
> > +
> > +define HOST_RUST_GEN_SPEC
> > + package/rust/rust-target-gen \
> > + --mode spec \
> > + --input $(@D) \
> > + --output
> > $(HOST_DIR)/etc/rustc/$(GNU_TARGET_NAME).json \
> > + $(GNU_TARGET_NAME)
> > +endef
> > +
> > +HOST_RUST_PRE_CONFIGURE_HOOKS += \
> > + HOST_RUST_GEN_CONF \
> > + HOST_RUST_GEN_SPEC
> > +
> > +HOST_RUST_MAKE_ENV = RUST_TARGET_PATH=$(HOST_DIR)/etc/rustc
> > +HOST_RUST_MAKE_OPTS = VERBOSE=1
> > +
> > +define HOST_RUST_CONFIGURE_CMDS
> > + (cd $(@D); $(HOST_CONFIGURE_OPTS) \
> > + ./configure \
> > + --host=$(GNU_HOST_NAME) \
> > + --build=$(GNU_HOST_NAME) \
> > + --target=$(GNU_TARGET_NAME) \
> > + --prefix="$(HOST_DIR)/usr" \
> > + --enable-local-rust \
> > + --local-rust-root="$(@D)/rust-stage0" \
> > + --disable-docs \
> > + --disable-manage-submodules \
> > + --sysconfdir="$(HOST_DIR)/etc" \
> > + --localstatedir="$(HOST_DIR)/var/lib" \
> > + --datadir="$(HOST_DIR)/usr/share" \
> > + --infodir="$(HOST_DIR)/usr/share/info")
>
> It's probably good to explain somewhere that the configure script is
> not an autoconf-generated configure script.
OK.
> In any case, I applied your patches, and tried to build the following
> defconfig:
>
> BR2_arm=y
> BR2_cortex_a8=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_INIT_NONE=y
> BR2_SYSTEM_BIN_SH_NONE=y
> # BR2_PACKAGE_BUSYBOX is not set
> # BR2_TARGET_ROOTFS_TAR is not set
> BR2_PACKAGE_HOST_RUST=y
>
> and it fails to build with:
>
> >>> host-rust 1.8.0 Configuring
> package/rust/rust-target-gen --mode conf
> --prefix=arm-linux-gnueabihf-
> --input /home/thomas/projets/buildroot/output/build/host-rust-1.8.0
> --output /home/thomas/projets/buildroot/output/build/host-rust-1.8.0/mk/cfg/arm-buildroot-linux-gnueabihf.mk
> arm-buildroot-linux-gnueabihf package/rust/rust-target-gen --mode
> spec
> --input /home/thomas/projets/buildroot/output/build/host-rust-1.8.0
> --output /home/thomas/projets/buildroot/output/host/etc/rustc/arm-buildroot-linux-gnueabihf.json
> arm-buildroot-linux-gnueabihf
> (cd /home/thomas/projets/buildroot/output/build/host-rust-1.8.0;
> PATH="/home/thomas/projets/buildroot/output/host/bin:/home/thomas/projets/buildroot/output/host/sbin:/home/thomas/projets/buildroot/output/host/usr/bin:/home/thomas/projets/buildroot/output/host/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/thomas/sys/bin:/home/thomas/.gem/ruby/2.1.0/bin"
> AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm"
> CC="/usr/bin/gcc" GCC="/usr/bin/gcc" CXX="/usr/bin/g++"
> CPP="/usr/bin/cpp" OBJCOPY="/usr/bin/objcopy"
> RANLIB="/usr/bin/ranlib"
> CPPFLAGS="-I/home/thomas/projets/buildroot/output/host/usr/include"
> CFLAGS="-O2 -I/home/thomas/projets/buildroot/output/host/usr/include"
> CXXFLAGS="-O2
> -I/home/thomas/projets/buildroot/output/host/usr/include"
> LDFLAGS="-L/home/thomas/projets/buildroot/output/host/lib
> -L/home/thomas/projets/buildroot/output/host/usr/lib
> -Wl,-rpath,/home/thomas/projets/buildroot/output/ho st/usr/l ib"
> PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1
> PKG_CONFIG="/home/thomas/projets/buildroot/output/host/usr/bin/pkg-config"
> PKG_CONFIG_SYSROOT_DIR="/"
> PKG_CONFIG_LIBDIR="/home/thomas/projets/buildroot/output/host/usr/lib/pkgconfig:/home/thomas/projets/buildroot/output/host/usr/share/pkgconfig"
> INTLTOOL_PERL=/usr/bin/perl ./configure --host=x86_64-pc-linux-gnu
> --build=x86_64-pc-linux-gnu --target=arm-buildroot-linux-gnueabihf
> --prefix="/home/thomas/projets/buildroot/output/host/usr"
> --enable-local-rust
> --local-rust-root="/home/thomas/projets/buildroot/output/build/host-rust-1.8.0/rust-stage0"
> --disable-docs --disable-manage-submodules
> --sysconfdir="/home/thomas/projets/buildroot/output/host/etc"
> --localstatedir="/home/thomas/projets/buildroot/output/host/var/lib"
> --datadir="/home/thomas/projets/buildroot/output/host/usr/share"
> --infodir="/home/thomas/projets/buildroot/output/host/usr/share/info")
> configure: looking for configure programs configure: found program
> 'cmp' configure: found program 'mkdir' configure: found program
> 'printf' configure: found program 'cut' configure: found program
> 'head' configure: found program 'grep' configure: found program
> 'xargs' configure: found program 'cp' configure: found program 'find'
> configure: found program 'uname' configure: found program 'date'
> configure: found program 'tr' configure: found program 'sed'
> configure: found program 'file' configure: found program 'make'
> configure: inspecting environment configure: recreating config.tmp
> configure: configure: processing ./configure args configure:
> configure: CFG_DISABLE_DOCS := 1 configure:
> CFG_ENABLE_LOCAL_RUST := 1 configure:
> CFG_LOCALSTATEDIR := /home/thomas/projets/buildroot/outp ...
> configure:
> CFG_SYSCONFDIR := /home/thomas/projets/buildroot/outp ...
> configure:
> CFG_DATADIR := /home/thomas/projets/buildroot/outp ...
> configure:
> CFG_INFODIR := /home/thomas/projets/buildroot/outp ...
> configure: CFG_LLVM_ROOT := configure: CFG_PYTHON :=
> configure: CFG_JEMALLOC_ROOT := configure: CFG_BUILD :=
> x86_64-pc-linux-gnu configure: CFG_ANDROID_CROSS_PATH := configure:
> CFG_I686_LINUX_ANDROID_NDK := configure:
> CFG_ARM_LINUX_ANDROIDEABI_NDK := configure:
> CFG_AARCH64_LINUX_ANDROID_NDK := configure: CFG_NACL_CROSS_PATH :=
> configure: CFG_RELEASE_CHANNEL := dev configure:
> CFG_MUSL_ROOT := /usr/local configure: CFG_EXTRA_FILENAME :=
> configure: CFG_DEFAULT_LINKER := cc configure:
> CFG_DEFAULT_AR := ar configure:
> CFG_LIBDIR := /home/thomas/projets/buildroot/outp ...
> configure: configure: validating ./configure args configure:
> configure: CFG_BOOTSTRAP_KEY := 23:44:24 configure: configure:
> looking for build programs configure: configure:
> CFG_CURLORWGET := /usr/bin/curl (7.47.0) configure:
> CFG_PYTHON := /home/thomas/projets/buildroot/outp ...
> configure: CFG_GIT := /usr/bin/git (2.7.4) configure:
> git: no git directory. disabling submodules configure:
> CFG_MD5 := configure:
> CFG_MD5SUM := /usr/bin/md5sum (8.25) configure:
> CFG_HASH_COMMAND := /usr/bin/md5sum | cut -c 1-8 configure:
> CFG_CLANG := configure: CFG_CCACHE := configure:
> CFG_GCC := /usr/bin/gcc (5.3.1-14ubuntu2.1) configure:
> CFG_LD := /usr/bin/ld (2.26) configure:
> CFG_VALGRIND := configure: CFG_PERF := configure:
> CFG_ISCC := configure: CFG_ANTLR4 := configure:
> CFG_GRUN := configure:
> CFG_FLEX := /usr/bin/flex (2.6.0) configure:
> CFG_BISON := /usr/bin/bison (3.0.4) configure:
> CFG_GDB := /usr/bin/gdb (7.11-0ubuntu1) configure:
> CFG_LLDB := configure: CFG_DISABLE_VALGRIND_RPASS := 1
> configure: CFG_GDB_VERSION := GNU gdb (Ubuntu 7.11-0ubuntu1)
> 7.11 configure: configure: looking for target specific programs
> configure: configure: CFG_ADB := /usr/bin/adb configure:
> configure: using rustc
> at: /home/thomas/projets/buildroot/output/build/host-rust-1.8.0/rust-stage0
> with version: rustc 1.8.0-dev (4d3eebff9 2016-02-17) configure:
> configure:
> CFG_LOCAL_RUST_ROOT := /home/thomas/projets/buildroot/outp ...
> configure: skipping compiler inference steps; using provided
> CC=/usr/bin/gcc configure: CFG_CC := /usr/bin/gcc
> configure: CFG_CXX := /usr/bin/g++ configure:
> CFG_CPP := /usr/bin/cpp configure:
> CFG_CFLAGS := -O2 -I/home/thomas/projets/buildroo ...
> configure: CFG_CXXFLAGS := -O2
> -I/home/thomas/projets/buildroo ... configure:
> CFG_LDFLAGS := -L/home/thomas/projets/buildroot/ou ...
> configure: CFG_STDCPP_NAME := stdc++ configure: error:
> unsupported target triples "x86_64-pc-linux-gnu" found
> package/pkg-generic.mk:185: recipe for target
> '/home/thomas/projets/buildroot/output/build/host-rust-1.8.0/.stamp_configured'
> failed make[1]: ***
> [/home/thomas/projets/buildroot/output/build/host-rust-1.8.0/.stamp_configured]
> Error 1 Makefile:36: recipe for target '_all' failed make: *** [_all]
> Error 2
>
> Is this expected?
Of course, not! The commit b571dbf introduced a new version of
support/gnuconfig/config.guess which outputs "x86_64-pc-linux-gnu" as
$(GNU_HOST_NAME). The ./configure script only supports
"*-unknown-linux-*". Removing the --host=$(GNU_HOST_NAME) and
--build=$(GNU_HOST_NAME) options in the Makefile solves the issue,
as the ./configure will compute the values on its own.
Regards,
--
ELB
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 2/2] rust: new package
2016-06-15 22:42 ` Charles Hardin
@ 2016-06-16 20:31 ` Eric Le Bihan
0 siblings, 0 replies; 10+ messages in thread
From: Eric Le Bihan @ 2016-06-16 20:31 UTC (permalink / raw)
To: buildroot
Hi!
Le Wed, 15 Jun 2016 15:42:13 -0700,
Charles Hardin <ckhardin@exablox.com> a ?crit :
> We are already building rust 1.9.0 derived from Eric?s patches - he
> updated them a bit ago and we modified them slightly.
>
> I haven?t tried to post any other patches since I don?t want to
> confuse the issue with our changes on his changes on buildroot
> changes.
A new version of the patch series, with support for Rust 1.9.0, will be
posted shortly. Feel free to comment/review it when available.
> BTW - I would also really want to know what the proper method is for
> making an EXTERNAL rust toolchain option because that llvm compiles
> is at least 5 expressos long and by the time it is down - well the
> hands just jitter.
Maybe we could introduce a virtual package named "rust-toolchain". Then
there will be two packages which provides it:
- rust: build Rust from source
- rust-external: download the official pre-built release or use one
provided by the user.
Regards,
--
ELB
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 1/2] python: enable bzip2 in host variant
2016-06-15 22:01 ` Thomas Petazzoni
@ 2016-06-16 20:43 ` Eric Le Bihan
2016-06-16 20:55 ` Thomas Petazzoni
0 siblings, 1 reply; 10+ messages in thread
From: Eric Le Bihan @ 2016-06-16 20:43 UTC (permalink / raw)
To: buildroot
Le Thu, 16 Jun 2016 00:01:31 +0200,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com> a ?crit :
> On Sun, 24 Apr 2016 16:39:48 +0200, Eric Le Bihan wrote:
> > Enable support for bzip2 in Python host variant, so the tarfile
> > module works properly.
> >
> > Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
>
> Could you give some more details about this? The tarfile module seems
> to only import the bz2 module when a bzip2-compressed file is handled.
> Is this actually the case with rust?
This was required because my initial take on Rust let the build process
download the rust-stage0 bzip2 tarball and uncompress it on its own. As
the bootstrap binary will now be provided by the rust-bootstrap
package, this is not needed anymore.
> Indeed, host-python is used by numerous packages, and we're trying to
> not add too many dependencies to host-python. On the other hand,
> building bzip2 is pretty fast, so maybe it's reasonable to add it as a
> mandatory dependency of host-python.
bz2 tarballs are widespread. So having support for this format in
host-python, regardless of Rust, will benefit the user.
Regards,
--
ELB
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] [PATCH 1/2] python: enable bzip2 in host variant
2016-06-16 20:43 ` Eric Le Bihan
@ 2016-06-16 20:55 ` Thomas Petazzoni
0 siblings, 0 replies; 10+ messages in thread
From: Thomas Petazzoni @ 2016-06-16 20:55 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 16 Jun 2016 22:43:40 +0200, Eric Le Bihan wrote:
> > Could you give some more details about this? The tarfile module seems
> > to only import the bz2 module when a bzip2-compressed file is handled.
> > Is this actually the case with rust?
>
> This was required because my initial take on Rust let the build process
> download the rust-stage0 bzip2 tarball and uncompress it on its own. As
> the bootstrap binary will now be provided by the rust-bootstrap
> package, this is not needed anymore.
OK, great!
> > Indeed, host-python is used by numerous packages, and we're trying to
> > not add too many dependencies to host-python. On the other hand,
> > building bzip2 is pretty fast, so maybe it's reasonable to add it as a
> > mandatory dependency of host-python.
>
> bz2 tarballs are widespread. So having support for this format in
> host-python, regardless of Rust, will benefit the user.
host-python is only meant to be used as a dependency to build other
things in Buildroot. As long as these "other things" don't need bz2
support in Python, there's no reason to enable it.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2016-06-16 20:55 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-24 14:39 [Buildroot] [PATCH 0/2] Add support for Rust programming language Eric Le Bihan
2016-04-24 14:39 ` [Buildroot] [PATCH 1/2] python: enable bzip2 in host variant Eric Le Bihan
2016-06-15 22:01 ` Thomas Petazzoni
2016-06-16 20:43 ` Eric Le Bihan
2016-06-16 20:55 ` Thomas Petazzoni
2016-04-24 14:39 ` [Buildroot] [PATCH 2/2] rust: new package Eric Le Bihan
2016-06-15 22:09 ` Thomas Petazzoni
2016-06-15 22:42 ` Charles Hardin
2016-06-16 20:31 ` Eric Le Bihan
2016-06-16 20:25 ` Eric Le Bihan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox