Stream: t-compiler

Topic: Option to emit linker command line?


Josh Triplett (Feb 10 2020 at 19:06, on Zulip):

I remember using an option to rustc (and cargo) that got it to print the cc command line it uses for linking, before invoking it. I can't seem to find that option anymore. What option do I need to pass to get rustc to print its linker command line before linking?

bjorn3 (Feb 10 2020 at 19:09, on Zulip):

Maybe -v helps? Otherwise use -Clinker=false to make rustc print the arguments after /bin/false exits with an error code.

Josh Triplett (Feb 10 2020 at 19:12, on Zulip):

-v doesn't show the linker arguments, unfortunately.

Josh Triplett (Feb 10 2020 at 19:12, on Zulip):

I just managed to find -Z print_link_args, which works on nightly.

Josh Triplett (Feb 10 2020 at 19:13, on Zulip):

Was there a time when -v printed the linker arguments? Because I remember this not being nightly only.

pnkfelix (Feb 10 2020 at 19:13, on Zulip):

it might be a -Z flag

pnkfelix (Feb 10 2020 at 19:13, on Zulip):

oh yeah you found it

pnkfelix (Feb 10 2020 at 19:13, on Zulip):

(-Z print-link-args, namely)

Josh Triplett (Feb 10 2020 at 19:14, on Zulip):

I remember this not being a nightly thing, though. Did rustc at some point print the linker command line with -v and then stop doing so?

Last update: Jun 07 2020 at 10:05UTC