Host architecture check using the CC command.
()
| 1688 | |
| 1689 | |
| 1690 | def 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 | |
| 1730 | def host_arch_win(): |
no test coverage detected
searching dependent graphs…