How to include abi and unwind tests in libcxx test suite in standalone mode

Hi Louis,

sorry for bothering you once more about the libcxx test suite! I was wondering whether you could help with some of my problems again.

After the recent discussion on the mailing list and your diff, I was able to set up cross-compilation and remote-execution of the libcxx test suite, so thank you for that!

We have split up the build of the libraries into different stages, so libcxx, libcxxabi and libunwind are all built in standalone mode. If I understand correctly, libcxxabi and libunwind tests are not supported when using this. Is there a way to include those tests when running the libcxx test suite?

If not, what is the recommended way to build and test those libraries when doing cross-compilation?

Cheers,

Dominik

Hi Louis,

sorry for bothering you once more about the libcxx test suite! I was wondering whether you could help with some of my problems again.

After the recent discussion on the mailing list and your diff, I was able to set up cross-compilation and remote-execution of the libcxx test suite, so thank you for that!

I'm glad to hear that!

We have split up the build of the libraries into different stages, so libcxx, libcxxabi and libunwind are all built in standalone mode. If I understand correctly, libcxxabi and libunwind tests are not supported when using this. Is there a way to include those tests when running the libcxx test suite?

If not, what is the recommended way to build and test those libraries when doing cross-compilation?

Yes, they are supported. It's just that I haven't implemented the ability to use a 100% custom site config file for libcxxabi and libunwind, but it should work just the same. I'll try doing that today -- it should be the same dance as what I did for libcxx.

Louis

I just landed these patches:

    commit c55051eea5d3cd57abfd9727f519b670517704d9
    Author: Louis Dionne <ldionne@apple.com>

Hi Louis,

sorry for digging up this old thread. I only just got around to start working on this again.

I wanted to set up the libc++abi tests as standalone and I'm getting the following error:

CMake Warning at CMakeLists.txt:480 (message):
The libc++abi tests aren't valid when libc++abi is built standalone (i.e.
outside of llvm/projects/libcxxabi ) and is built without a shared library.
Either build a shared library, build libc++abi at the same time as you
build libc++, or do without testing. No check target will be available!

I'm building in-tree but standalone. Is this intended even with your new patches or a bug?

Cheers,

Dominik

One more thing: manually deleting the standalone check in order to generate the check-cxxabi target does not work either. First, /bin/llvm-lit is not generated (and trying to copy the relevant CMake snippet from the libcxx CMakeLists.txt causes an error) and executing check-cxxabi executes something, but then crashes with the following error:

lit.py: llvm/utils/lit/lit/TestingConfig.py:101: fatal: unable to parse config file 'build/test/lit.site.cfg', traceback: Traceback (most recent call last):
File "llvm/utils/lit/lit/TestingConfig.py", line 88, in load_from_path
exec(compile(data, path, 'exec'), cfg_globals, None)
File "build/test/lit.site.cfg", line 153, in <module>
configuration.configure()
File "libcxx/utils/libcxx/test/config.py", line 148, in configure
self.lit_config
File "libcxx/utils/libcxx/test/newconfig.py", line 22, in configure
feature.enableIn(config)
File "libcxx/utils/libcxx/test/dsl.py", line 270, in enableIn
assert self.isSupported(config), \
File "libcxx/utils/libcxx/test/dsl.py", line 243, in isSupported
return self._isSupported(config)
File "libcxx/utils/libcxx/test/params.py", line 20, in <lambda>
when=lambda cfg: hasCompileFlag(cfg, '-std={}'.format(std)))),
File "libcxx/utils/libcxx/test/dsl.py", line 125, in hasCompileFlag
with _makeConfigTest(config) as test:
File "libcxx/utils/libcxx/test/dsl.py", line 62, in _makeConfigTest
prefix=testPrefix)
File "/usr/lib/python2.7/tempfile.py", line 475, in NamedTemporaryFile
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
File "/usr/lib/python2.7/tempfile.py", line 242, in _mkstemp_inner
file = _os.path.join(dir, pre + name + suf)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

I remember seeing this error in libcxx when I manually tried to execute a test with python2 instead of python3. But I don’t see any way to tell the test suite to use python3 for the check-cxxabi target.

Am I missing something or is standalone testing of libcxxabi currently broken/not supported?

Cheers,

Dominik