This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Have tests default to targeting macos 10.15
ClosedPublic

Authored by int3 on Apr 22 2021, 5:30 PM.

Details

Reviewers
oontvoo
Group Reviewers
Restricted Project
Commits
rGfd28f71872f7: [lld-macho] Have tests default to targeting macos 10.15
Summary

D101114 enforced proper version checks, which exposed a variety of version
mismatch issues in our tests. We previously changed the test inputs to
target 10.0, which was the simpler thing to do, but we should really
just have our lit.local.cfg default to targeting 10.15, which is what is done
here. We're not likely to ever have proper support for the older versions
anyway, as that would require more work for unclear benefit; for instance,
llvm-mc seems to generate a different compact unwind format for older macOS
versions, which would cause our compact-unwind.s test to fail.

Targeting 10.15 by default causes the following behavioral changes:

  • __mh_execute_header is now a section symbol instead of an absolute symbol
  • LC_BUILD_VERSION gets emitted instead of LC_VERSION_MIN_MACOSX. The former is 32 bytes in size whereas the latter is 16 bytes, so a bunch of hardcoded address offsets in our tests had to be updated.
  • >= 10.6 executables are PIE by default

Note that this diff is stacked atop of a local revert of most of the test
changes in rG8c17a875150f8e736e8f9061ddf084397f45f4c5, to make review easier.

Diff Detail

Event Timeline

int3 created this revision.Apr 22 2021, 5:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2021, 5:30 PM
int3 requested review of this revision.Apr 22 2021, 5:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 22 2021, 5:30 PM
int3 retitled this revision from [lld-macho] Have tests default to targeting 10.15 to [lld-macho] Have tests default to targeting macos 10.15.Apr 22 2021, 5:36 PM
oontvoo accepted this revision.Apr 22 2021, 6:02 PM
oontvoo added a subscriber: oontvoo.

Thanks!

This revision is now accepted and ready to land.Apr 22 2021, 6:02 PM
thakis added a subscriber: thakis.Apr 22 2021, 7:55 PM

Targeting 10.15 instead of 10.0 makes a lot of sense.

I do hope "We're not likely to ever have proper support for the older versions anyway" doesn't mean versions older than 10.15 though. Chromium currently supports 10.11+, and I'd love to try and ship a canary channel linked with lld at some point…

int3 added a comment.Apr 22 2021, 9:34 PM

Oh yeah for sure we should support older versions where there are use cases :)

This revision was landed with ongoing or failed builds.Apr 23 2021, 6:25 AM
This revision was automatically updated to reflect the committed changes.