Skip to content

Cross compile for arm-unknown-linux-musleabihf: configure: error: C compiler cannot create executables #89

@olegantonyan

Description

@olegantonyan

.cargo/config

[target.arm-unknown-linux-musleabihf]
linker = "/home/oleg/bin/buildroot-2017.02.10/output/host/usr/bin/arm-buildroot-linux-musleabihf-gcc-5.4.0.br_real"

cargo build --target=arm-unknown-linux-musleabihf
yields an error:

running: "sh" "/home/oleg/.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-musleabihf" "--build=x86_64-unknown-linux-gnu"
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-musleabihf
checking target system type... arm-unknown-linux-musleabihf
checking for arm-unknown-linux-musleabihf-gcc... arm-linux-musleabihf-gcc
checking for C compiler default output file name... 

--- stderr
configure: error: in `/home/oleg/projects/bbb_webui/target/arm-unknown-linux-musleabihf/debug/build/backtrace-sys-2f65fb215f9723a3/out':
configure: error: C compiler cannot create executables
See `config.log' for more details.

To make it work I have to specify CC through env:
CC=/home/oleg/bin/buildroot-2017.02.10/output/host/usr/bin/arm-buildroot-linux-musleabihf-gcc-5.4.0.br_real cargo build --target=arm-unknown-linux-musleabihf

Don't know exactly how to fix it properly, but anyway.
rustc 1.26.0-nightly (322d7f7b9 2018-02-25)
cargo 0.26.0-nightly (1d6dfea44 2018-01-26)

Activity

alexcrichton

alexcrichton commented on Mar 1, 2018

@alexcrichton
Member

Thanks for the report! Unfortunately I think this is due to rust-lang/cc-rs#82, you'll need to specify the compiler in two locations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alexcrichton@olegantonyan

        Issue actions

          Cross compile for arm-unknown-linux-musleabihf: configure: error: C compiler cannot create executables · Issue #89 · rust-lang/backtrace-rs