Giter Club home page Giter Club logo

rust-on-raspberry-docker's Introduction

DockerHub

Github Sponsor Donate

Updates

Beginning with Rust version 1.78.0 the docker images will be based on Debian bookworm. Please report any issues you have with this update in the issue section of this repo.

Cross compiling with Docker

The native process, as described in https://github.com/Ogeon/rust-on-raspberry-pi, for cross-compiling for the Raspberry Pi sets some environment variables and writes to config files on your host machine. Thus it can be difficult to remember these changes when you want to remove or upgrade the cross compiler or even repeat that process for different versions of rust on the same machine.

To make cross-compiling Rust code for the Raspberry easier you can use the Docker image as build from the code in this repository for building your rust code but.

Basically the steps for cross compiling your project with the help of docker look like:

  1. Pulling the Docker image from the dockerhub
  2. Running a Docker container from that Docker image which takes your rust project (and it's platform dependencies) and then cross compiles it

You can optionally build the docker image yourself. This may be necessary if depend on stuff that is not in the image provided on the dockerhub. See section "Building your own Docker image" for a detailed instruction on how to build the image yourself.

Cross compiling your project with the image from the dockerhub

You need to pull the image first from the dockerhub (assuming you have docker installed):

docker pull ragnaroek/rust-raspberry:<version>

where <version> is the Rust compiler version. The docker images are provided starting from version 1.12.0.

If you successfully pulled the Docker image containing the cross compiler, you can cross compile your project:

$ docker run \
    --volume <path to your rust project directory>:/home/cross/project \
    --volume <path to directory containing the platform dependencies>:/home/cross/deb-deps \ # optional, see section "Platform dependencies"
    --volume <path to local cargo registry, e.g. ~/.cargo/registry>:/home/cross/.cargo/registry \ # optional, using cached registry avoids updating on every build
    ragnaroek/rust-raspberry:<version>
    <cargo command> # e.g. "build --release"

The compiled project can then be found in your target directory.

Platform dependencies (optional)

NOTE: Only Raspbian .deb files are supported currently (but we appreciate patches for other formats)

Let's say your project uses some crate that depends on having openssl installed on the system. In this case you have download the corresponding Raspbian .deb packages into a folder on your host system and then mount this directory into your docker container (See section "Cross compiling your project ...").

Get these packages either from the raspberry, or download them online.

Using apt-get to fetch packages

From a debian-based system, you may use apt-get in order to fetch packages directly from the raspbian archives. A script is provided for these purposes in the apt/ folder.

Here is how you would download libssl1.0 and all of its dependencies.

$ cd apt/
# Install the raspbian keys into your local apt keychain
$ sudo ./install-keys.sh
$ ./download.sh libssl1.0

You can also download a single deb file without recursing:

apt-get -c ./apt.conf download libssl1.0

If ran multiple times, only missing packages will be downloaded.

Adding files manually

If you do apt-cache show libssl1.0 on the raspberry, you'll see this in the output:

Filename:    pool/main/o/openssl/libssl1.0.0_1.0.1e-2+rvt+deb7u17_armhf.deb

You should be able to find a match for that under ftp.debian.org/debian/pool, so the resulting URL in this case is

http://ftp.debian.org/debian/pool/main/o/openssl/libssl-dev_1.0.1e-2+deb7u17_armhf.deb

If it's not there, see if it is still on the raspberry under /var/cache/apt/archive.

If you still can't find it, try searching for the filename online.

Additional build setup script

In order to setup the environment or do other additional processing you can define a script post-install.sh in your folder with dependencies. This script will be source-d in the shell used to do the build, so any environment variables you export will be available to the cargo process.

This script will take two arguments:

- the first argument is SYSROOT, the folder where all the cross compile headers and libraries
  are present
- the second argument is your dependency folder, you can process any non debian dependencies you
  may have pre-downloaded there

Cross compiling C dependencies

Your project may directly or indirectly depend on C libraries. The cc crate is a common approach used in the ecosystem to compile C libraries. Please see its documentation, and possibly implementation, for how to set the right environment variables.

Also note that cargo and rustc will compile code for two environments:

- the build scripts are compiled in the context of the host environment (x86\_64)
- your code is compiled for armv7 (a 32 bit environment)

When changing the environment variables you must ensure that you keep both environments working.

Building your own Docker image

$ git clone https://github.com/Ragnaroek/rust-on-raspberry-docker
$ cd rust-on-raspberry-pi/docker
$ docker build \
    --build-arg PI_TOOLS_GIT_REF=<branch/tag/commit> \ # defaults to "master"
    --build-arg RUST_VERSION=<rustup version stable/beta/nightly> \ # defaults to "stable"
    --tag <tag for your docker image> \ # e.g. "rust-nightly-pi-cross"
    .

By setting different tags for your Docker image and RUST_VERSION you could easily build images for different version of rust and use them as need.

Cross-compiling with your own build image works exactly as with the one pulled from the dockerhub. Just replace ragnaroek/rust-raspberry:<version> with your own image name.

Credits and History

The initial docker image was written by schnupperboy and maintained by Ogeon. This repository contains a copy of the docker part that originally lived in this repository: https://github.com/Ogeon/rust-on-raspberry-pi

rust-on-raspberry-docker's People

Contributors

0xmichalis avatar mibo-fdc avatar mrene avatar ragnaroek avatar reitermarkus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rust-on-raspberry-docker's Issues

Transient platform dependencies

Hi,
My project is depended from libSDL2, and SDL2 depended from about 20 libraries and so on. Should I download full debs tree with appropriate versions ? Or there is a workaround for only top library.
I've tried with only libSDL2 but got a lot of undefined references.
I've downloaded all and got versions compatibilities hell.

Missing tag "latest" on Docker Hub

When I run docker pull ragnaroek/rust-raspberry I get this output:

Using default tag: latest
Error response from daemon: manifest for ragnaroek/rust-raspberry:latest not found

But when I run docker pull ragnaroek/rust-raspberry:1.35.0, I get this:

1.35.0: Pulling from ragnaroek/rust-raspberry
54f7e8ac135a: Pull complete 
885c0b4fd66c: Pull complete 
cdbc3db6e854: Pull complete 
8c34a7206a14: Pull complete 
c303375c1f05: Pull complete 
2d665c6cfde0: Pull complete 
cf886326598e: Pull complete 
038e2e640eb5: Pull complete 
38788142a5dc: Pull complete 
21d2df2afdb2: Pull complete 
0f79ac094be2: Pull complete 
ba6e41ccd8e7: Pull complete 
Digest: sha256:b0cbf0c1bb3bd336ec31a380f89e4bb483d7b67f8273ed7a0470f9e8889adf86
Status: Downloaded newer image for ragnaroek/rust-raspberry:1.35.0

Problem building OpenSSL

Hi!

I want to compile a rust application from a windows 10 machine targeting my "raspberry pi 3 model b" device. I've tried to follow the instructions to my best ability but have not been able to get it to get past compilation of "openssl-sys v0.9.39".

I've tried to follow the instructions about Platform dependencies and found a few interesting *.deb on my raspberry pi device in the "/var/cache/apt/**" directory:

  • libssl1.1_1.1.0j-1~deb9u1_armhf.deb
  • libssl-dev_1.1.0j-1~deb9u1_armhf.deb
  • openssl_1.1.0j-1~deb9u1_armhf.deb

I hope you might be able to point me in the right direction.

Below is a log of where the compilation fails:

C:\>docker run --volume c:\git\2.Hemma\iot_amp:/home/cross/project --volume c:\git\2.Hemma\deb:/home/cross/deb-deps ragnaroek/rust-raspberry:1.31.0 build
*** Extracting target dependencies ***
Extracting: /home/cross/deb-deps/libssl-dev_1.1.0j-1~deb9u1_armhf.deb
Extracting: /home/cross/deb-deps/libssl1.1_1.1.0j-1~deb9u1_armhf.deb
Extracting: /home/cross/deb-deps/openssl_1.1.0j-1~deb9u1_armhf.deb

*** Cross compiling project ***
    Updating crates.io index
    Updating git repository `https://github.com/mozilla-iot/webthing-rust`
 Downloading crates ...
  Downloaded uuid v0.7.1
  Downloaded env_logger v0.5.13
  Downloaded serial v0.4.0
  Downloaded actix-web v0.7.14
  Downloaded chrono v0.4.6
  Downloaded get_if_addrs v0.5.3
  Downloaded serde_json v1.0.33
  Downloaded libmdns v0.2.3
  Downloaded actix-net v0.2.4
  Downloaded hostname v0.1.5
  Downloaded valico v2.3.0
  Downloaded openssl v0.10.15
  Downloaded itoa v0.4.3
  Downloaded serial-core v0.4.0
  Downloaded termcolor v1.0.4
  Downloaded time v0.1.40
  Downloaded failure v0.1.3
  Downloaded tokio-current-thread v0.1.4
  Downloaded sha1 v0.6.0
  Downloaded tokio-reactor v0.1.7
  Downloaded byteorder v1.2.7
  Downloaded parking_lot v0.6.4
  Downloaded http v0.1.14
  Downloaded askama_escape v0.1.0
  Downloaded tower-service v0.1.0
  Downloaded libc v0.2.44
  Downloaded atty v0.2.11
  Downloaded futures-cpupool v0.1.8
  Downloaded c_linked_list v1.1.1
  Downloaded h2 v0.1.13
  Downloaded tokio-tcp v0.1.2
  Downloaded language-tags v0.2.2
  Downloaded trust-dns-resolver v0.10.0
  Downloaded version_check v0.1.5
  Downloaded actix v0.7.7
  Downloaded rand v0.5.5
  Downloaded log v0.4.6
  Downloaded flate2 v1.0.5
  Downloaded serde_urlencoded v0.5.4
  Downloaded net2 v0.2.33
  Downloaded mio v0.6.16
  Downloaded serde v1.0.80
  Downloaded brotli2 v0.3.2
  Downloaded tokio-core v0.1.17
  Downloaded multimap v0.4.0
  Downloaded serial-unix v0.4.0
  Downloaded tokio-io v0.1.10
  Downloaded regex v1.0.6
  Downloaded tokio-openssl v0.2.1
  Downloaded smallvec v0.6.6
  Downloaded humantime v1.2.0
  Downloaded encoding v0.2.33
  Downloaded tokio v0.1.13
  Downloaded base64 v0.10.0
  Downloaded tokio-timer v0.2.8
  Downloaded trust-dns-proto v0.5.0
  Downloaded tokio-codec v0.1.1
  Downloaded slab v0.4.1
  Downloaded bitflags v1.0.4
  Downloaded mime_guess v2.0.0-alpha.6
  Downloaded url v1.7.2
  Downloaded mime v0.3.12
  Downloaded quick-error v1.2.2
  Downloaded nix v0.10.0
  Downloaded num-traits v0.2.6
  Downloaded bytes v0.4.11
  Downloaded ryu v0.2.7
  Downloaded httparse v1.3.3
  Downloaded lazy_static v1.2.0
  Downloaded cookie v0.11.0
  Downloaded num-integer v0.1.39
  Downloaded futures v0.1.25
  Downloaded lazycell v1.2.0
  Downloaded termios v0.2.2
  Downloaded aho-corasick v0.6.9
  Downloaded num_cpus v1.8.0
  Downloaded phf_codegen v0.7.23
  Downloaded encoding-index-simpchinese v1.20141219.5
  Downloaded tokio-threadpool v0.1.9
  Downloaded backtrace v0.3.9
  Downloaded fnv v1.0.6
  Downloaded dtoa v0.4.3
  Downloaded scoped-tls v0.1.2
  Downloaded percent-encoding v1.0.1
  Downloaded base64 v0.9.3
  Downloaded utf8-ranges v1.0.2
  Downloaded unicase v1.4.2
  Downloaded phf v0.7.23
  Downloaded encoding-index-tradchinese v1.20141219.5
  Downloaded traitobject v0.0.3
  Downloaded iovec v0.1.2
  Downloaded tokio-signal v0.2.7
  Downloaded brotli-sys v0.3.2
  Downloaded rand_core v0.2.2
  Downloaded resolv-conf v0.6.1
  Downloaded cfg-if v0.1.6
  Downloaded thread_local v0.3.6
  Downloaded memchr v2.1.1
  Downloaded tokio-uds v0.2.4
  Downloaded idna v0.1.5
  Downloaded openssl-sys v0.9.39
  Downloaded indexmap v1.0.2
  Downloaded unreachable v1.0.0
  Downloaded actix_derive v0.3.2
  Downloaded miniz-sys v0.1.11
  Downloaded unicase v2.2.0
  Downloaded parking_lot_core v0.3.1
  Downloaded ring v0.13.5
  Downloaded jsonway v2.0.0
  Downloaded typeable v0.1.2
  Downloaded tokio-fs v0.1.4
  Downloaded encoding-index-korean v1.20141219.5
  Downloaded foreign-types v0.3.2
  Downloaded lru-cache v0.1.1
  Downloaded void v1.0.2
  Downloaded encoding-index-japanese v1.20141219.5
  Downloaded tokio-executor v0.1.5
  Downloaded socket2 v0.3.8
  Downloaded string v0.1.2
  Downloaded lock_api v0.1.5
  Downloaded matches v0.1.8
  Downloaded lazy_static v0.2.11
  Downloaded encoding-index-singlebyte v1.20141219.5
  Downloaded ioctl-rs v0.1.6
  Downloaded flate2-crc v0.1.1
  Downloaded crossbeam-utils v0.6.1
  Downloaded crossbeam-channel v0.2.6
  Downloaded tokio-udp v0.1.3
  Downloaded regex-syntax v0.6.3
  Downloaded phf_generator v0.7.23
  Downloaded encoding_index_tests v0.1.4
  Downloaded scopeguard v0.3.3
  Downloaded mio-uds v0.6.7
  Downloaded phf_shared v0.7.23
  Downloaded failure_derive v0.1.3
  Downloaded safemem v0.3.0
  Downloaded signal-hook v0.1.6
  Downloaded linked-hash-map v0.4.2
  Downloaded rustc_version v0.2.3
  Downloaded unicode-normalization v0.1.7
  Downloaded proc-macro2 v0.4.24
  Downloaded untrusted v0.6.2
  Downloaded foreign-types-shared v0.1.1
  Downloaded pkg-config v0.3.14
  Downloaded rand_core v0.3.0
  Downloaded rustc-demangle v0.1.9
  Downloaded backtrace-sys v0.1.24
  Downloaded cc v1.0.25
  Downloaded owning_ref v0.4.0
  Downloaded syn v0.15.22
  Downloaded quote v0.6.10
  Downloaded unicode-bidi v0.3.4
  Downloaded crossbeam-deque v0.6.2
  Downloaded rand v0.6.1
  Downloaded ucd-util v0.1.3
  Downloaded siphasher v0.2.3
  Downloaded synstructure v0.10.1
  Downloaded unicode-xid v0.1.0
  Downloaded semver v0.9.0
  Downloaded stable_deref_trait v1.1.1
  Downloaded arc-swap v0.3.6
  Downloaded crossbeam-utils v0.5.0
  Downloaded rand_xorshift v0.1.0
  Downloaded crossbeam-epoch v0.6.1
  Downloaded rand_hc v0.1.0
  Downloaded rand_pcg v0.1.1
  Downloaded rand_isaac v0.1.1
  Downloaded semver-parser v0.7.0
  Downloaded arrayvec v0.4.8
  Downloaded memoffset v0.2.1
  Downloaded nodrop v0.1.13
  Downloaded rand_chacha v0.1.0
   Compiling proc-macro2 v0.4.24
   Compiling flate2-crc v0.1.1
   Compiling openssl-sys v0.9.39
error: failed to run custom build command for `openssl-sys v0.9.39`
process didn't exit successfully: `/home/cross/project/target/debug/build/openssl-sys-0f399f3f9d2c27a6/build-script-main` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=ARM_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_LIB_DIR
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
cargo:rerun-if-env-changed=ARM_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_INCLUDE_DIR
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
cargo:rerun-if-env-changed=ARM_UNKNOWN_LINUX_GNUEABIHF_OPENSSL_DIR
cargo:rerun-if-env-changed=OPENSSL_DIR
run pkg_config fail: "Cross compilation detected. Use PKG_CONFIG_ALLOW_CROSS=1 to override"

--- stderr
thread 'main' panicked at '

Could not find directory of OpenSSL installation, and this `-sys` crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
compilation process.

Make sure you also have the development packages of openssl installed.
For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

If you're in a situation where you think the directory *should* be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.

    $HOST = x86_64-unknown-linux-gnu
    $TARGET = arm-unknown-linux-gnueabihf
    openssl-sys = 0.9.39


It looks like you're compiling on Linux and also targeting Linux. Currently this
requires the `pkg-config` utility to find OpenSSL but unfortunately `pkg-config`
could not be found. If you have OpenSSL installed you can likely fix this by
installing `pkg-config`.

', /home/cross/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.39/build/main.rs:269:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed

rustc 1.16.0

Hi there!

Could you potentially publish an update for the latest stable (1.16.0 as of yesterday)?

Thanks so much for making this available. This has been super useful!

Problem compiling using Windows 10

Tried using the image to compile an application using windows 10.

Any clue why this fails?

C:\git>cargo new apa
     Created binary (application) `apa` package

C:\git>cd apa

C:\git\apa>docker run --volume c:\git\apa:/home/cross/project ragnaroek/rust-raspberry:1.31.0 build --release
*** Extracting target dependencies ***

*** Cross compiling project ***
error: could not find `Cargo.toml` in `/home/cross/project` or any parent directory

Build of openssl fails even after installing all the dependencies

The openssl crate requires both openssl_1.1.1c-1_armhf.deb and libssl-dev_1.1.1c-1_armhf.deb, but even after installing both of them the build fails.

Caused by:
  process didn't exit successfully: `/home/cross/project/target/release/build/openssl-sys-673a1f869575f15f/build-script-main` (exit code: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
run pkg_config fail: "`\"pkg-config\" \"--libs\" \"--cflags\" \"openssl\"` did not exit successfully: exit code: 1\n--- stderr\nPackage openssl was not found in the pkg-config search path.\nPerhaps you should add the directory containing `openssl.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'openssl\' found\n"

--- stderr
thread 'main' panicked at '

Could not find directory of OpenSSL installation, and this `-sys` crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
compilation process.

Make sure you also have the development packages of openssl installed.
For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

If you're in a situation where you think the directory *should* be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.

$HOST = x86_64-unknown-linux-gnu
$TARGET = x86_64-unknown-linux-gnu
openssl-sys = 0.9.48

', /home/cross/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.48/build/find_normal.rs:150:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

Wrong -m64 flag when using tflite as a dependency

I've added tflite 0.4 as a dependency to my working cross project. When I try to cross-compile I get the error below.

This could be related to dlecan/rust-crosscompiler-arm#14. Unfortunately the solution there cannot be applied directly to ragnaroek/rust-raspberry, possibly because the entry point is different.

1.36.1: Pulling from ragnaroek/rust-raspberry
Digest: sha256:636a62bccc121108de8eafeb86aafbefdb9c0749028946520f43cbfc7b06747f
Status: Image is up to date for ragnaroek/rust-raspberry:1.36.1
docker.io/ragnaroek/rust-raspberry:1.36.1
*** Extracting target dependencies ***

*** Cross compiling project ***
    Updating crates.io index
   Compiling tokio-executor v0.1.8
   Compiling crossbeam-queue v0.1.2
   Compiling backtrace-sys v0.1.31
   Compiling miniz-sys v0.1.12
error: failed to run custom build command for `miniz-sys v0.1.12`

Caused by:
  process didn't exit successfully: `/home/cross/project/target/release/build/miniz-sys-f1124c07cd5815bc/build-script-build` (exit code: 1)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = Some("/home/cross/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
running: "/home/cross/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-fvisibility=hidden" "-DMINIZ_NO_STDIO" "-DMINIZ_NO_ARCHIVE_APIS" "-DMINIZ_NO_ARCHIVE_WRITING_APIS" "-DMINIZ_NO_TIME" "-DMINIZ_NO_ZLIB_COMPATIBLE_NAMES" "-o" "/home/cross/project/target/release/build/miniz-sys-8144e5101d076a4f/out/miniz.o" "-c" "miniz.c"
cargo:warning=arm-linux-gnueabihf-gcc: error: unrecognized command line option '-m64'
exit code: 1

--- stderr


error occurred: Command "/home/cross/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-fvisibility=hidden" "-DMINIZ_NO_STDIO" "-DMINIZ_NO_ARCHIVE_APIS" "-DMINIZ_NO_ARCHIVE_WRITING_APIS" "-DMINIZ_NO_TIME" "-DMINIZ_NO_ZLIB_COMPATIBLE_NAMES" "-o" "/home/cross/project/target/release/build/miniz-sys-8144e5101d076a4f/out/miniz.o" "-c" "miniz.c" with args "gcc-sysroot" did not execute successfully (status code exit code: 1).



warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `backtrace-sys v0.1.31`

Caused by:
  process didn't exit successfully: `/home/cross/project/target/release/build/backtrace-sys-f30068047c5a6f04/build-script-build` (exit code: 1)
--- stdout
cargo:rustc-cfg=rbt
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
HOST = Some("x86_64-unknown-linux-gnu")
CC_x86_64-unknown-linux-gnu = None
CC_x86_64_unknown_linux_gnu = None
HOST_CC = None
CC = Some("/home/cross/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
running: "/home/cross/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/libbacktrace" "-I" "/home/cross/project/target/release/build/backtrace-sys-4e3d2da2d573a150/out" "-fvisibility=hidden" "-DBACKTRACE_ELF_SIZE=64" "-DBACKTRACE_SUPPORTED=1" "-DBACKTRACE_USES_MALLOC=1" "-DBACKTRACE_SUPPORTS_THREADS=0" "-DBACKTRACE_SUPPORTS_DATA=0" "-DHAVE_DL_ITERATE_PHDR=1" "-D_GNU_SOURCE=1" "-D_LARGE_FILES=1" "-Dbacktrace_full=__rbt_backtrace_full" "-Dbacktrace_dwarf_add=__rbt_backtrace_dwarf_add" "-Dbacktrace_initialize=__rbt_backtrace_initialize" "-Dbacktrace_pcinfo=__rbt_backtrace_pcinfo" "-Dbacktrace_syminfo=__rbt_backtrace_syminfo" "-Dbacktrace_get_view=__rbt_backtrace_get_view" "-Dbacktrace_release_view=__rbt_backtrace_release_view" "-Dbacktrace_alloc=__rbt_backtrace_alloc" "-Dbacktrace_free=__rbt_backtrace_free" "-Dbacktrace_vector_finish=__rbt_backtrace_vector_finish" "-Dbacktrace_vector_grow=__rbt_backtrace_vector_grow" "-Dbacktrace_vector_release=__rbt_backtrace_vector_release" "-Dbacktrace_close=__rbt_backtrace_close" "-Dbacktrace_open=__rbt_backtrace_open" "-Dbacktrace_print=__rbt_backtrace_print" "-Dbacktrace_simple=__rbt_backtrace_simple" "-Dbacktrace_qsort=__rbt_backtrace_qsort" "-Dbacktrace_create_state=__rbt_backtrace_create_state" "-Dbacktrace_uncompress_zdebug=__rbt_backtrace_uncompress_zdebug" "-Dmacho_get_view=__rbt_macho_get_view" "-Dmacho_symbol_type_relevant=__rbt_macho_symbol_type_relevant" "-Dmacho_get_commands=__rbt_macho_get_commands" "-Dmacho_try_dsym=__rbt_macho_try_dsym" "-Dmacho_try_dwarf=__rbt_macho_try_dwarf" "-Dmacho_get_addr_range=__rbt_macho_get_addr_range" "-Dmacho_get_uuid=__rbt_macho_get_uuid" "-Dmacho_add=__rbt_macho_add" "-Dmacho_add_symtab=__rbt_macho_add_symtab" "-Dmacho_file_to_host_u64=__rbt_macho_file_to_host_u64" "-Dmacho_file_to_host_u32=__rbt_macho_file_to_host_u32" "-Dmacho_file_to_host_u16=__rbt_macho_file_to_host_u16" "-o" "/home/cross/project/target/release/build/backtrace-sys-4e3d2da2d573a150/out/src/libbacktrace/alloc.o" "-c" "src/libbacktrace/alloc.c"
cargo:warning=arm-linux-gnueabihf-gcc: error: unrecognized command line option '-m64'
exit code: 1

--- stderr


error occurred: Command "/home/cross/pi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/gcc-sysroot" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "src/libbacktrace" "-I" "/home/cross/project/target/release/build/backtrace-sys-4e3d2da2d573a150/out" "-fvisibility=hidden" "-DBACKTRACE_ELF_SIZE=64" "-DBACKTRACE_SUPPORTED=1" "-DBACKTRACE_USES_MALLOC=1" "-DBACKTRACE_SUPPORTS_THREADS=0" "-DBACKTRACE_SUPPORTS_DATA=0" "-DHAVE_DL_ITERATE_PHDR=1" "-D_GNU_SOURCE=1" "-D_LARGE_FILES=1" "-Dbacktrace_full=__rbt_backtrace_full" "-Dbacktrace_dwarf_add=__rbt_backtrace_dwarf_add" "-Dbacktrace_initialize=__rbt_backtrace_initialize" "-Dbacktrace_pcinfo=__rbt_backtrace_pcinfo" "-Dbacktrace_syminfo=__rbt_backtrace_syminfo" "-Dbacktrace_get_view=__rbt_backtrace_get_view" "-Dbacktrace_release_view=__rbt_backtrace_release_view" "-Dbacktrace_alloc=__rbt_backtrace_alloc" "-Dbacktrace_free=__rbt_backtrace_free" "-Dbacktrace_vector_finish=__rbt_backtrace_vector_finish" "-Dbacktrace_vector_grow=__rbt_backtrace_vector_grow" "-Dbacktrace_vector_release=__rbt_backtrace_vector_release" "-Dbacktrace_close=__rbt_backtrace_close" "-Dbacktrace_open=__rbt_backtrace_open" "-Dbacktrace_print=__rbt_backtrace_print" "-Dbacktrace_simple=__rbt_backtrace_simple" "-Dbacktrace_qsort=__rbt_backtrace_qsort" "-Dbacktrace_create_state=__rbt_backtrace_create_state" "-Dbacktrace_uncompress_zdebug=__rbt_backtrace_uncompress_zdebug" "-Dmacho_get_view=__rbt_macho_get_view" "-Dmacho_symbol_type_relevant=__rbt_macho_symbol_type_relevant" "-Dmacho_get_commands=__rbt_macho_get_commands" "-Dmacho_try_dsym=__rbt_macho_try_dsym" "-Dmacho_try_dwarf=__rbt_macho_try_dwarf" "-Dmacho_get_addr_range=__rbt_macho_get_addr_range" "-Dmacho_get_uuid=__rbt_macho_get_uuid" "-Dmacho_add=__rbt_macho_add" "-Dmacho_add_symtab=__rbt_macho_add_symtab" "-Dmacho_file_to_host_u64=__rbt_macho_file_to_host_u64" "-Dmacho_file_to_host_u32=__rbt_macho_file_to_host_u32" "-Dmacho_file_to_host_u16=__rbt_macho_file_to_host_u16" "-o" "/home/cross/project/target/release/build/backtrace-sys-4e3d2da2d573a150/out/src/libbacktrace/alloc.o" "-c" "src/libbacktrace/alloc.c" with args "gcc-sysroot" did not execute successfully (status code exit code: 1).



warning: build failed, waiting for other jobs to finish...
error: build failed

Update debian release

Compiling a rust program that depends on the ring crate fails with the following error:

/home/cross/project/target/arm-unknown-linux-gnueabihf/release/deps/libring-2ca5101b10054897.rlib(ring-2ca5101b10054897.ring.cklkti8e-cgu.4.rcgu.o): In function spin::once::Once$LT$T$GT$::call_once::h2af17645f2763809':
ring.cklkti8e-cgu.4:(.text._ZN4spin4once13Once$LT$T$GT$9call_once17h2af17645f2763809E+0x74): undefined reference to getauxval' ring.cklkti8e-cgu.4:(.text._ZN4spin4once13Once$LT$T$GT$9call_once17h2af17645f2763809E+0x84): undefined reference to getauxval'
collect2: error: ld returned 1 exit status`

I am not sure 100% what the issue is but on my Raspberry Pi (with /etc/debian_version -> 10) the getauxval symbol seems to be defined in ./arm-linux-gnueabihf/libc-2.28.so. When I run a shell in the container it looks like it's using libc-2.13.so.

Any thoughts?

Compiling application fails

Hi,

I believe I managed to setup the docker container correctly. When trying to compile my app however, I get following error. Any guidance?

Toms-iMac:Rust tompijls$ docker run --volume /Users/tompijls/Documents/Rust/kettler/:/home/cross/project --volume /Users/tompijls/Documents/Rust/cross/:/home/cross/deb-deps ragnaroek/rust-raspberry:1.14.0 build
*** Extracting target dependencies ***
Extracting: /home/cross/deb-deps/bluez_5.43-1_armhf.deb
Extracting: /home/cross/deb-deps/libbluetooth-dev_5.43-1_armhf.deb

*** Cross compiling project ***
Updating registry https://github.com/rust-lang/crates.io-index
Downloading kdri v0.4.3
Downloading bluetooth-serial-port v0.4.1
Downloading enum_primitive v0.1.1
Downloading mio v0.6.2
Downloading nix v0.7.0
Downloading libc v0.2.20
Downloading void v1.0.2
Downloading cfg-if v0.1.0
Downloading bitflags v0.4.0
Downloading rustc_version v0.1.7
Downloading semver v0.1.20
Downloading num-traits v0.1.36
Downloading slab v0.3.0
Downloading lazycell v0.4.0
Downloading net2 v0.2.26
Downloading log v0.3.6
Compiling semver v0.1.20
Compiling rustc_version v0.1.7
Compiling lazycell v0.4.0
Compiling bitflags v0.4.0
Compiling slab v0.3.0
Compiling void v1.0.2
Compiling cfg-if v0.1.0
Compiling log v0.3.6
Compiling libc v0.2.20
Compiling net2 v0.2.26
Compiling num-traits v0.1.36
Compiling enum_primitive v0.1.1
Compiling nix v0.7.0
Compiling mio v0.6.2
Compiling bluetooth-serial-port v0.4.1
Compiling kdri v0.4.3
Compiling kettler v0.1.0 (file:///home/cross/project)
error: linking with gcc-sysroot failed: exit code: 1
|
= note: "gcc-sysroot" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-L" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/kettler.0.o" "-o" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/kettler" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps" "-L" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/libkdri-9723713147bf2803.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/libbluetooth_serial_port-f23155f1a81f0bc5.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/libenum_primitive-f763630b6112f8df.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/libnum_traits-92bb90166cd1857c.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/libmio-d8a3ebfe89185cdb.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/liblog-bf16bb9a4912b11d.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/libslab-69010361762af86e.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/libnet2-755d3e4f87237d0e.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/liblazycell-d53b754addaf1d91.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/libnix-56d9e0b660233faa.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/liblibc-29ef97a68464c2b7.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/libvoid-2cc31605fcb01ba1.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/libbitflags-75746cc7f0e9d928.rlib" "/home/cross/project/target/arm-unknown-linux-gnueabihf/debug/deps/libcfg_if-72c1f992b13d5087.rlib" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libstd-2057375968b67ddb.rlib" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libpanic_unwind-20b62febd4f8b14e.rlib" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libunwind-70c006235637ffa1.rlib" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/librand-eee0071785e97554.rlib" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libcollections-29e32f0fcc1aa9f2.rlib" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/librustc_unicode-08e94cce686650ba.rlib" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/liballoc-2c56955b22137f5f.rlib" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/liballoc_jemalloc-fdcec0246f2c2a65.rlib" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/liblibc-50aa47411c753e02.rlib" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libcore-d096a56044617aca.rlib" "/home/cross/.rustup/toolchains/1.14.0-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libcompiler_builtins-7da46c38d3cea97a.rlib" "-l" "bluetooth" "-l" "bluetooth" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util"
= note: /home/cross/pi-tools/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/arm-bcm2708hardfp-linux-gnueabi/sysroot/usr/lib/arm-linux-gnueabihf/libbluetooth.a(sdp.o): In function sdp_read_rsp.isra.3.constprop.12': (.text+0xf8): undefined reference to __fdelt_chk'
collect2: error: ld returned 1 exit status

error: aborting due to previous error

error: Could not compile kettler.

To learn more, run the command again with --verbose.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.