Skip to content

how to build for powerpc openwrt musl libc 1.2.3 device featuring e500v1 core ? #1363

@thomas725

Description

@thomas725

For the last few weeks with the help of @Emilgardis I've tried to get rust compiled for my powerpc openwrt device.

TP-Link TL-WDR4900 v1.x

See also: #1349

Currently we're testing those images created by @Emilgardis:

We managed to get the first one of those to produce debug build using:

RUSTFLAGS="-C target-feature=-crt-static" cross +nightly build --target powerpc-unknown-linux-musl

but since the resulting binary is 15mb big I'd need a release build to actually test if it can run on my device, which failed to build so far:

$ RUSTFLAGS="-C target-feature=-crt-static" cross -Zbuild-std=std,panic_abort +nightly build --target powerpc-unknown-linux-musl --release
[cross] warning: using newer rustc `1.75.0-nightly (2f1bd0729 2023-10-27)` for the target. Current active rustc on the host is `rustc 1.73.0 (cc66ad468 2023-10-03)`.
 > Update with `rustup update`
   Compiling compiler_builtins v0.1.101
   Compiling core v0.0.0 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling libc v0.2.149
   Compiling cc v1.0.79
   Compiling memchr v2.5.0
   Compiling std v0.0.0 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std)
   Compiling unwind v0.0.0 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/unwind)
   Compiling rustc-std-workspace-core v1.99.0 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
   Compiling cfg-if v1.0.0
   Compiling adler v1.0.2
   Compiling rustc-demangle v0.1.23
   Compiling rustc-std-workspace-alloc v1.99.0 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)
   Compiling panic_unwind v0.0.0 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/panic_unwind)
   Compiling panic_abort v0.0.0 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/panic_abort)
   Compiling gimli v0.28.0
   Compiling miniz_oxide v0.7.1
   Compiling std_detect v0.1.5 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/stdarch/crates/std_detect)
   Compiling object v0.32.0
   Compiling hashbrown v0.14.2
   Compiling addr2line v0.21.0
   Compiling proc_macro v0.0.0 (/home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro)
   Compiling my-project v0.1.0 (/home/user/Development/git/my-project)
error[E0463]: can't find crate for `panic_abort`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `my-project` (bin "my-project") due to previous error
[cross] warning: rust-std is not available for powerpc-unknown-linux-musl
[cross] note: you may need to build components for the target via `-Z build-std=<components>` or in your cross configuration specify `target.powerpc-unknown-linux-musl.build-std`
              the available components are core, std, alloc, and proc_macro

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

    Issue actions