[LLVMdev] [3.5 Release] Release Candidate 1 Sources and Binaries Available

Ben Pope benpope81 at gmail.com
Wed Jul 30 19:53:39 PDT 2014


On Wednesday, July 30, 2014 11:26 PM, Larry Evans wrote:
> On 07/30/2014 10:06 AM, Larry Evans wrote:
>> On 07/30/2014 12:35 AM, Ben Pope wrote:
>>> On Wednesday, July 30, 2014 01:31 PM, Ben Pope wrote:
>>>
>>>> ldd your_built_clang | grep libstdc++
>>>> chrpath -l your_built_clang
>>>
>>> Hmm, where "your_built_clang" should be the actual failing executable:
>>> /home/evansl/dwnlds/llvm/3.5rc1/build/Release+Asserts/bin/llvm-tblgen
>>>
>>> Ben
>> Here's the result:
>>
>> -*- mode: compilation; default-directory:
>> "~/dwnlds/llvm/3.5rc1/build-variants/" -*-
>> Compilation started at Wed Jul 30 10:03:38
>>
>> make -f my.mk chrpath
>> cat hello_world.cpp
>> #include <iostream>
>> int main()
>> {
>>      std::cout<<"Hello World!\n";
>>      return 0;
>> }
>> g++ --version
>> g++ (GCC) 4.9.0
>> Copyright (C) 2014 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>
>> g++ hello_world.cpp
>> ./a.out
>> Hello World!
>> ldd a.out | grep libstdc++
>> 	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
>> (0x00002b30fdb04000)
>> chrpath -l a.out
>> a.out: no rpath or runpath tag found.
>> make: [chrpath] Error 2 (ignored)
>> ldd ./with_LD_LIBRARY_PATH/Release+Asserts/bin/llvm-tblgen | grep libstdc++
>> ./with_LD_LIBRARY_PATH/Release+Asserts/bin/llvm-tblgen:
>> /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.20' not
>> found (required by ./with_LD_LIBRARY_PATH/Release+Asserts/bin/llvm-tblgen)
>> 	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
>> (0x00002aee42a0f000)
>> chrpath -l ./with_LD_LIBRARY_PATH/Release+Asserts/bin/llvm-tblgen
>> ./with_LD_LIBRARY_PATH/Release+Asserts/bin/llvm-tblgen: RPATH=$ORIGIN/../lib
>>
>> Compilation finished at Wed Jul 30 10:03:38
>>
> OTHO, when LD_LIBRARY_PATH is set to /usr/local/...,
> there's no "not found" error message:

Is the test above without LD_LIBRARY_PATH set?

> -*- mode: compilation; default-directory:
> "~/dwnlds/llvm/3.5rc1/build-variants/" -*-
> Compilation started at Wed Jul 30 10:22:38
>
> make -f my.mk libpath.chrpath
> LD_LIBRARY_PATH=/usr/local/lib64 make -f my.mk chrpath
> make[1]: Entering directory `/home/evansl/dwnlds/llvm/3.5rc1/build-variants'
> cat hello_world.cpp
> #include <iostream>
> int main()
> {
>      std::cout<<"Hello World!\n";
>      return 0;
> }
> g++ --version
> g++ (GCC) 4.9.0
> Copyright (C) 2014 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>
> g++ hello_world.cpp
> ./a.out
> Hello World!
> ldd a.out | grep libstdc++
> 	libstdc++.so.6 => /usr/local/lib64/libstdc++.so.6 (0x00002ac7aded9000)
> chrpath -l a.out
> a.out: no rpath or runpath tag found.
> make[1]: [chrpath] Error 2 (ignored)
> ldd ./with_LD_LIBRARY_PATH/Release+Asserts/bin/llvm-tblgen | grep libstdc++
> 	libstdc++.so.6 => /usr/local/lib64/libstdc++.so.6 (0x00002b0112130000)
> chrpath -l ./with_LD_LIBRARY_PATH/Release+Asserts/bin/llvm-tblgen
> ./with_LD_LIBRARY_PATH/Release+Asserts/bin/llvm-tblgen: RPATH=$ORIGIN/../lib
> make[1]: Leaving directory `/home/evansl/dwnlds/llvm/3.5rc1/build-variants'
>
> Compilation finished at Wed Jul 30 10:22:38

I'm not 100% sure on this, but you seem to be configured to build 
executables with g++, but not run them, a cross-compiler of sorts.  I'm 
not sure under what conditions executables built with g++-4.9 require 
GLIBCXX_3.4.20, perhaps try compiling something new like hello_regex.cpp.

I think you have a few of options:

* Install g++-4.9 to /usr
* Add /usr/local/lib64 to /etc/ld.so.conf

The above two options means you're installing updated libstdc++ system-wide.

* Set the rpath of the binaries at build time: g++-4.9 
-Wl,-rpath=/usr/local/lib64

You may want to set that into the compiler options and recompile g++.

* Copy /usr/local/lib64/libstdc++.so.6 to 
./with_LD_LIBRARY_PATH/Release+Asserts/lib

I'm out of ideas.

Ben





More information about the llvm-dev mailing list