<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 - llvm-config --system-libs reports absolute path for zlib without rpath"
   href="https://bugs.llvm.org/show_bug.cgi?id=44780">44780</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-config --system-libs reports absolute path for zlib without rpath
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Build scripts
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </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>cmake
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>andrew@ziglang.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Similar to <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - llvm-config --system-libs prints entire libxml2 path"
   href="show_bug.cgi?id=44179">https://bugs.llvm.org/show_bug.cgi?id=44179</a>

9.0.1 behavior:
$ llvm-config --system-libs
-lz -lrt -ldl -lpthread -lm

10.0.0rc1 behavior:
$ llvm-config --system-libs
/nix/store/a3q9zl42d0hmgwmgzwkxi5qd88055fh8-zlib-1.2.11/lib/libz.so -lrt -ldl
-lpthread -lm


This ends up going onto the linker line for LLD, producing a binary like this:

[nix-shell:~/tmp/zig/build-llvm10-release]$ ldd
/home/andy/tmp/zig/zig-cache/o/39NGPp09af-0J9UEs7IabCuJBpR-9JHgtGfNslZiZIiA6j-mQbVfX1mISEjZIn7Y/test
        linux-vdso.so.1 (0x00007ffd68593000)
        libz.so.1 => not found
        libc.so.6 =>
/nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27/lib/libc.so.6
(0x00007f873f1e2000)
        libm.so.6 =>
/nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27/lib/libm.so.6
(0x00007f873f04c000)
        libpthread.so.0 =>
/nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27/lib/libpthread.so.0
(0x00007f873f02b000)
        libdl.so.2 =>
/nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27/lib/libdl.so.2
(0x00007f873f026000)
        librt.so.1 =>
/nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27/lib/librt.so.1
(0x00007f873f01c000)
       
/nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27/lib/ld-linux-x86-64.so.2
=>
/nix/store/aag9d1y4wcddzzrpfmfp9lcmc7skd7jk-glibc-2.27/lib64/ld-linux-x86-64.so.2
(0x00007f873f39a000)

(notice the "libz.so.1 => not found")

This issue would be resolved if --system-libs also reported the rpath for
libz.so, or if it reported `-lz` like it did in llvm 9.

I believe the related patch is <a href="https://reviews.llvm.org/D70764">https://reviews.llvm.org/D70764</a>.</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>