title: How can I find the current Rust compiler's default LLVM target triple?
body: <p>I want to <a href="https://doc.rust-lang.org/cargo/reference/build-scripts.html#overriding-build-scripts" rel="noreferrer">override a build script</a>, which means adding a configuration section that looks like this:</p>
  
  <pre><code>[target.x86_64-unknown-linux-gnu.foo]
  rustc-link-search = ["/path/to/foo"]
  rustc-link-lib = ["foo"]
  root = "/path/to/foo"
  key = "value"
  </code></pre>
  
  <p>But I'm using a Mac, so <code>x86_64-unknown-linux-gnu</code> isn't the correct target triple.</p>
  
  <p>How do I discover which target triple rustc or cargo are currently using?</p>
  
  <p><code>rustc --print cfg</code> prints a list of values that don't seem to correspond to the triple (there's no <code>unknown</code> in there, in particular).</p>
  
  <p><code>rustc --print target-list</code> displays all available targets; I just want the default.</p>