OLD | NEW |
1 #!/usr/bin/env python2 | 1 #!/usr/bin/env python2 |
2 | 2 |
3 from collections import namedtuple | 3 from collections import namedtuple |
4 import glob | 4 import glob |
5 | 5 |
6 | 6 |
7 # Why have 'cross_headers': | 7 # Why have 'cross_headers': |
8 # For some reason, clang doesn't know how to find some of the libstdc++ | 8 # For some reason, clang doesn't know how to find some of the libstdc++ |
9 # headers (c++config.h). Manually add in one of the paths: | 9 # headers (c++config.h). Manually add in one of the paths: |
10 # https://llvm.org/bugs/show_bug.cgi?id=22937 | 10 # https://llvm.org/bugs/show_bug.cgi?id=22937 |
11 # Otherwise, we could assume the system has arm-linux-gnueabihf-g++ and | 11 # Otherwise, we could assume the system has arm-linux-gnueabihf-g++ and |
12 # use that instead of clang, but so far we've just been using clang for | 12 # use that instead of clang, but so far we've just been using clang for |
13 # the unsandboxed build. | 13 # the unsandboxed build. |
14 def FindARMCrossInclude(): | 14 def FindARMCrossInclude(): |
15 return glob.glob( | 15 return glob.glob( |
16 '/usr/arm-linux-gnueabihf/include/c++/*/arm-linux-gnueabihf')[-1] | 16 '/usr/arm-linux-gnueabihf/include/c++/*/arm-linux-gnueabihf')[-1] |
17 | 17 |
| 18 def FindMIPSCrossInclude(): |
| 19 return glob.glob( |
| 20 '/usr/include/')[-1] |
18 | 21 |
19 TargetInfo = namedtuple('TargetInfo', | 22 TargetInfo = namedtuple('TargetInfo', |
20 ['target', 'compiler_arch', 'triple', 'llc_flags', | 23 ['target', 'compiler_arch', 'triple', 'llc_flags', |
21 'ld_emu', 'sb_emu', 'cross_headers']) | 24 'ld_emu', 'sb_emu', 'cross_headers']) |
22 | 25 |
23 X8632Target = TargetInfo(target='x8632', | 26 X8632Target = TargetInfo(target='x8632', |
24 compiler_arch='x8632', | 27 compiler_arch='x8632', |
25 triple='i686-none-linux', | 28 triple='i686-none-linux', |
26 llc_flags=['-mcpu=pentium4m'], | 29 llc_flags=['-mcpu=pentium4m'], |
27 ld_emu='elf_i386_nacl', | 30 ld_emu='elf_i386_nacl', |
(...skipping 11 matching lines...) Expand all Loading... |
39 ARM32Target = TargetInfo(target='arm32', | 42 ARM32Target = TargetInfo(target='arm32', |
40 compiler_arch='armv7', | 43 compiler_arch='armv7', |
41 triple='armv7a-none-linux-gnueabihf', | 44 triple='armv7a-none-linux-gnueabihf', |
42 llc_flags=['-mcpu=cortex-a9', | 45 llc_flags=['-mcpu=cortex-a9', |
43 '-float-abi=hard', | 46 '-float-abi=hard', |
44 '-mattr=+neon'], | 47 '-mattr=+neon'], |
45 ld_emu='armelf_nacl', | 48 ld_emu='armelf_nacl', |
46 sb_emu='armelf_nacl', | 49 sb_emu='armelf_nacl', |
47 cross_headers=['-isystem', FindARMCrossInclude()]) | 50 cross_headers=['-isystem', FindARMCrossInclude()]) |
48 | 51 |
| 52 MIPS32Target = TargetInfo(target='mips32', |
| 53 compiler_arch='mips32', |
| 54 triple='mips-linux-gnu', |
| 55 llc_flags=[], |
| 56 ld_emu='mips_nacl', |
| 57 sb_emu='mips_nacl', |
| 58 cross_headers=['-isystem', FindMIPSCrossInclude()]) |
| 59 |
49 def ConvertTripleToNaCl(nonsfi_triple): | 60 def ConvertTripleToNaCl(nonsfi_triple): |
50 return nonsfi_triple[:nonsfi_triple.find('-linux')] + '-nacl' | 61 return nonsfi_triple[:nonsfi_triple.find('-linux')] + '-nacl' |
OLD | NEW |