<div dir="ltr"><div>I'm OK with your patch as well. It feels a bit busted that we're only interested in the c strings and the header has to export <string>, but that's life in c-land.<br><br></div><div>Might be OK long term as long as xray_log_interface.h doesn't export c++ headers.<br>The Fdr logging implementation may be linked in, so I need to study a bit to understand the boundaries we have to operate in such we respect users of different stdlib implementations or users that are on Obj-C or C proper.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 16, 2017 at 3:28 PM, Dean Michael Berris <span dir="ltr"><<a href="mailto:dberris@google.com" target="_blank">dberris@google.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"><div class="gmail_quote"><span class=""><div dir="ltr">On Fri, Mar 17, 2017 at 4:57 AM Laurent Nicolas via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">lonico77 added inline comments.<br class="m_-6973461061010024780gmail_msg">
<br class="m_-6973461061010024780gmail_msg">
<br class="m_-6973461061010024780gmail_msg">
================<br class="m_-6973461061010024780gmail_msg">
Comment at: compiler-rt/trunk/lib/xray/<wbr>xray_fdr_logging_impl.h:137<br class="m_-6973461061010024780gmail_msg">
+        Report("Failed to release buffer at %p; error=%s\n", Buffer.Buffer,<br class="m_-6973461061010024780gmail_msg">
+               EC.message().c_str());<br class="m_-6973461061010024780gmail_msg">
+      return;<br class="m_-6973461061010024780gmail_msg">
----------------<br class="m_-6973461061010024780gmail_msg">
I'm seeing the following error when building with clang 3.9.1:<br class="m_-6973461061010024780gmail_msg">
<br class="m_-6973461061010024780gmail_msg">
<br class="m_-6973461061010024780gmail_msg">
```<br class="m_-6973461061010024780gmail_msg">
In file included from /x/eng/rtpbld01/scratch/<wbr>laurentn/llvm-wss/sources/<wbr>llvm_import_from_git_rtp2/<wbr>llvm/projects/compiler-rt/lib/<wbr>xray/tests/unit/xray_fdr_log_<wbr>printer_tool.cc:15:<br class="m_-6973461061010024780gmail_msg">
/x/eng/rtpbld01/scratch/<wbr>laurentn/llvm-wss/sources/<wbr>llvm_import_from_git_rtp2/<wbr>llvm/projects/compiler-rt/lib/<wbr>xray/tests/../xray_fdr_<wbr>logging_impl.h:137:19: error: implicit instantiation of undefined template 'std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >'<br class="m_-6973461061010024780gmail_msg">
               EC.message().c_str());<br class="m_-6973461061010024780gmail_msg">
                  ^<br class="m_-6973461061010024780gmail_msg">
/x/eng/btools/arch/x86_64-<wbr>redhat-rhel6/compilers_n_<wbr>tools/pkgs/llvm-3.9.1-p1/bin/.<wbr>./include/c++/v1/iosfwd:193:<wbr>33: note: template is declared here<br class="m_-6973461061010024780gmail_msg">
    class _LIBCPP_TYPE_VIS_ONLY basic_string;<br class="m_-6973461061010024780gmail_msg">
                                ^<br class="m_-6973461061010024780gmail_msg">
```<br class="m_-6973461061010024780gmail_msg">
<br class="m_-6973461061010024780gmail_msg">
And the same error shows up in 5 other locations where EC.message() is used.<br class="m_-6973461061010024780gmail_msg">
<br class="m_-6973461061010024780gmail_msg">
I was able to bypass the error by adding<br class="m_-6973461061010024780gmail_msg">
<br class="m_-6973461061010024780gmail_msg">
```<br class="m_-6973461061010024780gmail_msg">
 #include <mutex><br class="m_-6973461061010024780gmail_msg">
+#include <string><br class="m_-6973461061010024780gmail_msg">
 #include <system_error><br class="m_-6973461061010024780gmail_msg">
```<br class="m_-6973461061010024780gmail_msg">
in llvm/projects/compiler-rt/lib/<wbr>xray/xray_buffer_queue.h<br class="m_-6973461061010024780gmail_msg">
<br class="m_-6973461061010024780gmail_msg">
but I'm not sure it's the best way to address this across platforms.<br class="m_-6973461061010024780gmail_msg">
<br class="m_-6973461061010024780gmail_msg"></blockquote><div><br></div></span><div>Interesting. Which standard library is this? Is this libstdc++ or libc++?</div><div><br></div><div>I suppose this is a change that's alright to make, if it fixes the error for clang-3.9.1.</div></div></div>
</blockquote></div><br></div>