[all-commits] [llvm/llvm-project] 8c2033: [asan] Intercept __makecontext_v2 on Solaris/SPARC...

Rainer Orth via All-commits all-commits at lists.llvm.org
Fri Feb 16 02:42:25 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8c2033719a843a1880427a5e8caa5563248bce78
      https://github.com/llvm/llvm-project/commit/8c2033719a843a1880427a5e8caa5563248bce78
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2024-02-16 (Fri, 16 Feb 2024)

  Changed paths:
    M compiler-rt/lib/asan/asan_interceptors.cpp

  Log Message:
  -----------
  [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.




More information about the All-commits mailing list