def GetHostCPU():
    # Derived from //native_client/pynacl/platform.py
    machine = platform.machine()
    if machine in ('x86', 'x86-32', 'x86_32', 'x8632', 'i386', 'i686', 'ia32',
                   '32'):
      return Config.ARCH_X86
    if machine in ('x86-64', 'amd64', 'AMD64', 'x86_64', 'x8664', '64'):
      return Config.ARCH_X64
    if machine.startswith('arm'):
      return Config.ARCH_ARM
    raise Exception('Cannot identify CPU arch: %s' % machine)