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:16 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.

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 27863.Jun 17 2015, 1:16 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/sanitizer_common/sanitizer_platform.h
48 ↗(On Diff #27863)

You also need to define SANITIZER_IOSSIM to 0 here.

lib/sanitizer_common/sanitizer_platform_limits_posix.cc
55 ↗(On Diff #27863)

Any specific reason to move #include directives down here?

344 ↗(On Diff #27863)

Where do you get this constant from on iOS?

beanz added inline comments.Jun 23 2015, 11:11 AM
lib/sanitizer_common/sanitizer_platform_limits_posix.cc
55 ↗(On Diff #27863)

It was moved down for consistency with how Android and Linux handled special include handling.

344 ↗(On Diff #27863)

These patches are about making it build, not function. Anna will be working on patches to make it function, but that is outside of what I'm able to handle here.

beanz updated this revision to Diff 28267.Jun 23 2015, 11:12 AM

Updating based on feedback from samsonov.

samsonov added inline comments.Jun 23 2015, 11:15 AM
lib/sanitizer_common/sanitizer_platform_limits_posix.cc
55 ↗(On Diff #27863)

Fine. Hope it won't break non-iOS platforms because of include order.

344 ↗(On Diff #27863)

The changes still need to be reasonable. Please either provide the correct value for struct_arpreq_sz on iOS, or remove its declaration from header on iOS.

beanz added inline comments.Jun 23 2015, 11:43 AM
lib/sanitizer_common/sanitizer_platform_limits_posix.cc
344 ↗(On Diff #27863)

The value is only ever used on Linux, is there a reason not to move it into the #if SANITIZER_LINUX block in the header and source?

beanz updated this revision to Diff 28277.Jun 23 2015, 1:06 PM

Updating based on feedback from samsonov.

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

LGTM

lib/sanitizer_common/sanitizer_platform.h
41 ↗(On Diff #28277)

Can this be #defined together with TARGET_OS_IPHONE?

This revision is now accepted and ready to land.Jun 23 2015, 1:20 PM
beanz added inline comments.Jun 23 2015, 1:23 PM
lib/sanitizer_common/sanitizer_platform.h
41 ↗(On Diff #28277)

Yes. TARGET_OS_IPHONE is always 1 when TARGET_IPHONE_SIMULATOR is 1.

The iOS simulator platform conditionals are designed to be additive on top of the OS.

This revision was automatically updated to reflect the committed changes.