This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Honor the CPU type & subtype on macOS
ClosedPublic

Authored by JDevlieghere on Feb 2 2021, 9:20 PM.

Details

Summary

Honor the CPU type (and subtype) when launching the inferior on macOS. Part of this functionality was thought to be no longer needed and removed in 85bd4369610fe60397455c8e0914a09288285e84, however it's still needed, for example to launch binaries under Rosetta 2 on Apple Silicon. This patch will use posix_spawnattr_setarchpref_np if available and fallback to posix_spawnattr_setbinpref_np if not.

Diff Detail

Event Timeline

JDevlieghere requested review of this revision.Feb 2 2021, 9:20 PM
JDevlieghere created this revision.
This comment was removed by JDevlieghere.
jasonmolenda accepted this revision.Feb 2 2021, 11:12 PM

This looks good to me. Are the bots all running macOS Big Sur (macOS 11)? The -target command line arguments in the Makefile might not work if the test is run on an older version of macOS, I think.

This revision is now accepted and ready to land.Feb 2 2021, 11:12 PM
  • Improve the tests
  • Make sure we prefer CPU_SUBTYPE_ARM64_ALL over CPU_SUBTYPE_ARM64_V8
  • Fix test on Apple silicon by making sure we pick the right debugserver
jasonmolenda accepted this revision.Feb 3 2021, 1:09 PM

Yep, looks good.

Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2021, 1:42 PM