Closed
Description
Problem
The file format of the output binary of cargo build -Zbuild-std=core,alloc
is not recognized.
Steps
- Clone https://github.com/toku-sa-n/cargo_bug
git checkout with_rlibc
make
This causes the error: ld: target/cargo_settings/debug/librust_bug.a: error adding symbols: file format not recognized
Possible Solution(s)
Sorry, but I have no idea.
Notes
Output of cargo version
:cargo 1.45.0-nightly (cb06cb2 2020-05-08)
rlibc
is deprecated, but with compiler_builtins
(which is the replacement of rlibc
) , cargo build -Zbuild-std=core,alloc
itself fails with the error: multiple rlib candidates for compiler_builtins found
. rust-lang/wg-cargo-std-aware#53 seems to be related.
Building without compiler_builtins
will cause another linker error: undefined reference to 'memcpy'
.
Related issue: rust-osdev/cargo-xbuild#69