This is an archive of the discontinued LLVM Phabricator instance.

One more change required to build the sanitizers for iOS.
ClosedPublic

Authored by beanz on Jun 24 2015, 10:03 AM.

Details

Summary

_Unwind_Backtrace is not available on iOS, so we should ifdef out the posix implementations of BufferedStackTrace::SlowUnwindStack and BufferedStackTrace::SlowUnwindStackWithContext on iOS.

Diff Detail

Repository
rL LLVM

Event Timeline

beanz updated this revision to Diff 28361.Jun 24 2015, 10:03 AM
beanz retitled this revision from to One more change required to build the sanitizers for iOS..
beanz updated this object.
beanz edited the test plan for this revision. (Show Details)
beanz added a reviewer: samsonov.
beanz added a subscriber: Unknown Object (MLST).
samsonov edited edge metadata.Jun 24 2015, 11:16 AM

All this looks weird to me.

  1. Slow unwind is not available on Mac at all (see SANITIZER_CAN_SLOW_UNWIND macro).
  2. You #ifdef out BufferedStackTrace methods which are referenced from other files (sanitizer_stacktrace_libcdep.cc)
  3. You don't #ifdef out another _Unwind-related helper methods like Unwind_Trace, Unwind_GetIP, which are only used in functions you #ifdef out.

Looks like this whole *file* makes no sense on Mac, as we're not using slow unwinder there. I'd suggest we just rename it to smth. like sanitizer_unwind_linux_libcdep.cc, and use it on Linux/Android/FreeBSD only.

beanz updated this revision to Diff 28374.Jun 24 2015, 11:24 AM
beanz edited edge metadata.

Updating based on feedback from samsonov.

Renaming file from posix->linux and changing the #ifdef guard.

samsonov accepted this revision.Jun 24 2015, 11:32 AM
samsonov edited edge metadata.

LGTM. Please make sure that it doesn't break the build on OS X, not only fixes iOS.

lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
1 ↗(On Diff #28374)

Update file name.

11 ↗(On Diff #28374)

Update comment here.

158 ↗(On Diff #28374)

Update comment here.

This revision is now accepted and ready to land.Jun 24 2015, 11:32 AM
This revision was automatically updated to reflect the committed changes.
compiler-rt/trunk/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc