<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - lldb tests are failing when an in-tree clang is specified (missing ar/objcopy)"
   href="https://bugs.llvm.org/show_bug.cgi?id=35040">35040</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lldb tests are failing when an in-tree clang is specified (missing ar/objcopy)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>davide@freebsd.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>aprantl@apple.com, dblaikie@gmail.com, lhames@gmail.com, llvm-bugs@lists.llvm.org, rnk@google.com, zturner@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Example:

======================================================================
ERROR: test_dwarf (TestBSDArchives.BSDArchivesTestCase)
   Break inside a() and b() defined within libfoo.a.
----------------------------------------------------------------------
Error when building test subject.

Build Command:
make MAKE_DSYM=NO ARCH=x86_64 CC="/home/davide/work/build-lldb/bin/clang-5.0"

Build Command Output:
make: /home/davide/work/build-lldb/bin/ar: Command not found
make: *** [libfoo.a(a.o)] Error 127

Test Directory:
/home/davide/work/llvm-lldb/tools/lldb/packages/Python/lldbsuite/test/functionalities/archives
======================================================================
ERROR: test_dwo (TestBSDArchives.BSDArchivesTestCase)
   Break inside a() and b() defined within libfoo.a.
----------------------------------------------------------------------
Error when building test subject.

Build Command:
make MAKE_DSYM=NO MAKE_DWO=YES ARCH=x86_64
CC="/home/davide/work/build-lldb/bin/clang-5.0"

Build Command Output:
make: /home/davide/work/build-lldb/bin/ar: Command not found
make: *** [libfoo.a(a.o)] Error 127


There's a bunch of these failing, and it's a little weird.
They're failing because they're assuming that `ar` and `objcopy` (and maybe
other bits of binutils` live in the llvm `bin/` directory, rather than
`/usr/lib` (or `/usr/local/lib`, or anywhere else in $PATH).

I'm not sure if this is intended, but, that said, I don't think it's great. We
might:

a) Add options to `dotest.py` to override the binaries, or, more generally the
binutils directory in which the tests should look

b) Fallback to $PATH in case there's no `ar` or `objcopy`.

c) Create symlinks from `llvm-ar` and `llvm-objcopy` to `ar` and `objcopy` in
the `bin` directory (I really don't like this one)

d) If the compiler used is clang (dotest already has logic for that, prepend
the `llvm-` prefix to the executables)

e) you name it</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>