14

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.

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Cameron Taggart
  • 5,771
  • 4
  • 45
  • 70
  • 2
    `"-C", "link-arg=-Wl,--verbose"` and `"-Z", "print-link-args"` shows that `-Wl,--verbose` is being passed to my linker (`cc` on macOS 10.12). Unfortunately, my `ld` doesn't support that flag, but it is passed. – Shepmaster Jun 04 '17 at 14:38

1 Answers1

10

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

export RUSTC_LOG=rustc_codegen_ssa::back::link=info
holmes
  • 891
  • 8
  • 19