[TSAN/BIONIC] How to limit changes to aarch64 ONLY??

16 views
Skip to first unread message

Jason Kim

unread,
Jul 18, 2015, 8:43:29 PM7/18/15
to android-...@googlegroups.com
Hi everyone,

I have a set of changes to bionic for supporting Thread Sanitizer for AArch64/Android.

Currently, the changes are mostly in two new header files that #define some replacements for some common bionic APIs (i.e. pthread_mutex_lock). But it turns out that I also needed to touch
gensyscalls.py to generate some additional weak aliases for syscalls as well.
While it is easy to ensure that the changes are limited to arm64 only within gensyscalls.py, the same thing can not be said for the two new .h files, because android build process sometimes uses the 32bit arm cross gcc/g++ to generate .o files, and in the available CPP defined macros do not have such a candidate.


So I would like to guard the new header files with something like

#ifdef __aarch64__
...
#endif

Of course, __aarch64__ is not going to work here, because that CPP macro is not always defined for all files.

Now, when I use "lunch", I select a target device (such as the nexus9), so the target device is an aarch64 device, but that info does not always seem to propagate to the actual build commands.
So I would like to #define a new symbol that is condiftionally defined ONLY for aarch64+android targets, so that I can limit the effect of my changes to ONLY on aarch64 devices.


What is the best way of going about this?

Thanks


Please refer to
https://code.google.com/p/android/issues/detail?id=179564
Reply all
Reply to author
Forward
0 new messages