[PATCH] D58110: Support fiber API on macOS

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 13 09:33:14 PST 2019


kubamracek added a comment.

@yln Could you take a look? Do the tests actually pass on Darwin?

The `_XOPEN_SOURCE` stuff is ugly, but I guess it's necessary to use swapcontext on Darwin. For the pragma diagnostic push/ignore stuff, we might be better off just redeclaring the function ourselves without including `ucontext.h`. TBH, I'm not sure if there's a lot of value in supporting swapcontext on Darwin, as they are very likely broken when using many system libraries.



================
Comment at: test/tsan/fiber_asm.cc:21-22
+
+__asm__(".global " UNDERSCORE "ucontext_do_switch\n"
+        UNDERSCORE "ucontext_do_switch:\n\t"
         "pushq %rbp\n\t"
----------------
Can we use something like the `ASM_SYMBOL` macro from `sanitizer_asm.h` and put it into `test.h` please?


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58110/new/

https://reviews.llvm.org/D58110





More information about the llvm-commits mailing list