MCPcopy Index your code
hub / github.com/nodejs/node / host_arch_cc

Function host_arch_cc

configure.py:1690–1727  ·  view source on GitHub ↗

Host architecture check using the CC command.

()

Source from the content-addressed store, hash-verified

1688
1689
1690def host_arch_cc():
1691 """Host architecture check using the CC command."""
1692
1693 if sys.platform.startswith('zos'):
1694 return 's390x'
1695 k = cc_macros(os.environ.get('CC_host'))
1696
1697 matchup = {
1698 '__aarch64__' : 'arm64',
1699 '__arm__' : 'arm',
1700 '__i386__' : 'ia32',
1701 '__MIPSEL__' : 'mipsel',
1702 '__mips__' : 'mips',
1703 '__PPC64__' : 'ppc64',
1704 '__PPC__' : 'ppc64',
1705 '__x86_64__' : 'x64',
1706 '__s390x__' : 's390x',
1707 '__riscv' : 'riscv',
1708 '__loongarch64': 'loong64',
1709 }
1710
1711 rtn = 'ia32' # default
1712
1713 for key, value in matchup.items():
1714 if k.get(key, 0) and k[key] != '0':
1715 rtn = value
1716 break
1717
1718 if rtn == 'mipsel' and '_LP64' in k:
1719 rtn = 'mips64el'
1720
1721 if rtn == 'riscv':
1722 if k['__riscv_xlen'] == '64':
1723 rtn = 'riscv64'
1724 else:
1725 rtn = 'riscv32'
1726
1727 return rtn
1728
1729
1730def host_arch_win():

Callers 1

configure_nodeFunction · 0.85

Calls 3

cc_macrosFunction · 0.85
getMethod · 0.65
itemsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…