[PATCH] D56594: [asan] Add fallback for Thumb after r350139

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 14 01:50:37 PST 2019


krytarowski added inline comments.


================
Comment at: lib/asan/asan_rtl.cc:386
 
+#if !defined(__thumb__)
 static bool UNUSED __local_asan_dyninit = [] {
----------------
rovka wrote:
> 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). 
This means that something is really wrong. Feel free to land this patch or the proposed one with `START_BACKGROUND_THREAD_IN_ASAN_INTERNAL`.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56594/new/

https://reviews.llvm.org/D56594





More information about the llvm-commits mailing list