[cfe-dev] How to completely removed the libstdc++ dependency from building Boost?

Zack Perry zack.perry at sbcglobal.net
Mon Apr 8 17:56:49 PDT 2013


I have followed the instructions on http://libcxx.llvm.org/ and built
libc++ in two of the three approaches suggested:

0. Build on Linux using CMake and libsupc++
1. Build on Linux using CMake and libc++abi

The build host runs Scienetific Linux 6.4 (a RHEL 6.4 clone) x86_64. 
The latest llvm/clang 3.3 from SVN is used.

As a test of what I built, I downloaded the latest boost_1_53_0 and 
tried to build it with clang/libc++ and/or libc++abi.  In both case,
the entire boost_1_53_0 got built successfully.  

One of my goals is to ensure all the resulting boost libraries are 
free from libstdc++.  I know what libsupc++ is, so I expected that a 
ldd *.so* in BOOST_ROOT/stage/lib would show dependencies of it.

In fact, the following three do:

libboost_graph
libboost_locale
libboost_regex

But once I switched to approach 1, a ldd *.so* in stage/lib still show
the three libs having dependencies on libstdc++ x-(

For example:

ldd libboost_regex.*so*
[...]
libboost_regex.so.1.53.0:
	linux-vdso.so.1 =>  (0x00007fffe9ae3000)
	libicuuc.so.42 => /usr/lib64/libicuuc.so.42 (0x00007f8fd7be5000)
	libicui18n.so.42 => /usr/lib64/libicui18n.so.42 (0x00007f8fd784f000)
	libicudata.so.42 => /usr/lib64/libicudata.so.42 (0x00007f8fd6709000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f8fd6501000)
	libc++abi.so.1 => /usr/lib/libc++abi.so.1 (0x00007f8fd62b5000)
	libc++.so.1 => /usr/lib/libc++.so.1 (0x00007f8fd6000000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f8fd5d7c000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8fd5b66000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8fd5948000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f8fd55b5000)
	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f8fd52af000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f8fd8247000)

This is what I used to build the full boost_1_53_0:

./b2 toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++ -lc++abi" -j4

How did the libstdc++.so.6 sneaked in? ./b2 --help didn't provide me
a clue ;-(

I would appreciate a hint!

Zack



More information about the cfe-dev mailing list