[cfe-dev] [libc++] Running tests from cmake?

David Chisnall theraven at sucs.org
Fri Sep 23 03:13:52 PDT 2011


I used testit to run the tests.  The FreeBSD port of libunwind contains a semicolon in unwind.h that breaks inclusion in any C++ programs, so you need to remove that after step 3.

When you build libcxxrt, you'll need to specify -nostdlib when you compile, or it will link against libstdc++ (which causes some interesting test failures later).

You don't want to be linking against both libunwind and libgcc_s - they both contain implementations of the generic unwind code, so you're likely to end up with everything horribly broken.  If you want to replace libgcc_s with libunwind, then you will need to use PathScale's version - the libunwind port is just installed for the header, not for the library.

The unresolved libc++ error sounds like it can't find libc++.  I symlinked libc++.so and libcxxrt.so into /usr/local/lib, used clang from svn (which looks here by default - the system compiler only looks in /usr, the ports version looks in /usr/local).  

With that done, almost all of the tests pass.  Hopefully in a few days Roman will start working on merging this stuff into the base system, so end users won't need to worry about it.

David

On 22 Sep 2011, at 23:51, OKUMURA Yuki wrote:

> Hi list,
> I'd tested this myself, but some tests failed with ETXTBSY and
> "testit" script is preferred choice for now..
> (It seems clang driver problem, but i haven't confirmed it yet.)
> 
> To reproduce...:
> 1) (install https://github.com/okuoku/freebsd-head to get xlocale-ready FBSD)
> 2) install devel/libunwind
> 3) install libcxxrt from https://github.com/pathscale/libcxxrt
> 4) patch libcxx/test/lit.cfg
> 
> diff --git a/test/lit.cfg b/test/lit.cfg
> index d8023fd..026ea63 100644
> --- a/test/lit.cfg
> +++ b/test/lit.cfg
> @@ -146,6 +146,9 @@ if sys.platform == 'darwin':
> if sys.platform == 'linux2':
>   libraries += ['-lgcc_eh', '-lsupc++', '-lc', '-lm', '-lrt', '-lgcc_s']
>   libraries += ['-Wl,-R', libcxx_obj_root + '/lib']
> +if sys.platform == 'freebsd8':
> +  libraries += ['-lpthread', '-lcxxrt', '-lunwind', '-lc', '-lm', '-lgcc_s']
> +  libraries += ['-Wl,-R', libcxx_obj_root + '/lib']
> 
> config.test_format = LibcxxTestFormat(cxx_under_test,
>                                       cpp_flags = ['-nostdinc++'] +
> compile_flags + include_paths,
> 
> 5) configure libc++ with: cmake
> -DLIT_EXECUTABLE=/PATH/TO/llvm/utils/lit/lit.py
> -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ /PATH/TO/libcxx
> 6) gmake && gmake check
> 
> You will get errors like following:
> 
> UNRESOLVED: libc++ ::
> localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
> (1980 of 4324)
> ******************** TEST 'libc++ ::
> localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp'
> FAILED ********************
> Exception during script execution:
> Traceback (most recent call last):
>  File "/usr/home/oku/repos/llvm/utils/lit/lit/main.py", line 122, in runTest
>    self.litConfig)
>  File "/home/oku/repos/libcxx/test/lit.cfg", line 86, in execute
>    out, err, exitCode = self.execute_command(cmd)
>  File "/home/oku/repos/libcxx/test/lit.cfg", line 29, in execute_command
>    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
>  File "/usr/local/lib/python2.7/subprocess.py", line 679, in __init__
>    errread, errwrite)
>  File "/usr/local/lib/python2.7/subprocess.py", line 1228, in _execute_child
>    raise child_exception
> OSError: [Errno 26] Text file busy
> 
> -- oku


-- Sent from my STANTEC-ZEBRA





More information about the cfe-dev mailing list