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

Function get_target

deps/libffi/generate-headers.py:23–64  ·  view source on GitHub ↗
(os_name, target_arch)

Source from the content-addressed store, hash-verified

21
22
23def get_target(os_name, target_arch):
24 target_arch = normalize_arch(target_arch)
25
26 if target_arch == 'arm':
27 return ('ARM_WIN32' if os_name == 'win' else 'ARM', 'arm')
28
29 if target_arch == 'arm64':
30 return ('ARM_WIN64' if os_name == 'win' else 'AARCH64', 'aarch64')
31
32 if target_arch == 'ia32':
33 if os_name in ('freebsd', 'openbsd'):
34 return ('X86_FREEBSD', 'x86')
35 if os_name in ('ios', 'mac'):
36 return ('X86_DARWIN', 'x86')
37 if os_name == 'win':
38 return ('X86_WIN32', 'x86')
39 return ('X86', 'x86')
40
41 if target_arch == 'x64':
42 return ('X86_WIN64' if os_name == 'win' else 'X86_64', 'x86')
43
44 if target_arch == 'riscv64':
45 return ('RISCV', 'riscv')
46
47 if target_arch == 'loong64':
48 return ('LOONGARCH64', 'loongarch')
49
50 if target_arch in ('mips', 'mipsel', 'mips64el'):
51 if os_name in ('freebsd', 'linux', 'openbsd'):
52 return ('MIPS', 'mips')
53
54 if target_arch == 'ppc64':
55 if os_name == 'aix':
56 return ('POWERPC_AIX', 'powerpc')
57 if os_name == 'mac':
58 return ('POWERPC_DARWIN', 'powerpc')
59 if os_name in ('freebsd', 'openbsd'):
60 return ('POWERPC_FREEBSD', 'powerpc')
61 if os_name == 'linux':
62 return ('POWERPC', 'powerpc')
63
64 raise ValueError(f'Unsupported libffi target {os_name}/{target_arch}.')
65
66
67def has_long_double(os_name, target_arch):

Callers 1

generate_headersFunction · 0.85

Calls 1

normalize_archFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…