[PATCH] D30850: [XRay] [compiler-rt] Refactor logic for xray fdr logging. NFC.

Laurent Nicolas via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 17 08:47:44 PDT 2017


Thank you all.   Yes this was using libc++ header files. 

Laurent 

> On Mar 16, 2017, at 8:50 PM, Dean Michael Berris <dberris at google.com> wrote:
> 
> Now fixed in r298039
> 
>> On Fri, Mar 17, 2017 at 2:02 PM Dean Michael Berris <dberris at google.com> wrote:
>> Cool -- yes, we can make this an ongoing effort in light of http://llvm.org/PR32274.
>> 
>> I'm going to make this change upstream, we can continue the discussion on the bug for details of removing the dependency on the C++ standard library in the bug?
>> 
>> On Fri, Mar 17, 2017 at 1:04 PM Keith Wyss <wyssman at gmail.com> wrote:
>> 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.
>> 
>> Might be OK long term as long as xray_log_interface.h doesn't export c++ headers.
>> 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.
>> 
>> On Thu, Mar 16, 2017 at 3:28 PM, Dean Michael Berris <dberris at google.com> wrote:
>> On Fri, Mar 17, 2017 at 4:57 AM Laurent Nicolas via Phabricator <reviews at reviews.llvm.org> wrote:
>> lonico77 added inline comments.
>> 
>> 
>> ================
>> Comment at: compiler-rt/trunk/lib/xray/xray_fdr_logging_impl.h:137
>> +        Report("Failed to release buffer at %p; error=%s\n", Buffer.Buffer,
>> +               EC.message().c_str());
>> +      return;
>> ----------------
>> I'm seeing the following error when building with clang 3.9.1:
>> 
>> 
>> ```
>> In file included from /x/eng/rtpbld01/scratch/laurentn/llvm-wss/sources/llvm_import_from_git_rtp2/llvm/projects/compiler-rt/lib/xray/tests/unit/xray_fdr_log_printer_tool.cc:15:
>> /x/eng/rtpbld01/scratch/laurentn/llvm-wss/sources/llvm_import_from_git_rtp2/llvm/projects/compiler-rt/lib/xray/tests/../xray_fdr_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> >'
>>                EC.message().c_str());
>>                   ^
>> /x/eng/btools/arch/x86_64-redhat-rhel6/compilers_n_tools/pkgs/llvm-3.9.1-p1/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
>>     class _LIBCPP_TYPE_VIS_ONLY basic_string;
>>                                 ^
>> ```
>> 
>> And the same error shows up in 5 other locations where EC.message() is used.
>> 
>> I was able to bypass the error by adding
>> 
>> ```
>>  #include <mutex>
>> +#include <string>
>>  #include <system_error>
>> ```
>> in llvm/projects/compiler-rt/lib/xray/xray_buffer_queue.h
>> 
>> but I'm not sure it's the best way to address this across platforms.
>> 
>> 
>> Interesting. Which standard library is this? Is this libstdc++ or libc++?
>> 
>> I suppose this is a change that's alright to make, if it fixes the error for clang-3.9.1.
>> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170317/9a77def8/attachment.html>


More information about the llvm-commits mailing list