Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a build container for thumbv7neon-unknown-linux-gnueabihf #57030

Closed
hsivonen opened this issue Dec 21, 2018 · 16 comments
Closed

Add a build container for thumbv7neon-unknown-linux-gnueabihf #57030

hsivonen opened this issue Dec 21, 2018 · 16 comments
Labels
T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@hsivonen
Copy link
Member

The thumbv7neon-unknown-linux-gnueabihf target was added recently. However, rust-std for the target isn't available via rustup, because there's no infra automation for building it.

A container configuration for actually building release artifacts for the target is needed.

@hsivonen
Copy link
Member Author

It unclear to me what the right fix is. It seems that the only Docker config that talks about armv7_unknown_linux_gnueabihf (the closest existing config) at all is src/ci/docker/dist-armv7-linux/Dockerfile. However, its format seems to differ from the format of containers that build multiple targets.

@hsivonen
Copy link
Member Author

Changing the src/ci/docker/dist-armv7-linux/Dockerfile like this:

ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \
    AR_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-ar \
    CXX_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-g++

ENV CC_thumbv7neon-unknown-linux-gnueabihf=armv7-unknown-linux-gnueabihf-gcc \
    AR_thumbv7neon-unknown-linux-gnueabihf=armv7-unknown-linux-gnueabihf-ar \
    CXX_thumbv7neon-unknown-linux-gnueabihf=armv7-unknown-linux-gnueabihf-g++

ENV HOSTS=armv7-unknown-linux-gnueabihf,thumbv7neon-unknown-linux-gnueabihf

Fails like this:

+ python2.7 ../x.py dist --host armv7-unknown-linux-gnueabihf,thumbv7neon-unknown-linux-gnueabihf --target armv7-unknown-linux-gnueabihf,thumbv7neon-unknown-linux-gnueabihf
    Finished dev [unoptimized] target(s) in 0.19s
thread 'main' panicked at '

couldn't find required command: "arm-linux-gnueabihf-gcc"

', src/bootstrap/sanity.rs:65:13
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failed to run: /checkout/obj/build/bootstrap/debug/bootstrap dist --host armv7-unknown-linux-gnueabihf,thumbv7neon-unknown-linux-gnueabihf --target armv7-unknown-linux-gnueabihf,thumbv7neon-unknown-linux-gnueabihf
Build completed unsuccessfully in 0:00:00

@hsivonen
Copy link
Member Author

ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \
    AR_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-ar \
    CXX_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-g++

ENV CC_thumbv7neon-unknown-linux-gnueabihf=armv7-unknown-linux-gnueabihf-gcc \
    AR_thumbv7neon-unknown-linux-gnueabihf=armv7-unknown-linux-gnueabihf-ar \
    CXX_thumbv7neon-unknown-linux-gnueabihf=armv7-unknown-linux-gnueabihf-g++

ENV HOSTS=armv7-unknown-linux-gnueabihf

ENV TARGETS=armv7-unknown-linux-gnueabihf,thumbv7neon-unknown-linux-gnueabihf

At least doesn't fail immediately...

@hsivonen
Copy link
Member Author

Trying to use comma-separated targets seems to break even the target that was unchanged by making backtrace-sys build with a mix of ARM and x86_64 inputs.

Building stage2 tool clippy-driver (armv7-unknown-linux-gnueabihf)
   Compiling backtrace-sys v0.1.24
   Compiling memchr v2.1.1
   Compiling ryu v0.2.7
   Compiling idna v0.1.5
   Compiling smallvec v0.6.7
   Compiling pulldown-cmark v0.2.0
   Compiling clippy v0.0.212 (/checkout/src/tools/clippy)
   Compiling toml v0.4.10
error: failed to run custom build command for `backtrace-sys v0.1.24`
process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/build/backtrace-sys-0483c43875de1fe5/build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-unknown-linux-gnu")
OPT_LEVEL = Some("2")
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("sccache armv7-unknown-linux-gnueabihf-gcc")
CFLAGS_x86_64-unknown-linux-gnu = None
CFLAGS_x86_64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = Some("-ffunction-sections -fdata-sections -fPIC -march=armv7-a")
DEBUG = Some("false")
running: "sccache" "armv7-unknown-linux-gnueabihf-gcc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-march=armv7-a" "-m64" "-I" "src/libbacktrace" "-I" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/build/backtrace-sys-b7b7de2d05114cff/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" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/release/build/backtrace-sys-b7b7de2d05114cff/out/src/libbacktrace/alloc.o" "-c" "src/libbacktrace/alloc.c"
cargo:warning=armv7-unknown-linux-gnueabihf-gcc: error: unrecognized command line option '-m64'
exit code: 1

@hsivonen
Copy link
Member Author

I'd appreciate input from someone who actually understands the system. (I'll be away from GitHub until January 7, though.)

@Centril
Copy link
Contributor

Centril commented Dec 21, 2018

cc @nagisa @japaric @alexcrichton

@alexcrichton
Copy link
Member

@hsivonen this probably wants to change dist-various-{1,2} (one or the other) rather than --hosts, because we just want a standard library for this target rather than a full compiler

@estebank estebank added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Dec 22, 2018
@hsivonen
Copy link
Member Author

The removal of compiler support for the simd crate made this issue a lot more urgent.

@hsivonen
Copy link
Member Author

Link to the removal PR.

@hsivonen
Copy link
Member Author

dist-various-1 without modifications (i.e. baseline situation) fails for me with

CMake Error: The source directory "/checkout/src/llvm-emscripten" does not appear to contain CMakeLists.txt.

@hsivonen
Copy link
Member Author

Indeed src/llvm-emscripten is empty.

@hsivonen
Copy link
Member Author

I guess this is one of those "start with a new clone to get submodules in a non-broken state" moments.

@mati865
Copy link
Contributor

mati865 commented Jan 22, 2019

This submodule should be checked out by running ./x.py. If it doesn't work try git submodule update --init --recursive --progress.

@hsivonen
Copy link
Member Author

This submodule should be checked out by running ./x.py.

The llvm-emscripten submodule isn't checked out by ./x.py or by a fresh clone of the rust repo.

If it doesn't work try git submodule update --init --recursive --progress.

This worked. Thank you!

@hsivonen
Copy link
Member Author

this probably wants to change dist-various-{1,2} (one or the other) rather than --hosts, because we just want a standard library for this target rather than a full compiler

@alexcrichton This target is the closest to armv7-unknown-linux-gnueabihf. That target is built by the dist-armv7-linux container, which builds a custom GCC toolchain. Presumably, thumbv7neon-unknown-linux-gnueabihf should use the same toolchain, which isn't available in dist-various-1, which seems the closest match for a container used for building stdlib-only Linux targets.

On surface, it seems it should be easier to make dist-armv7-linux build another stdlib than to make dist-various-1 have a custom toolchain that'd need to stay in sync with dist-armv7-linux.

@hsivonen
Copy link
Member Author

On surface, it seems it should be easier to make dist-armv7-linux build another stdlib than to make dist-various-1 have a custom toolchain that'd need to stay in sync with dist-armv7-linux.

This approach seems to work locally for me. Created a PR.

bors added a commit that referenced this issue Jan 29, 2019
Build the standard library for thumbv7neon-unknown-linux-gnueabihf in CI

Using the `dist-armv7-linux` image instead of `dist-various-1` in order to use the ARMv7 toolchain available in `dist-armv7-linux`.

Closes #57030.
@bors bors closed this as completed in 7dbb70e Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants