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

            Bug ID: 23877
           Summary: `clang -print-file-name` doesn't respect LIBRARY_PATH
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Unlike GCC, clang ignores LIBRARY_PATH when looking up a library via
`-print-file-name`, but it *does* consult LIBRARY_PATH when actually linking:

jim@huginn ~
$ LIBRARY_PATH=$HOME/lib gcc -print-file-name=libboost_iostreams.so
/home/jim/lib/../lib/libboost_iostreams.so

jim@huginn ~
$ LIBRARY_PATH=$HOME/lib clang-3.6 -print-file-name=libboost_iostreams.so
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.1.0/../../../x86_64-linux-gnu/libboost_iostreams.so

jim@huginn ~
$ LIBRARY_PATH=$HOME/lib clang-3.6 -shared -olibfoo.so -lboost_iostreams

jim@huginn ~
$ ldd libfoo.so
        linux-vdso.so.1 =>  (0x00007fff5c5fe000)
        libboost_iostreams.so.1.55.0 =>
/home/jim/lib/libboost_iostreams.so.1.55.0 (0x00007f2d2cb3f000)
        ...

jim@huginn ~
$ clang-3.6 --version
Ubuntu clang version 3.6.2-svn239700-1~exp1 (branches/release_36) (based on
LLVM 3.6.2)
Target: x86_64-pc-linux-gnu
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to