-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
A-linkageArea: linker issues, dylib, cdylib, shared libraries, soArea: linker issues, dylib, cdylib, shared libraries, soC-bugCategory: bugCategory: bugZ-build-stdNightly: build-stdNightly: build-std
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
lights0123 and TravisFredrickson
Metadata
Metadata
Assignees
Labels
A-linkageArea: linker issues, dylib, cdylib, shared libraries, soArea: linker issues, dylib, cdylib, shared libraries, soC-bugCategory: bugCategory: bugZ-build-stdNightly: build-stdNightly: build-std