[LLVMbugs] [Bug 20510] New: clang doesnt use library search path that it was built with

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 1 12:41:45 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20510

            Bug ID: 20510
           Summary: clang doesnt use library search path that it was built
                    with
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: btorpey at nyx.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12845
  --> http://llvm.org/bugs/attachment.cgi?id=12845&action=edit
config log

The symptom of this problem is that clang builds can fail with an error similar
to:

clang++: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found
(required by clang++)

This appears to be because clang does not "remember" the search path it was
built with.  In this case, clang was built w/gcc 4.9.0, which is installed in
/usr/local.  

/shared/clang $ /usr/local/bin/gcc -print-search-dirs
install: /usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/
programs:
=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/:/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/:/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/:/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/:/usr/local/lib/gcc/x86_64-unknown-linux-gnu/:/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu/4.9.0/:/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../x86_64-unknown-linux-gnu/bin/
libraries:
=/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/:/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../x86_64-unknown-linux-gnu/lib/x86_64-unknown-linux-gnu/4.9.0/:/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../x86_64-unknown-linux-gnu/lib/../lib64/:/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../x86_64-unknown-linux-gnu/4.9.0/:/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../lib64/:/lib/x86_64-unknown-linux-gnu/4.9.0/:/lib/../lib64/:/usr/lib/x86_64-unknown-linux-gnu/4.9.0/:/usr/lib/../lib64/:/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../x86_64-unknown-linux-gnu/lib/:/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../:/lib/:/usr/lib/


/shared/clang $ Release+Asserts/bin/clang++ -print-search-dirs
programs:
=/shared/clang/Release+Asserts/bin:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../x86_64-redhat-linux/bin
libraries:
=/shared/clang/Release+Asserts/bin/../lib/clang/3.6.0:/usr/lib/gcc/x86_64-redhat-linux/4.4.7:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64:/lib/../lib64:/usr/lib/../lib64:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../..:/shared/clang/Release+Asserts/bin/../lib:/lib:/usr/lib

As you can see, clang is picking up the library search paths from the system
default compiler (gcc 4.4), rather than the search paths with which clang was
built (gcc 4.9).

Using LD_LIBRARY_PATH is not an option -- our build scripts deliberately unset
LD_LIBRARY_PATH before linking to ensure that only specifically named library
paths are searched.  

I'm attaching the config.log, which appears to show clang picking up gcc 4.9.0
for the build (as expected).

The command used to build clang is:

make clean distclean;CFLAGS="-std=gnu89" ../llvm/configure
--prefix=/build/share/clang --enable-optimized --enable-targets=x86_64 && make

At this point I'm not necessarily looking for a fix, but an indication whether
this is a legitimate problem with clang, or possibly a problem on our end.

Thanks!

-- 
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/20140801/02a270ec/attachment.html>


More information about the llvm-bugs mailing list