Unverified Commit 8c203371 authored by Rainer Orth's avatar Rainer Orth Committed by GitHub
Browse files

[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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment