When _FORTIFY_SOURCE is defined, the glibc headers define realpath which
clashes with the definition in compiler-rt. In order to fix this for
realpath and also to protect us from future failues, when _FORTIFY_SOURCE
is defined, define our interceptor function with the __interceptor_ prefix.
Details
- Reviewers
serge-sans-paille vitalybuka
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The build failure is when building compiler-rt itself, and not in the application trying to use compiler-rt. Should I just create a test mini-sanitizer with one interceptor to demonstrate the problem?
I was able to reproduce.
We don't want interceptors depend on set of include files like with DECLARED_FUNC
I guess simple solution is to remove #include <stdlib.h> from dd_interceptors.cpp and
extern "C" void *malloc(size_t size);
extern "C" void free(void *ptr);
or move code which needs stdlib into a separate cpp file
clang-format not found in user's PATH; not linting file.