[PATCH][libcxx] Support command line configuration of ABI libraries for testing

Michael van der Westhuizen r1mikey at gmail.com
Thu Feb 7 01:10:21 PST 2013


Hi Daniel,

The attached patch adds support for specifying the ABI libraries to link against for testing purposes.  This, with the CMake ABI library support patch I sent previously, allows me to build and test against all three supported ABI libraries without source tree modifications.

The patch adds a lit parameter called extra_link_libs, which specifies the "-l" arguments to use when linking tests.  If not present, the lit.cfg maintains the existing behaviour (on Linux this is suitable for libsupc++ only).

To use this, from my libc++ build directory I run the following to build and test against all supported ABI libraries:

$ rm -rf * && cmake -DLIBCXX_CXX_ABI=libsupc++ '-DLIBCXX_LIBSUPCXX_INCLUDE_PATHS=/usr/include/c++/4.7;/usr/include/x86_64-linux-gnu/c++/4.7' -DLIT_EXECUTABLE=/home/michael/llvm/utils/lit/lit.py ../libcxx && make -j 4 && make check-libcxx
$ rm -rf * && cmake -DLIBCXX_CXX_ABI=libcxxabi '-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=/home/michael/libcxxabi/include' -DLIT_EXECUTABLE=/home/michael/llvm/utils/lit/lit.py '-DLLVM_LIT_ARGS=-sv --param extra_link_libs="-lc++abi -lunwind -lc -lm -lpthread -lrt -lgcc_s"' ../libcxx && make -j 4 && make check-libcxx
$ rm -rf * && cmake -DLIBCXX_CXX_ABI=libcxxrt '-DLIBCXX_LIBCXXRT_INCLUDE_PATHS=/home/michael/libcxxrt/src' -DLIT_EXECUTABLE=/home/michael/llvm/utils/lit/lit.py '-DLLVM_LIT_ARGS=-sv --param extra_link_libs="-lcxxrt -lc -lm -lpthread -lrt -lgcc_s"' ../libcxx && make -j 4 && make check-libcxx

This should be usable for testing against compiler-rt as well.

I'll flesh out some build instructions for all the ABI variants on Linux and submit those as a separate patch.

I suppose the next big challenge would be having the driver support ABI library configuration, but that's a bit beyond me at the moment!

I'll send a separate mail to cfe-dev with current Linux test results for the various ABI libraries.

Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libcxx-test-extra_link_libs.patch
Type: application/octet-stream
Size: 1394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130207/4dd79674/attachment.obj>


More information about the cfe-commits mailing list