You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to pass extra-link-args on command line from the makefile, but now cargo issues a warning
warning: flag `-Z extra-link-arg` has been stabilized in the 1.56 release, and is no longer necessary
Additional linker arguments are now supported without passing this flag.
Does it mean I can now pass linker flags directly on the command line like --script=link.ld?
Steps
Parent Makefile.toml:
[env]
# This is passed to cargo if LINK_SCRIPT is set in sub-makefile
LINK_ARG = "-Z extra-link-arg=--script=${LINK_SCRIPT}"
Makefile.toml
[env]
# This script is specific per-project-binary.
# I do not use, neither need to use build.rs here.
LINK_SCRIPT = "bin/microboot/src/link.ld"
[tasks.build]
env = { "TARGET_FEATURES" = "" }
args = ["build", "--target=${TARGET_JSON}", "@@split(STD, )", "@@split(LINK_ARG, )", "--release", "--features=${TARGET_FEATURES}"]
Maybe I'm a bit confused by the question, but -Zextra-link-arg never took arguments itself. It just enabled adding linker arguments via build scripts. There is more documentation on how that works at https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script (the cargo:rustc-link-arg instructions). Build scripts may now output those instructions without -Zextra-link-arg.
Problem
Related to #9426
I need to pass extra-link-args on command line from the makefile, but now cargo issues a warning
Does it mean I can now pass linker flags directly on the command line like
--script=link.ld
?Steps
Parent Makefile.toml:
Makefile.toml
Which gives a command line like
Possible Solution(s)
-Z extra-link-arg
will continue to workNotes
No response
Version
The text was updated successfully, but these errors were encountered: