Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import driver_tools | 6 import driver_tools |
| 7 import filetype | 7 import filetype |
| 8 import ldtools | 8 import ldtools |
| 9 import multiprocessing | 9 import multiprocessing |
| 10 import os | 10 import os |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 'nacl': | 233 'nacl': |
| 234 {'X8632': 'i686-linux-gnu', | 234 {'X8632': 'i686-linux-gnu', |
| 235 'ARM': 'armv7a-linux-gnueabihf'}} | 235 'ARM': 'armv7a-linux-gnueabihf'}} |
| 236 else: | 236 else: |
| 237 triple_map = { | 237 triple_map = { |
| 238 'nacl': | 238 'nacl': |
| 239 {'X8632': 'i686-none-nacl-gnu', | 239 {'X8632': 'i686-none-nacl-gnu', |
| 240 'X8664': 'x86_64-none-nacl-gnu', | 240 'X8664': 'x86_64-none-nacl-gnu', |
| 241 'ARM': 'armv7a-none-nacl-gnueabihf', | 241 'ARM': 'armv7a-none-nacl-gnueabihf', |
| 242 'MIPS32': 'mipsel-none-nacl-gnu'}, | 242 'MIPS32': 'mipsel-none-nacl-gnu'}, |
| 243 'linux': {'X8632': 'i686-linux-gnu'}, | 243 'linux': |
| 244 {'X8632': 'i686-linux-gnu', | |
| 245 'X8664': 'x86_64-linux-gnux32'}, | |
| 244 'mac': {'X8632': 'i686-apple-darwin'}} | 246 'mac': {'X8632': 'i686-apple-darwin'}} |
| 245 env.set('TRIPLE', triple_map[env.getone('TARGET_OS')][base_arch]) | 247 env.set('TRIPLE', triple_map[env.getone('TARGET_OS')][base_arch]) |
| 246 | 248 |
| 247 # CPU that is representative of baseline feature requirements for NaCl | 249 # CPU that is representative of baseline feature requirements for NaCl |
| 248 # and/or chrome. We may want to make this more like "-mtune" | 250 # and/or chrome. We may want to make this more like "-mtune" |
| 249 # by specifying both "-mcpu=X" and "-mattr=+feat1,-feat2,...". | 251 # by specifying both "-mcpu=X" and "-mattr=+feat1,-feat2,...". |
| 250 # Note: this may be different from the in-browser translator, which may | 252 # Note: this may be different from the in-browser translator, which may |
| 251 # do auto feature detection based on CPUID, but constrained by what is | 253 # do auto feature detection based on CPUID, but constrained by what is |
| 252 # accepted by NaCl validators. | 254 # accepted by NaCl validators. |
| 253 cpu_map = { | 255 cpu_map = { |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 274 # When linking against a host OS's libc (such as Linux glibc), don't | 276 # When linking against a host OS's libc (such as Linux glibc), don't |
| 275 # use %gs:0 to read the thread pointer because that won't be | 277 # use %gs:0 to read the thread pointer because that won't be |
| 276 # compatible with the libc's use of %gs:0. Similarly, Non-SFI Mode | 278 # compatible with the libc's use of %gs:0. Similarly, Non-SFI Mode |
| 277 # currently offers no optimized path for reading the thread pointer. | 279 # currently offers no optimized path for reading the thread pointer. |
| 278 if env.getone('TARGET_OS') != 'nacl' or env.getbool('NONSFI_NACL'): | 280 if env.getone('TARGET_OS') != 'nacl' or env.getbool('NONSFI_NACL'): |
| 279 env.append('LLC_FLAGS_ARCH', '-mtls-use-call') | 281 env.append('LLC_FLAGS_ARCH', '-mtls-use-call') |
| 280 # For Subzero, determine -target and -sandbox options. | 282 # For Subzero, determine -target and -sandbox options. |
| 281 env.append('SZ_FLAGS_ARCH', '--sandbox=' + | 283 env.append('SZ_FLAGS_ARCH', '--sandbox=' + |
| 282 ('1' if env.getone('TARGET_OS') == 'nacl' else '0')) | 284 ('1' if env.getone('TARGET_OS') == 'nacl' else '0')) |
| 283 env.append('SZ_FLAGS_ARCH', '--target=' + base_arch.lower()) | 285 env.append('SZ_FLAGS_ARCH', '--target=' + base_arch.lower()) |
| 284 if base_arch != 'X8632': | 286 if base_arch not in ['ARM32', 'X8632', 'X8664']: |
|
Jim Stichnoth
2015/12/22 17:36:27
This needs more precision about which configuratio
John
2015/12/22 18:12:00
I was thinking about that. Reverting for now, unti
| |
| 285 env.set('SZ_UNSUPPORTED', '1') | 287 env.set('SZ_UNSUPPORTED', '1') |
| 286 # Hard-fail on an unsupported architecture. | 288 # Hard-fail on an unsupported architecture. |
| 287 if env.getbool('USE_SZ'): | 289 if env.getbool('USE_SZ'): |
| 288 Log.Fatal('Unsupported architecture when using --sz: ' + base_arch) | 290 Log.Fatal('Unsupported architecture when using --sz: ' + base_arch) |
| 289 # This is a fine place to map OPT_LEVEL to the Subzero equivalent, with | 291 # This is a fine place to map OPT_LEVEL to the Subzero equivalent, with |
| 290 # default of -O2. | 292 # default of -O2. |
| 291 sz_opt_map = { | 293 sz_opt_map = { |
| 292 '0': '-Om1', | 294 '0': '-Om1', |
| 293 '1': '-O2', | 295 '1': '-O2', |
| 294 '2': '-O2', | 296 '2': '-O2', |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 593 -S Generate native assembly only. | 595 -S Generate native assembly only. |
| 594 -c Generate native object file only. | 596 -c Generate native object file only. |
| 595 --use-sz Use the Subzero fast translator. | 597 --use-sz Use the Subzero fast translator. |
| 596 --pnacl-sb Use the translator which runs inside the NaCl sandbox. | 598 --pnacl-sb Use the translator which runs inside the NaCl sandbox. |
| 597 Applies to both pnacl-llc and pnacl-sz translators. | 599 Applies to both pnacl-llc and pnacl-sz translators. |
| 598 -O[0-3] Change translation-time optimization level. | 600 -O[0-3] Change translation-time optimization level. |
| 599 -threads=<num> Use <num> parallel threads for translation. | 601 -threads=<num> Use <num> parallel threads for translation. |
| 600 -threads=auto Automatically determine number of translation threads. | 602 -threads=auto Automatically determine number of translation threads. |
| 601 -threads=seq Use the minimal number of threads for translation. | 603 -threads=seq Use the minimal number of threads for translation. |
| 602 """ | 604 """ |
| OLD | NEW |