Cameron Taggart
Cameron Taggart

Reputation: 6091

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.

Upvotes: 20

Views: 5413

Answers (1)

holmes
holmes

Reputation: 981

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

export RUSTC_LOG=rustc_codegen_ssa::back::link=info

Upvotes: 18

Related Questions