[libcxx-commits] [PATCH] D97572: [libc++] Include <__config_site> from <__config>

Bjorn Pettersson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 22 08:51:34 PDT 2021


bjope added a comment.

In D97572#3015406 <https://reviews.llvm.org/D97572#3015406>, @ldionne wrote:

> In D97572#2835202 <https://reviews.llvm.org/D97572#2835202>, @phosek wrote:
>
>> We could put it behind a CMake option that's going to be opt-in, for example `LIBCXX_GENERIC_CONFIG_SITE`, would that work?
>>
>> @ldionne do you have any other ideas? Would this be OK with you?
>
> Stumbled upon this months later while clearing my email queue, I hope the discussion is still relevant.
>
> @bjope What is the intent when compiling for `--target=powerpc64le-unknown-linux-gnu` with a library that has only been built for `x86_64-unknown-linux-gnu`? Is the intent that the `__config_site` used for `powerpc64le-unknown-linux-gnu` is the same as the one for `x86_64-unknown-linux-gnu`? To me, that sounds like something we can't really guess. I think what I'm wondering here is why you're using `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON` at all.
>
> Having a fallback is indeed tricky because we really want to avoid at all costs using the wrong `__config_site` by mistake (this could lead to incredibly tricky errors including ABI breaks). I would also really like to avoid adding an opt-in for this - there has to be a better solution.

Not sure exactly the history related to using `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON`, but out downstream compiler has support for a couple of different DSP targets and then we also support x86_64-unknown-linux-gnu (some users are basically using that for unittests running on the build server). So our release includes builtins/runtimes for those different targets.
However, we do not limit `LLVM_TARGETS_TO_BUILD` to only those target when we build/test/release the compiler, so clang will support targets such as powerpc (but we do not build/release any runtimes for powerpc).

If I recall correctly one of the problems that we started to see with this commit was that the test case `clang/test/CodeGen/ppc-xmmintrin.c` started to fail. That is the test case that is using `powerpc64le-unknown-linux-gnu`, and that would fail with `fatal error: '__config_site' file not found`.
So we could not use `ninja check-all` with that build setup.

Our current "workaround" is to avoid using `-DCLANG_DEFAULT_CXX_STDLIB=libc++`. So we kind of postponed the idea of building the compiler with `libc++`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97572



More information about the libcxx-commits mailing list