dlecan / rust-crosscompiler-arm

Docker images for Rust dedicated to cross compilation for ARM v6 and more
MIT License
50 stars 16 forks source link

Issue building crate with backtrace-sys as a dependency #9

Closed pingzing closed 6 years ago

pingzing commented 6 years ago

Hi! This image was working fine for me about a week ago. Without making any changes locally, I went to try to build it today, and instead received an error when it attempted to compile backtrace-sys. The build log is below:

Is this something that looks like it might be an issue with the toolchain in the image, or is this more likely to be local to me?

error: failed to run custom build command for `backtrace-sys v0.1.16`
process didn't exit successfully: `/source/target/release/build/backtrace-sys-eceb7260fb4bc49c/build-script-build` (exit code: 101)
--- stdout
OPT_LEVEL = Some("3")
TARGET = Some("arm-unknown-linux-gnueabihf")
HOST = Some("x86_64-unknown-linux-gnu")
TARGET = Some("arm-unknown-linux-gnueabihf")
TARGET = Some("arm-unknown-linux-gnueabihf")
HOST = Some("x86_64-unknown-linux-gnu")
CC_arm-unknown-linux-gnueabihf = None
CC_arm_unknown_linux_gnueabihf = None
TARGET_CC = None
CC = Some("arm-linux-gnueabihf-gcc-with-link-search")
TARGET = Some("arm-unknown-linux-gnueabihf")
HOST = Some("x86_64-unknown-linux-gnu")
CFLAGS_arm-unknown-linux-gnueabihf = None
CFLAGS_arm_unknown_linux_gnueabihf = None
TARGET_CFLAGS = None
CFLAGS = None
DEBUG = Some("false")
running: "sh" "/root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/src/libbacktrace/configure" "--with-pic" "--disable-multilib" "--disable-shared" "--disable-host-shared" "--host=arm-unknown-linux-gnueabihf" "--build=x86_64-unknown-linux-gnu"
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-gnueabihf
checking target system type... arm-unknown-linux-gnueabihf
checking for arm-unknown-linux-gnueabihf-gcc... arm-linux-gnueabihf-gcc-with-link-search
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gnueabihf-gcc-with-link-search accepts -g... yes
checking for arm-linux-gnueabihf-gcc-with-link-search option to accept ISO C89... none needed
checking how to run the C preprocessor... arm-linux-gnueabihf-gcc-with-link-search -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-unknown-linux-gnueabihf-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for arm-unknown-linux-gnueabihf-gcc... (cached) arm-linux-gnueabihf-gcc-with-link-search
checking whether we are using the GNU C compiler... (cached) yes
checking whether arm-linux-gnueabihf-gcc-with-link-search accepts -g... (cached) yes
checking for arm-linux-gnueabihf-gcc-with-link-search option to accept ISO C89... (cached) none needed
checking for arm-unknown-linux-gnueabihf-ranlib... ranlib
checking for gawk... (cached) mawk
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by arm-linux-gnueabihf-gcc-with-link-search... /opt/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/bin/ld
checking if the linker (/opt/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... no
checking for arm-unknown-linux-gnueabihf-dumpbin... no
checking for arm-unknown-linux-gnueabihf-link... no
checking for dumpbin... no
checking for link... link -dump
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /opt/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/bin/ld option to reload object files... -r
checking for arm-unknown-linux-gnueabihf-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-unknown-linux-gnueabihf-ar... ar
checking for arm-unknown-linux-gnueabihf-strip... strip
checking for arm-unknown-linux-gnueabihf-ranlib... (cached) ranlib
checking command to parse nm output from arm-linux-gnueabihf-gcc-with-link-search object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-linux-gnueabihf-gcc-with-link-search supports -fno-rtti -fno-exceptions... no
checking for arm-linux-gnueabihf-gcc-with-link-search option to produce PIC... -fPIC -DPIC
checking if arm-linux-gnueabihf-gcc-with-link-search PIC flag -fPIC -DPIC works... yes
checking if arm-linux-gnueabihf-gcc-with-link-search static flag -static works... yes
checking if arm-linux-gnueabihf-gcc-with-link-search supports -c -o file.o... yes
checking if arm-linux-gnueabihf-gcc-with-link-search supports -c -o file.o... (cached) yes
checking whether the arm-linux-gnueabihf-gcc-with-link-search linker (/opt/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/arm-linux-gnueabihf/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking unwind.h usability... yes
checking unwind.h presence... yes
checking for unwind.h... yes
checking for _Unwind_Backtrace... yes
checking for -funwind-tables option... yes
checking for -frandom-seed=string option... yes
checking whether arm-linux-gnueabihf-gcc-with-link-search supports -W... yes
checking whether arm-linux-gnueabihf-gcc-with-link-search supports -Wall... yes
checking whether arm-linux-gnueabihf-gcc-with-link-search supports -Wwrite-strings... yes
checking whether arm-linux-gnueabihf-gcc-with-link-search supports -Wstrict-prototypes... yes
checking whether arm-linux-gnueabihf-gcc-with-link-search supports -Wmissing-prototypes... yes
checking whether arm-linux-gnueabihf-gcc-with-link-search supports -Wold-style-definition... yes
checking whether arm-linux-gnueabihf-gcc-with-link-search supports -Wmissing-format-attribute... yes
checking whether arm-linux-gnueabihf-gcc-with-link-search supports -Wcast-qual... yes
checking for _Unwind_GetIPInfo... yes
checking __sync extensions... yes
checking __atomic extensions... yes
checking output filetype... elf32
looking for a compliant stdint.h in stdint.h, checking for uintmax_t... yes
checking for uintptr_t... yes
checking for int_least32_t... yes
checking for int_fast32_t... yes
checking for uint64_t... yes
checking what to include in gstdint.h... stdint.h (already complete)
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking link.h usability... yes
checking link.h presence... yes
checking for link.h... yes
checking for dl_iterate_phdr... yes
checking for fcntl... yes
checking whether strnlen is declared... yes
checking for getexecname... no
checking whether tests can run... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating backtrace-supported.h
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing libtool commands
config.status: executing gstdint.h commands
config.status: executing default commands
running: "make" "INCDIR=/root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/src/libbacktrace"
make  all-am
make[1]: Entering directory '/source/target/arm-unknown-linux-gnueabihf/release/build/backtrace-sys-9fbf5dd368a9fd50/out'
true  DO=all multi-do # make
/bin/bash ./libtool --tag=CC   --mode=compile arm-linux-gnueabihf-gcc-with-link-search -DHAVE_CONFIG_H -I. -I/root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/src/libbacktrace  -I /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/src/libbacktrace/../include -I /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/src/libbacktrace/../libgcc -I ../libgcc  -funwind-tables -frandom-seed=state.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -fPIC -O3 -ffunction-sections -fdata-sections -fPIC -march=armv6 -marm -Wall -Wextra -c -o state.lo /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/src/libbacktrace/state.c
libtool: compile:  arm-linux-gnueabihf-gcc-with-link-search -DHAVE_CONFIG_H -I. -I/root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/src/libbacktrace -I /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/src/libbacktrace/../include -I /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/src/libbacktrace/../libgcc -I ../libgcc -funwind-tables -frandom-seed=state.lo -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -fPIC -O3 -ffunction-sections -fdata-sections -fPIC -march=armv6 -marm -Wall -Wextra -c /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/src/libbacktrace/state.c  -fPIC -DPIC -o state.o
/bin/bash ./libtool --tag=CC   --mode=link arm-linux-gnueabihf-gcc-with-link-search -funwind-tables -frandom-seed=libbacktrace.la -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wcast-qual -fPIC -O3 -ffunction-sections -fdata-sections -fPIC -march=armv6 -marm -Wall -Wextra   -o libbacktrace.la  atomic.lo dwarf.lo fileline.lo posix.lo print.lo sort.lo state.lo backtrace.lo simple.lo elf.lo mmapio.lo alloc.lo
libtool: link: rm -fr  .libs/libbacktrace.la
libtool: link: ar cru .libs/libbacktrace.a  atomic.o dwarf.o fileline.o posix.o print.o sort.o state.o backtrace.o simple.o elf.o mmapio.o alloc.o
libtool: link: ranlib .libs/libbacktrace.a
libtool: link: ( cd ".libs" && rm -f "libbacktrace.la" && ln -s "../libbacktrace.la" "libbacktrace.la" )
make[1]: Leaving directory '/source/target/arm-unknown-linux-gnueabihf/release/build/backtrace-sys-9fbf5dd368a9fd50/out'
cargo:rustc-link-search=native=/source/target/arm-unknown-linux-gnueabihf/release/build/backtrace-sys-9fbf5dd368a9fd50/out/.libs
cargo:rustc-link-lib=static=backtrace
running: "ar" "x" "/source/target/arm-unknown-linux-gnueabihf/release/build/backtrace-sys-9fbf5dd368a9fd50/out/.libs/libbacktrace.a"
running: "objcopy" "--redefine-syms=symbol-map" "/source/target/arm-unknown-linux-gnueabihf/release/build/backtrace-sys-9fbf5dd368a9fd50/out/__tmp/alloc.o"

--- stderr
configure: WARNING: using cross tools not prefixed with host triplet
objcopy: Unable to recognise the format of the input file `/source/target/arm-unknown-linux-gnueabihf/release/build/backtrace-sys-9fbf5dd368a9fd50/out/__tmp/alloc.o'
thread 'main' panicked at 'failed with: exit code: 1', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-sys-0.1.16/build.rs:176:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed
pingzing commented 6 years ago

Addition: I can confirm that I'm seeing this as well in a minimal hello-world application. Create any basic application, and add failure = "0.1.1" (as it has a dependency on backtrace, which in turn has one on backtrace-sys) and you'll get the error.

dlecan commented 6 years ago

I can confirm this issue, thank you for reporting it. Docker image is probably using the wrong objcopy executable. I will look at that.

SuperFluffy commented 6 years ago

Using PR #10, I was able to build my binary which involves backtrace-sys v0.1.16.