Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-15268

Investigate changes in SERVER-56782: Reintroduce advanced microarchitecture targeting on macOS

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Server

      Original Downstream Change Summary

      We were unable to make this change before we had a native Apple Silicon build because Rosetta 2 could not handle the AVX instructions generated when targeting sandybridge or newer.

      After this change, server binaries on macOS will require a haswell or newer CPU. Note that this is a more aggressive posture than the sandybridge requirement we already have on non-macOS (though not by much), so we will need to document it. The rationale for jumping to haswell is that Apple offers a known architecture "slice" type for this platform, and targeting it will hopefully provide a better user experience if an attempt is made to run the software on a platform which does not meet the hardware requirements.

      $ clang++ ./hello_world.cpp -arch x86_64h
      
      $ arch -x86_64h ./a.out
      Hello, World!
      
      $ arch -x86_64 ./a.out
      arch: posix_spawnp: ./a.out: Bad CPU type in executable
      

      That's better than just getting a SIGILL kill.

      All apple systems introduced after 2013 are haswell or newer: https://en.wikipedia.org/wiki/List_of_Macintosh_models_grouped_by_CPU_type#Ivy_Bridge

      Description of Linked Ticket

      In SERVER-54407 we bumped the required x86_64 microarchitecture to sandybridge but we backed out of that on macOS in SERVER-56728 because Rosetta 2 doesn't support AVX instructions, among others. Once we have native Apple Silicon builds and no longer need to rely on Rosetta 2, we can reintroduce targeting. We may in fact be able to target more aggressively, and bump to -arch x86_64h, per the comments and links in SERVER-56728.

            Assignee:
            Unassigned Unassigned
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              1 week, 3 days ago