[PATCH] D56594: [asan] Add fallback for Thumb after r350139
Diana Picus via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 14 01:47:53 PST 2019
rovka marked an inline comment as done.
rovka added a comment.
Thanks for the review, I'll commit with your suggestions in place.
================
Comment at: lib/asan/asan_rtl.cc:386
+#if !defined(__thumb__)
static bool UNUSED __local_asan_dyninit = [] {
----------------
krytarowski wrote:
> krytarowski wrote:
> > I would prefer to additionally specify Linux here, but for now it's good enough.
> Or maybe even better (feel free to pick a better symbol name):
>
> ```
> #if defined(__thumb__) && defined(__linux__)
> #define START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
> #endif
> ```
>
> ```
> #ifndef START_BACKGROUND_THREAD_IN_ASAN_INTERNAL
> static bool UNUSED __local_asan_dyninit = [] {
> MaybeStartBackgroudThread();
> SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback);
>
> return false;
> }();
> #endif
> ```
>
> ```
> static void AsanInitInternal() {
> [...]
> MaybeStartBackgroudThread();
> SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback);
> [...]
> }
> ```
>
> BTW. Does it work on thumb if we use here:
>
> ```
> __attribute__((constructor))
> void __local_asan_dyninit() {
> MaybeStartBackgroudThread();
> SetSoftRssLimitExceededCallback(AsanSoftRssLimitExceededCallback);
> }
> ```
>
The constructor attribute doesn't work (in fact it breaks even on arm, and in more tests than before).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56594/new/
https://reviews.llvm.org/D56594
More information about the llvm-commits
mailing list