Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sanitizers] Avoid overload ambiguity for interceptors (llvm#100986)
Since glibc 2.40 some functions like openat make use of overloads when built with `-D_FORTIFY_SOURCE=2`, see: https://github.com/bminor/glibc/blob/master/io/bits/fcntl2.h This means that doing something like `(uintptr_t) openat` or `(void *) openat` is now ambiguous, breaking the compiler-rt build on new glibc versions. Fix this by explicitly casting the symbol to the expected function type before casting it to an intptr. The expected type is obtained as `decltype(REAL(func))` so we don't have to repeat the signature from INTERCEPTOR in the INTERCEPT_FUNTION macro. Fixes llvm#100754.
- Loading branch information