dberris added a comment.

In https://reviews.llvm.org/D46998#1103397, @dblaikie wrote:

> "In the future we can revisit this when we have a better idea as to why not 
> depending on the C++ ABI functionality is a better solution."  - this was 
> discussed previously in the thread linked from the bug.
> A big thing, so far as I understand it, is that Clang doesn't require some 
> specific C++ library, so wouldn't this break for users who didn't have the 
> specific C++ library installed that compiler-rt for XRay was built against?

We don't use anything from the C++ library directly, we depend on some features 
provided by the implementation. In some cases, this isn't a library:

  extern int g();
  int f() {
    static int val = g();
    return val;

This will emit calls to guards for the thread-safe initialisation of val.

The alternatives here are that XRay just avoids these completely, and use 
pthreads instead to do a pthread_once_init(...).

The other alternative is to avoid pthreads and use the sanitizer_common mutexes 
too, to make it self-contained in compiler-rt.

The other alternative is to just link in the ABI library (libcxxabi or 
something else) instead of the standard library.

I can make one of those changes work, but that's also a lot of work, which I 
suppose is worth doing anyway (unless I'm missing something simpler).

Any preferences/stack-ranking of which solution might be more palatable?


cfe-commits mailing list

Reply via email to