Closed
Description
Where's the problem at?
https://fasterthanli.me/series/making-our-own-executable-packer/part-12
No, seriously, where is it?
The fourth way is to.. opt into another unstable feature:
[Rust code]
[Shell session]
Hey, it built!
Describe the issue and a fix if you know it
This errors out with a recent rustc (I'm using rustc 1.62.0 (Arch Linux rust 1:1.62.0-1)
):
error[E0557]: feature has been removed
--> src/sel4user/main.rs:5:12
|
5 | #![feature(link_args)]
| ^^^^^^^^^ feature has been removed
|
= note: removed in favor of using `-C link-arg=ARG` on command line, which is available from cargo build scripts with `cargo:rustc-link-arg` now
error: cannot find attribute `link_args` in this scope
--> src/sel4user/main.rs:8:3
|
8 | #[link_args = "-nostartfiles"]
| ^^^^^^^^^ help: a built-in attribute with a similar name exists: `linkage`
For more information about this error, try `rustc --explain E0557`.
I've managed to get it to work with this build.rs
build script
fn main() {
// don't link with stdlib
println!("cargo:rustc-link-arg-bin=<NAME OF BINARY>=-nostartfiles");
}
- link_args tracking issue
- PR where it got removed
- docs about
cargo:rustc-link-arg-bin
(I have multiple binaries in the same project so need the BIN=FLAGS form, but if there's only a single binary then justcargo:rustc-link-arg-bin=-nostartfiles
should work)
Metadata
Metadata
Assignees
Labels
No labels