[PATCH] D101681: [Compiler-rt] Distinguish between testing just built runtime libraries and the libraries shipped with the compiler.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 16:21:42 PDT 2021


delcypher added inline comments.


================
Comment at: compiler-rt/test/CMakeLists.txt:5
+option(COMPILER_RT_TEST_BUILT_LIBS
+  "When testing use the just built runtime libraries instead of the compiler's. \
+  This option has no effect when the compiler-rt build library directory is  \
----------------
yln wrote:
> aralisza wrote:
> > nit, is there a missing comma here? I had to read this a few times to parse it lol
> > 
> > ```
> > When testing, use the just built runtime libraries instead of the compiler's.
> > ```
> Maybe name and phrase this as "test with standalone libs"?
> 
> I was initially confused what "test (with) built libs" meant.  Usually (standard build), both the compiler and the runtime libs are "just built" and this distinction is only meaningful in the standalone case, right?
It's "just built" from the perspective if you had just run one of the testing targets (e.g.`check-asan`). That target would try to run tests but "just" before that the runtime libraries would be built. In the standalone case these are the libraries that would be most recently built compared to what the external compiler is using (they have to be older).

You're right though. This name isn't great. I was going to say this patch only matters for standalone builds but that's not quite accurate.

This patch matters when Clang and the compiler-rt disagree on the path to the runtime libraries. AFAIK this can only happen in standalone builds but it also needs to be a standalone build where Clang and compiler-rt disagree on the path. It turns out for the "llvm/runtimes" style standalone build  provides a value for `COMPILER_RT_OUTPUT_DIR` that should result in Clang and compiler-rt actually agreeing. So saying this patch always matters in standalone builds isn't quite accurate.

Perhaps a name like `COMPILER_RT_TEST_STANDALONE_BUILT_LIBS` with a description like

```
When doing testing in a standalone build, test the runtime libraries built by this standalone build rather than the runtime libraries shipped with the compiler (used for testing). This option has no effect if the compiler and this build are configured to use the same runtime library path.
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101681



More information about the llvm-commits mailing list