This is an archive of the discontinued LLVM Phabricator instance.

[debugserver] Honor the cpu sub type if specified
ClosedPublic

Authored by JDevlieghere on Dec 4 2020, 6:44 PM.

Details

Summary

Use the newly added spawnattr API, posix_spawnattr_setarchpref_np, to select a slice preferences per cpu and subcpu types, instead of just cpu with posix_spawnattr_setarchpref_np. In the patch it only does this for x86_64 and x86_64h, but I would like to extend the parsing to more subtypes.

Tested by compiling a fat binary with different print statements depending on the architecture. I considered adding a test for it, but it doesn't seem worth the hassle to figure out the host architecture and the availability.

rdar://16094957

Diff Detail

Event Timeline

JDevlieghere created this revision.Dec 4 2020, 6:44 PM
JDevlieghere requested review of this revision.Dec 4 2020, 6:44 PM
JDevlieghere edited the summary of this revision. (Show Details)
  • Fix bug that would not fall back to posix_spawnattr_setarchpref_np when the availability check failed.
  • Add subtypes for arm64e and armv8
jasonmolenda accepted this revision.Dec 4 2020, 7:50 PM

Ah very cool, I didn't realize we had a new posix_spawn attr setter that could set the cpu subtype.

This revision is now accepted and ready to land.Dec 4 2020, 7:50 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2020, 8:38 PM