<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Clang ignores --gcc-toolchain, --sysroot, and -B when looking for linker"
   href="https://llvm.org/bugs/show_bug.cgi?id=26531">26531</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang ignores --gcc-toolchain, --sysroot, and -B when looking for linker
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Driver
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>alexchandel@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Despite a directory configuration of:

~/x86_64-unknown-linux-gnu/
~/x86_64-unknown-linux-gnu/bin/
~/x86_64-unknown-linux-gnu/bin/ld
~/x86_64-unknown-linux-gnu/bin/gcc
~/x86_64-unknown-linux-gnu/usr -> .
~/x86_64-unknown-linux-gnu/lib/
~/x86_64-unknown-linux-gnu/lib/gcc/
~/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/
~/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/5 -> ../../../bin


Clang absolutely refuses to invoke ~/x86_64-unknown-linux-gnu/bin/ld as the
linker, instead using /usr/bin/ld. Setting --sysroot and -B do not help.

Tested with `clang --gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu`,
`clang --gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu/bin`, `clang
--gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu/lib`, `clang
--gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu/lib/gcc`, `clang
--gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu`,
and `clang
--gcc-toolchain=/Users/alex/x86_64-unknown-linux-gnu/lib/gcc/x86_64-unknown-linux-gnu/5`.

Why is it so hard to use LLD with clang ?!?!?

Notes: Tested on OSX x86_64 with clang trunk. ~ is /Users/alex.
~/x86_64-unknown-linux-gnu also contains myriad headers and libraries as
appropriate for a toolchain. ~/x86_64-unknown-linux-gnu/bin/ld is a shell
script that forwards arguments to `lld-gnu -target x86_64-unknown-linux-gnu`.
~/x86_64-unknown-linux-gnu/bin/gcc is a shell script that invokes clang.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>