[libcxx-commits] [PATCH] D71894: [libcxxabi] Allow tests to link with static libc++abi/libc++ even if the shared version is present

Sergej Jaskiewicz via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 30 02:15:02 PST 2020


broadwaylamb added a comment.

In D71894#1848378 <https://reviews.llvm.org/D71894#1848378>, @ldionne wrote:

> This commit broke testing when `LIBCXX_ENABLE_STATIC` is `OFF`. This includes the configuration in Apple's CMake cache.


I've updated the revision. I've run the tests using the Apple cache (and I undid 93cdd310e16ec57efd4a93886dd3b71ea4cf8183 <https://reviews.llvm.org/rG93cdd310e16ec57efd4a93886dd3b71ea4cf8183> to verify that the issue has indeed been fixed) and it seems to work.

> It also seems to assume that we want to carry on supporting standalone builds of libc++abi, which isn't our intention (unless something's changed recently).

Not necessarily. What if we want to build both static and dynamic versions, but only test against the static one? It seemed weird that the test configuration did not provide a way to explicitly specify that.

But I admit that the inability to build static libc++abi in non-standalone mode for testing was the main reason for this patch. I wanted to invest some time in fixing this <https://github.com/llvm/llvm-project/blob/54c522420347e58aa7bae1892cf5c5672b57c875/libcxxabi/CMakeLists.txt#L503-L519>, but I've looked through the git history of those lines, which were added 6 years ago <https://github.com/llvm/llvm-project/commit/a770f9d66b9508c42c729f8d2200c4d11a2b7484#diff-bbf9fd7946dbcfaba6cddfea780688e8R235-R247> and still no one fixed it, so I figured that I, with my very limited libc++/libc++abi experience, am of no help there.

> Also, you didn't wait for one of the usual maintainers to sign off on this.
> 
> I'm tempted to revert this but I won't do it immediately.

Thanks for giving a chance to address your comments. I'll be more careful next time.

> Can you show me how you're building libc++abi which makes it _not work_ when you set `LIBCXXABI_ENABLE_SHARED` to `OFF`?

My primary use case is building a Windows to ARM Linux cross-toolchain for this buildbot <http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l>. But the issue can be reproduced on macOS as well (assuming we're inside the build directory):

  cmake -G Ninja -DLLVM_ENABLE_RUNTIMES="libcxxabi" -DLIBCXXABI_ENABLE_SHARED=OFF ${MONOREPO_ROOT}/llvm
  ninja cxxabi

This produces the warning:

  CMake Warning at /Users/sergej/Developer/llvm-project/libcxxabi/CMakeLists.txt:545 (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!

and I can't do `ninja check-cxxabi`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71894/new/

https://reviews.llvm.org/D71894





More information about the libcxx-commits mailing list