[PATCH] D68064: [Builtins] Provide a mechanism to selectively disable tests based on whether an implementation is provided by a builtin library.

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 13:41:18 PDT 2019


rupprecht added a comment.

In D68064#1713535 <https://reviews.llvm.org/D68064#1713535>, @delcypher wrote:

> Damn looks like something is broken for linux powerpc
>
> http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/21208/steps/ninja%20check%201/logs/stdio
>
>   llvm-lit: /home/buildbots/ppc64be-clang-multistage-test/clang-ppc64be-multistage/llvm/projects/compiler-rt/test/builtins/Unit/lit.cfg.py:116: fatal: builtins_source_features contains duplicates: ['librt_has_divtc3']
>
>
> I'm going to turn this into a warning to unbreak the bot for now.
>
> @joerg @rupprecht Any idea what's going on here? My CMake code jsut reads the source files used to built the builtin library. My guess is that both `lib/builtins/ppc/divtc3.c` and  `lib/builtins/divtc3.c` are used to build the builtin library for powerpc. That sounds like a bug. I'd expect that to cause a linker error with  multiple symbols of the same name being defined.


I think you have the right idea. From my reading:

1. All the builtins are added to `GENERIC_SOURCES`: e.g. divtc3 here: https://github.com/llvm/llvm-project/blob/2ca8e27bd038673b514c8452d661a413ce0d2123/compiler-rt/lib/builtins/CMakeLists.txt#L68
2. Per-arch builtins get **appended** to that list: e.g. for ppc/divtc3 here: https://github.com/llvm/llvm-project/blob/2ca8e27bd038673b514c8452d661a413ce0d2123/compiler-rt/lib/builtins/CMakeLists.txt#L521
3. Generic versions are later filtered out if there's a arch-specific builtin: https://github.com/llvm/llvm-project/blob/2ca8e27bd038673b514c8452d661a413ce0d2123/compiler-rt/lib/builtins/CMakeLists.txt#L607

If that's where the sources is coming from, why is it not being filtered when this cmake config looks at it? Is it not running because of the `if (APPLE)` before it?

(Huge caveat: I spend almost no time developing in cmake, so I don't really know what I'm looking at)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68064





More information about the llvm-commits mailing list