Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to you get verbose output from ld when using Cargo?

How do you get the ld linker to be verbose when you use Cargo? I've tried several things in .cargo/config, but without luck. What would the right settings be? When using gcc directly, I can just do -Wl,--verbose.

[build]
rustflags = [
    "-C", "prefer-dynamic",
    # "-Z", "pre-link-arg=-pthread",
    "-C", "link-arg=-pthread",
    "-C", "link-arg=-fopenmp",
    # "-C", "link-arg=-LC:/Octave/Octave-4.2.1/lib64/gcc/x86_64-w64-mingw32/4.9.4",
    # "-C", "link-arg=--sysroot=C:/Octave/Octave-4.2.1",
    # "-Z", "pre-link-args=-LC:/Octave/Octave-4.2.1/lib",
    # "-Z", "pre-link-args=-LC:\\Octave\\Octave-4.2.1\\lib",
    # "-C", "link-arg=--verbose",
    # "-C", "link-arg=-v",
    # "-C", "link-arg=-Wl,--verbose",
    # "-Z", "print-link-args",
]

[target.x86_64-pc-windows-gnu]
linker = "C:/Octave/Octave-4.2.1/bin/gcc.exe"
# rustflags = [
#     "-C", "link-arg=-Wl,--verbose",
# ]

# [term]
# verbose = true

I'm trying to build a library for Octave with Rust.

like image 360
Cameron Taggart Avatar asked Jun 04 '17 14:06

Cameron Taggart


1 Answers

Found the answer: https://github.com/rust-lang/rust/issues/38206

export RUSTC_LOG=rustc_codegen_ssa::back::link=info
like image 85
holmes Avatar answered Oct 22 '22 05:10

holmes