[llvm-bugs] [Bug 44780] New: llvm-config --system-libs reports absolute path for zlib without rpath

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Feb 4 12:47:47 PST 2020


https://bugs.llvm.org/show_bug.cgi?id=44780

            Bug ID: 44780
           Summary: llvm-config --system-libs reports absolute path for
                    zlib without rpath
           Product: Build scripts
           Version: 10.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: andrew at ziglang.org
                CC: llvm-bugs at lists.llvm.org

Similar to https://bugs.llvm.org/show_bug.cgi?id=44179

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 https://reviews.llvm.org/D70764.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200204/ae22ca76/attachment.html>


More information about the llvm-bugs mailing list