<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 - lld errors out on -L/usr/lib"
   href="https://bugs.llvm.org/show_bug.cgi?id=42802">42802</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lld errors out on -L/usr/lib
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lld
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bero@lindev.ch
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>On an OpenMandriva x86_64 system (where x86_64 libraries live in /usr/lib64 and
i686 libraries live in /usr/lib), trying to link any x86_64 application while
-L/usr/lib is in the compiler flags [which, of course, is wrong, but happens to
be accepted by ld.bfd and ld.gold - they skip the bogus files in /usr/lib and
find the correct files in default search paths] results in

$ clang -o test test.c
$ clang -o test test.c -L/usr/lib -fuse-ld=bfd
$ clang -o test test.c -L/usr/lib -fuse-ld=gold
$ clang -o test test.c -L/usr/lib
ld: error:
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/9.1.1/../../../../lib64/crt1.o
is incompatible with elf_x86_64
ld: error:
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/9.1.1/../../../../lib64/crti.o
is incompatible with elf_x86_64
ld: error: /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/9.1.1/crtbegin.o
is incompatible with elf_x86_64
ld: error: /tmp/test-549d3a.o is incompatible with elf_x86_64
ld: error: /usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/9.1.1/crtend.o
is incompatible with elf_x86_64
ld: error:
/usr/bin/../lib64/gcc/x86_64-openmandriva-linux-gnu/9.1.1/../../../../lib64/crtn.o
is incompatible with elf_x86_64
clang-9: error: linker command failed with exit code 1 (use -v to see
invocation)


Aside from the fact that it probably shouldn't error out at all, the error
message is wrong -- the crt*.o files are the ones in lib64 that are compatible
with elf_x86_64.</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>