Some Android builds that we are interested in define __BIONIC__
but not __ANDROID__, so expand SCUDO_ANDROID to encompass those.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 42844 Build 43426: arc lint + arc unit
Event Timeline
compiler-rt/lib/scudo/standalone/platform.h | ||
---|---|---|
21–22 | Maybe just #if defined(__BIONIC__)? |
compiler-rt/lib/scudo/standalone/platform.h | ||
---|---|---|
21–22 | We still want Scudo to work on Android outside of Bionic (eg: .so or just statically linked to a binary) in which case I don't think BIONIC will be defined. |
compiler-rt/lib/scudo/standalone/platform.h | ||
---|---|---|
21–22 | It's also the case that BIONIC is only defined when you include cdefs.h directly or indirectly. Unfortunately, at this point it's not defined so this doesn't quite solve the problem. |
compiler-rt/lib/scudo/standalone/platform.h | ||
---|---|---|
21–22 | I don't think that __BIONIC__ means that we're compiling as part of Bionic, it just means that the libc is Bionic. See: To confuse matters, we also have _BIONIC, which, at least within scudo, does mean that we're compiling as part of Bionic. It may be a good idea to rename this macro to something more clear. |
compiler-rt/lib/scudo/standalone/platform.h | ||
---|---|---|
21–22 | Right now there is no #include in platform.h which I feel is what it should be. |
compiler-rt/lib/scudo/standalone/platform.h | ||
---|---|---|
21–22 | (also the initial patch won't work) |
compiler-rt/lib/scudo/standalone/platform.h | ||
---|---|---|
21–22 | I'm not sure that you can include cdefs.h because it isn't universally available, e.g. the Windows and Fuchsia SDKs don't appear to have it. One option would be to include a standardized header such as stdint.h which does include cdefs.h on Android. |
New proposal as per Peter's suggestion: include stdint.h in
platform.h and check for __BIONIC__.
I verified this fixes the case of building bionic on linux, and it also builds properly in the normal android build.
compiler-rt/lib/scudo/standalone/platform.h | ||
---|---|---|
12 | Transitive. |
Transitive.