[PATCH] D38703: [lit] Only enable LSan on darwin when clang supports it

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 14:36:30 PDT 2017


zturner added inline comments.


================
Comment at: utils/lit/lit/llvm/config.py:83
             if re.match(r'^x86_64.*-apple', target_triple):
-                if 'address' in sanitizers:
+                if 'address' in sanitizers and self.get_clang_has_lsan(config.host_cxx, target_triple):
                     self.with_environment(
----------------
zturner wrote:
> How is `config.host_cxx` set?  I don't think this is always set is it?
Actually I think this is wrong, for several reasons:

1. This is only set in LLVM's lit configuration, and not in, for example, clang's lit configuration.  But this code will run no matter what.  So if you were to run `ninja check-clang` then you'd get an error here.

2. "Which clang are we using?" is not easy to answer generally.  If you're testing LLVM then there is not necessarily even a clang to begin with, you coudl be using gcc or something.  Regardless, you want to refer to the host compiler (i.e. the compiler used to build LLVM).  On the other hand, if you're testing clang then you probably want to test the clang you just built, and not the host compiler (even if the host compiler was clang).  So in this case, the logic to determine which clang to use is not so simple, and clang's configuration files hav a function called 'inferClang' for this purpose.



https://reviews.llvm.org/D38703





More information about the llvm-commits mailing list