[PATCH] D133475: [docs] Fix build-docs.sh

Louis Dionne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 19 12:19:56 PDT 2022


ldionne added a comment.

In D133475#3791649 <https://reviews.llvm.org/D133475#3791649>, @thieta wrote:

> @ldionne any ideas? would like to fix this before 15.0.1 next week so I don't have to manually build the docs.

Okay, I looked into it and the issue is basically that `libcxx-abi-shared` does not exist when `libcxxabi` is not in `LLVM_ENABLE_RUNTIMES`. That's normally okay, except when we generate a linker script in place of `libc++.so` (aka on Linux), since that requires resolving the ABI library's target to know to add `-lc++abi`. I would normally expect that generator expressions inside the linker script generation are only evaluated if we actually perform the `POST_BUILD` step it's associated to, but that's not how CMake works. It seems to eagerly evaluate the generator expressions, leading to problems since at least one of them is invalid.

Potential fixes:

1. When specifying `LIBCXX_CXX_ABI=libcxxabi` (which is also the default), we could implicitly add `LLVM_ENABLE_RUNTIMES=libcxxabi`.
2. We could mandate that users pass `LLVM_ENABLE_RUNTIMES=libcxxabi` when they select `LIBCXX_CXX_ABI=libcxxabi`. We would add a proper diagnostic to avoid confusing users. Since `LIBCXX_CXX_ABI=libcxxabi` is the default, that would mean that most users would suddenly have to specify `LLVM_ENABLE_RUNTIMES=libcxxabi` if they don't already do it.
3. Add a narrow workaround for the problem by e.g. not creating a linker script if `libcxx-abi-shared` is not present. This is kind of hacky, since it would mean that e.g. running `ninja install-cxx` would result in a malfunctioning libc++ installation on Linux, and that would be silent.

(2) seems like a lot of breakage and user-facing complexity for little to no benefit.
(3) seems like the worst of both worlds, where we set ourselves up for silent problems down the road.

Therefore, I conclude that the best way forward would be (1). I also think it's kind of weird to do that, but all the other options really don't make sense to me.

So as far as I'm concerned, you can ship this to unblock you in the short term. However, I'll look into doing (1) and landing that for LLVM 16.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133475



More information about the llvm-commits mailing list