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

Michael van der Westhuizen r1mikey at gmail.com
Mon Feb 11 01:56:09 PST 2013


Hi Daniel,

I've attached an updated patch that implements this flag as "link_flags", still respecting the use_system_lib flag.

Lines are wrapped to 80 columns - I've wrapped a few extra lines too, so the whole file should now confirm to this standard.

Michael



On 08 Feb 2013, at 8:22 PM, Michael van der Westhuizen <r1mikey at gmail.com> wrote:

> Thanks for the feedback Daniel.
> 
> I'll submit a new patch next week with these changes.
> 
> Michael
> 
> On 08 Feb 2013, at 19:49, Daniel Dunbar <daniel at zuster.org> wrote:
> 
>> Hi Michael,
>> 
>> Two comments on the patch:
>> 
>> 1. Please wrap lines to 80 columns.
>> 
>> 2. As written, the usage isn't quite "extra" link libraries, rather it completely replaces the link libraries. I would propose making that part of the name and just calling it ldflags or link_flags, and have it completely override the link line (which would still get extended if use_system_lib is available).
>> 
>>  - Daniel
>> 
>> 
>> 
>> On Thu, Feb 7, 2013 at 1:10 AM, Michael van der Westhuizen <r1mikey at gmail.com> wrote:
>> 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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130211/26228f59/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libcxx-test-link_flags.patch
Type: application/octet-stream
Size: 4292 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130211/26228f59/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130211/26228f59/attachment-0001.html>


More information about the cfe-commits mailing list