This is an archive of the discontinued LLVM Phabricator instance.

Working on reconciling out-of-tree patches to compiler-rt for building for iOS.
ClosedPublic

Authored by beanz on Jun 17 2015, 1:18 PM.

Details

Summary

This is one of many changes needed for compiler-rt to get it building on iOS.

This change ifdefs out headers and functionality that aren't available on iOS, and adds support for iOS and the iOS simulator to as an.

Note: this change does not enable building for iOS, as there are more changes to come.

Diff Detail

Repository
rL LLVM

Event Timeline

beanz updated this revision to Diff 27864.Jun 17 2015, 1:18 PM
beanz retitled this revision from to Working on reconciling out-of-tree patches to compiler-rt for building for iOS..
beanz updated this object.
beanz edited the test plan for this revision. (Show Details)
beanz added a subscriber: Unknown Object (MLST).

Looping in Alexander Potapenko because git blame :-).

Adding Kuba and Justin for review.

samsonov added a subscriber: samsonov.
samsonov added inline comments.
lib/asan/asan_mac.cc
27 ↗(On Diff #27864)

SANITIZER_IOS

73 ↗(On Diff #27864)

Looks like this logic is copied from http://reviews.llvm.org/D10510. Consider introducing a function instead.

lib/asan/asan_mapping.h
101 ↗(On Diff #27864)

Please group iossim constants together,

120 ↗(On Diff #27864)

indentation looks inconsistent.

beanz updated this revision to Diff 28269.Jun 23 2015, 11:17 AM

Updating based on feedback from samsonov.

samsonov added inline comments.Jun 23 2015, 11:35 AM
lib/asan/asan_mac.cc
28 ↗(On Diff #28269)

How did this #include for SANITIZER_IOSSIM before this change?

lib/asan/asan_mapping.h
106 ↗(On Diff #28269)

keep defaults together as well.

118 ↗(On Diff #28269)

I think you should keep the original code layout and add ios/iossim cases to large #if SANITIZER_WORDSIZE == 32 block, and add ios/iossim cases to large else (SANITIZER_WORDSIZE == 64) block.

beanz added inline comments.Jun 23 2015, 11:53 AM
lib/asan/asan_mac.cc
28 ↗(On Diff #28269)

crt_externs.h exists in the iOS Simulator SDK, but not in the device SDK... Don't ask. I have no answers.

beanz updated this revision to Diff 28275.Jun 23 2015, 11:55 AM

Updating based on feedback from samsonov.

samsonov accepted this revision.Jun 23 2015, 1:17 PM
samsonov edited edge metadata.

LGTM (provided SANITIZER_IOS and SANITIZER_IOSSIM would be made mutually exclusive).

lib/asan/asan_mac.cc
28 ↗(On Diff #28269)

That's fine, but doesn't this mean we should keep #including <crt_externs.h> on iossim?
I'd actually vote for making SANITIZER_IOS and SANITIZER_IOSSIM exclusive. In this case we won't have to care about correct order of #elif clauses in asan_mapping.h

This revision is now accepted and ready to land.Jun 23 2015, 1:17 PM
beanz added inline comments.Jun 23 2015, 1:28 PM
lib/asan/asan_mac.cc
28 ↗(On Diff #28269)

Six one way half a dozen the other.

It will work either way. My general preference is to have the Simulator code follow the iOS code paths everywhere except where it is absolutely necessary to deviate, but I could go either way on this.

I don't think you should make SANITIZER_IOS and SANITIZER_IOSSIM exclusive. The general Darwin model is that the iOS simulator is iOS.

I could easily change the check here to #if (!SANITIZER_IOS) || SANITIZER_IOSSIM.

samsonov added inline comments.Jun 23 2015, 1:35 PM
lib/asan/asan_mac.cc
28 ↗(On Diff #28269)

OK, let's follow the Darwin model here and assume that iossim is ios.

This revision was automatically updated to reflect the committed changes.