[asan] Intercept __makecontext_v2 on Solaris/SPARC (#81588)
As detailed in [GCC PR sanitizer/113785](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113785), the GCC test `c-c++-common/asan/swapcontext-test-1.c` `FAIL`s on Solaris/sparc. This is due to the fact that Solaris 10/SPARC changed the semantics of `makecontext` so `ucontext_t.uc_stack.ss_sp` refers to the stack base address. To maintain binary compatiblity, the external name was changed to `__makecontext_v2`, keeping the old version. To match this, `__makecontext_v2` needs to be intercepted instead of `makecontext`. Tested on GCC trunk on `sparc-sun-solaris2.11`, `i386-pc-solaris2.11`, and `x86_64-pc-linux-gnu`. Also tested on the same targets on LLVM `main`. However, this only proves that Linux/x86_64 isn't broken, since all `makecontext` tests are Linux-specific.
parent
3b6e2504
Please register or sign in to comment