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 | 18 |
19 TargetInfo = namedtuple('TargetInfo', | 19 TargetInfo = namedtuple('TargetInfo', |
20 ['target', 'compiler_arch', 'triple', 'llc_flags', | 20 ['target', 'compiler_arch', 'triple', 'llc_flags', |
21 'ld_emu', 'cross_headers']) | 21 'ld_emu', 'sb_emu', 'cross_headers']) |
22 | 22 |
23 X8632Target = TargetInfo(target='x8632', | 23 X8632Target = TargetInfo(target='x8632', |
24 compiler_arch='x8632', | 24 compiler_arch='x8632', |
25 triple='i686-none-linux', | 25 triple='i686-none-linux', |
26 llc_flags=['-mcpu=pentium4m'], | 26 llc_flags=['-mcpu=pentium4m'], |
27 ld_emu='elf_i386_nacl', | 27 ld_emu='elf_i386_nacl', |
| 28 sb_emu='elf_i386_nacl', |
28 cross_headers=[]) | 29 cross_headers=[]) |
29 | 30 |
30 X8664Target = TargetInfo(target='x8664', | 31 X8664Target = TargetInfo(target='x8664', |
31 compiler_arch='x8664', | 32 compiler_arch='x8664', |
32 triple='x86_64-none-linux-gnux32', | 33 triple='x86_64-none-linux-gnux32', |
33 llc_flags=['-mcpu=x86-64'], | 34 llc_flags=['-mcpu=x86-64'], |
34 ld_emu='elf32_x86_64_nacl', | 35 ld_emu='elf32_x86_64_nacl', |
| 36 sb_emu='elf_x86_64_nacl', |
35 cross_headers=[]) | 37 cross_headers=[]) |
36 | 38 |
37 ARM32Target = TargetInfo(target='arm32', | 39 ARM32Target = TargetInfo(target='arm32', |
38 compiler_arch='armv7', | 40 compiler_arch='armv7', |
39 triple='armv7a-none-linux-gnueabihf', | 41 triple='armv7a-none-linux-gnueabihf', |
40 llc_flags=['-mcpu=cortex-a9', | 42 llc_flags=['-mcpu=cortex-a9', |
41 '-float-abi=hard', | 43 '-float-abi=hard', |
42 '-mattr=+neon'], | 44 '-mattr=+neon'], |
43 ld_emu='armelf_nacl', | 45 ld_emu='armelf_nacl', |
| 46 sb_emu='armelf_nacl', |
44 cross_headers=['-isystem', FindARMCrossInclude()]) | 47 cross_headers=['-isystem', FindARMCrossInclude()]) |
45 | 48 |
46 def ConvertTripleToNaCl(nonsfi_triple): | 49 def ConvertTripleToNaCl(nonsfi_triple): |
47 return nonsfi_triple[:nonsfi_triple.find('-linux')] + '-nacl' | 50 return nonsfi_triple[:nonsfi_triple.find('-linux')] + '-nacl' |
OLD | NEW |