[PATCH] D60644: [compiler-rt][builtins][sanitizers] Guard test cases with macros to run when specific version of GLIBC is detected

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 13 18:37:52 PDT 2019


hubert.reinterpretcast requested changes to this revision.
hubert.reinterpretcast added a comment.
This revision now requires changes to proceed.

There may be different levels of failures in play:

- Correct compiler-rt behaviour with:
  - Bad build environment for the test: Building the test against a compatible newer toolchain and the same compiler-rt would result in passing behaviour.
  - Bad run environment for the test: In this case, deploying the test executable to a system with sufficiently new runtime libraries would result in passing behaviour.
- Incorrect compiler-rt behaviour due to a bad build environment: In this case, the test executable will intrinsically fail.

The last category is of concern: Should a bad build of compiler-rt "pass" the tests? This is made more complicated if a good build for the same target can easily be built.

I have observed that `projects/compiler-rt/test/builtins/Unit/POWERPC64LELinuxConfig/Output/compiler_rt_logb_test.c.tmp` passes when deployed to a machine with newer runtime libraries; so, checking the GLIBC version when building the test seems to be appropriate for that particular test.

However, `projects/compiler-rt/test/builtins/Unit/POWERPC64LELinuxConfig/Output/divsc3_test.c.tmp` and `projects/compiler-rt/test/builtins/Unit/POWERPC64LELinuxConfig/ppc/Output/qdiv_test.c.tmp` fail when compiler-rt is built using GCC 4.8.5 and pass when compiler-rt is built on the same machine, targeting the same runtime, using Clang. This is even if the passing and failing test executables are built using the same Clang, targeting the same runtime (aside from compiler-rt). Checking the GLIBC version being used when a test is built seems to be an odd way suppress failures associated with the toolchain used when building compiler-rt. Indeed, with the bad compiler-rt build, the two tests fail even when compiled, linked, and run against GLIBC 2.26.

As for `projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Posix/Output/getpw_getgr.cc.tmp`, this does not appear to have anything to do with the GLIBC version. When the test is built using a toolchain where `-D_GLIBCXX_USE_CXX11_ABI=1` is meaningful, the test passes when `-D_GLIBCXX_USE_CXX11_ABI=0` is not set.


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D60644





More information about the llvm-commits mailing list