This is an archive of the discontinued LLVM Phabricator instance.

[asan] Fix debug asan build link error
ClosedPublic

Authored by rnk on May 13 2019, 1:34 PM.

Diff Detail

Event Timeline

rnk created this revision.May 13 2019, 1:34 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 13 2019, 1:34 PM
Herald added subscribers: Restricted Project, kubamracek. · View Herald Transcript
vitalybuka accepted this revision.May 15 2019, 12:28 PM
vitalybuka added inline comments.
compiler-rt/lib/asan/asan_malloc_local.h
28 ↗(On Diff #199321)

can we make it always inline function?

This revision is now accepted and ready to land.May 15 2019, 12:28 PM
rnk marked an inline comment as done.May 15 2019, 1:47 PM
rnk added inline comments.
compiler-rt/lib/asan/asan_malloc_local.h
28 ↗(On Diff #199321)

We'd still need a macro with control flow because it returns early if the local pool is used.

waltl added a comment.May 15 2019, 1:47 PM

I have problems getting this to compile. Let me work on it and either suggest in-line changes or make a new revision.

waltl added a comment.May 15 2019, 2:14 PM

Here are the changes I needed to make to get this to compile for linux and Myriad.

compiler-rt/lib/asan/asan_malloc_local.h
25 ↗(On Diff #199321)

We still need to keep this function -- it's used in asan_malloc_linux.cc.

28 ↗(On Diff #199321)

#define MAYBE_ALLOCATE_FROM_LOCAL_POOL(nothrow) \

36 ↗(On Diff #199321)

} while (0)

42 ↗(On Diff #199321)

#define MAYBE_ALLOCATE_FROM_LOCAL_POOL(nothrow)

compiler-rt/lib/asan/asan_new_delete.cc
75 ↗(On Diff #199321)

MAYBE_ALLOCATE_FROM_LOCAL_POOL(nothrow); \

82 ↗(On Diff #199321)

MAYBE_ALLOCATE_FROM_LOCAL_POOL(nothrow); \

rnk updated this revision to Diff 199698.May 15 2019, 4:28 PM
rnk marked 5 inline comments as done.
  • various fixes to RTEMS / Myriad codepath
rnk added a comment.May 15 2019, 4:28 PM

Sorry for the broken patch, I forgot to be extra careful on the codepaths I can't test, clearly. Does this work?

waltl added a comment.May 15 2019, 5:08 PM

There is still a problem building for Linux. See comment below.

compiler-rt/lib/asan/asan_malloc_local.h
24 ↗(On Diff #199698)

The code in asan_malloc_linux.cc that calls this function is used for many platforms, not just RTEMS, so we still need this function in the original form. Alternatively, we can fix asan_malloc_linux.cc so that only RTEMS call this function. Either solution is fine with me.

rnk updated this revision to Diff 200607.May 21 2019, 4:44 PM
  • test on Linux
rnk marked an inline comment as done.May 21 2019, 4:44 PM
rnk added inline comments.
compiler-rt/lib/asan/asan_malloc_local.h
24 ↗(On Diff #199698)

I brought this back and tested asan on Linux.

waltl accepted this revision.May 21 2019, 5:09 PM
This revision was automatically updated to reflect the committed changes.