<div dir="ltr">Thanks for the heads up. That sounds like a better way to handle this.<div><br></div><div>/Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 14, 2014 at 11:30 AM, Alexey Samsonov <span dir="ltr"><<a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">FYI ASan/MSan should discover llvm-symbolizer from PATH env var. So, as an alternative, you could just propagate necessary PATH bits to lit-tests.</div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Thu, Nov 13, 2014 at 6:47 PM, Eric Fiselier <span dir="ltr"><<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ericwf<br>
Date: Thu Nov 13 20:47:08 2014<br>
New Revision: 221966<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=221966&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=221966&view=rev</a><br>
Log:<br>
Setup llvm-symbolizer when running the tests with sanitizers<br>
<br>
Modified:<br>
    libcxx/trunk/test/lit.cfg<br>
<br>
Modified: libcxx/trunk/test/lit.cfg<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.cfg?rev=221966&r1=221965&r2=221966&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/lit.cfg?rev=221966&r1=221965&r2=221966&view=diff</a><br>
==============================================================================<br>
--- libcxx/trunk/test/lit.cfg (original)<br>
+++ libcxx/trunk/test/lit.cfg Thu Nov 13 20:47:08 2014<br>
@@ -425,16 +425,30 @@ class Configuration(object):<br>
     def configure_sanitizer(self):<br>
         san = self.get_lit_conf('llvm_use_sanitizer', '').strip()<br>
         if san:<br>
+            # Search for llvm-symbolizer along the compiler path first<br>
+            # and then along the PATH env variable.<br>
+            symbolizer_search_paths = os.environ.get('PATH', '')<br>
+            cxx_path = lit.util.which(self.cxx)<br>
+            if cxx_path is not None:<br>
+                symbolizer_search_paths = os.path.dirname(cxx_path) + \<br>
+                                          os.pathsep + symbolizer_search_paths<br>
+            llvm_symbolizer = lit.util.which('llvm-symbolizer',<br>
+                                             symbolizer_search_paths)<br>
+            # Setup the sanitizer compile flags<br>
             self.compile_flags += ['-fno-omit-frame-pointer']<br>
             if sys.platform.startswith('linux'):<br>
                 self.link_flags += ['-ldl']<br>
             if san == 'Address':<br>
                 self.compile_flags += ['-fsanitize=address']<br>
+                if llvm_symbolizer is not None:<br>
+                    self.env['ASAN_SYMBOLIZER_PATH'] = llvm_symbolizer<br>
                 self.config.available_features.add('asan')<br>
             elif san == 'Memory' or san == 'MemoryWithOrigins':<br>
                 self.compile_flags += ['-fsanitize=memory']<br>
                 if san == 'MemoryWithOrigins':<br>
                     self.compile_flags += ['-fsanitize-memory-track-origins']<br>
+                if llvm_symbolizer is not None:<br>
+                    self.env['MSAN_SYMBOLIZER_PATH'] = llvm_symbolizer<br>
                 self.config.available_features.add('msan')<br>
             elif san == 'Undefined':<br>
                 self.compile_flags += ['-fsanitize=undefined',<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</font></span></div>
</blockquote></div><br></div>