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

Comments

Projects
None yet
5 participants
@hsivonen
Copy link
Contributor

hsivonen commented Dec 21, 2018

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

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Dec 21, 2018

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

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Dec 21, 2018

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

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Dec 21, 2018

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

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Dec 21, 2018

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

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Dec 21, 2018

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

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Dec 21, 2018

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Dec 21, 2018

@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 label Dec 22, 2018

@hsivonen

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Jan 21, 2019

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

@hsivonen

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Jan 21, 2019

@hsivonen

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Jan 22, 2019

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

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Jan 22, 2019

Indeed src/llvm-emscripten is empty.

@hsivonen

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Jan 22, 2019

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

@mati865

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Jan 23, 2019

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

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Jan 23, 2019

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

This comment has been minimized.

Copy link
Contributor Author

hsivonen commented Jan 23, 2019

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

Auto merge of #57862 - hsivonen:buildneon, r=alexcrichton
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 in 7dbb70e Jan 29, 2019

pietroalbini added a commit to pietroalbini/rust that referenced this issue Feb 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.