| 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 # IMPORTANT NOTE: If you make local mods to this file, you must run: |     6 # IMPORTANT NOTE: If you make local mods to this file, you must run: | 
|     7 #   %  pnacl/build.sh driver |     7 #   %  pnacl/build.sh driver | 
|     8 # in order for them to take effect in the scons build.  This command |     8 # in order for them to take effect in the scons build.  This command | 
|     9 # updates the copy in the toolchain/ tree. |     9 # updates the copy in the toolchain/ tree. | 
|    10 # |    10 # | 
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   426 @SimpleCache |   426 @SimpleCache | 
|   427 def IsNativeArchive(filename): |   427 def IsNativeArchive(filename): | 
|   428   return IsArchive(filename) and not IsBitcodeArchive(filename) |   428   return IsArchive(filename) and not IsBitcodeArchive(filename) | 
|   429  |   429  | 
|   430 class ELFHeader(object): |   430 class ELFHeader(object): | 
|   431   ELF_MAGIC = '\x7fELF' |   431   ELF_MAGIC = '\x7fELF' | 
|   432   ELF_TYPES = { 1: 'REL',  # .o |   432   ELF_TYPES = { 1: 'REL',  # .o | 
|   433                 2: 'EXEC', # .exe |   433                 2: 'EXEC', # .exe | 
|   434                 3: 'DYN' } # .so |   434                 3: 'DYN' } # .so | 
|   435   ELF_MACHINES = {  3: '386', |   435   ELF_MACHINES = {  3: '386', | 
 |   436                     8: 'MIPS', | 
|   436                    40: 'ARM', |   437                    40: 'ARM', | 
|   437                    62: 'X86_64' } |   438                    62: 'X86_64' } | 
|   438   ELF_OSABI = { 0: 'UNIX', |   439   ELF_OSABI = { 0: 'UNIX', | 
|   439                 3: 'LINUX', |   440                 3: 'LINUX', | 
|   440                 123: 'NACL' } |   441                 123: 'NACL' } | 
|   441   ELF_ABI_VER = { 0: 'NONE', |   442   ELF_ABI_VER = { 0: 'NONE', | 
|   442                   7: 'NACL' } |   443                   7: 'NACL' } | 
|   443  |   444  | 
|   444   def __init__(self, e_type, e_machine, e_osabi, e_abiver): |   445   def __init__(self, e_type, e_machine, e_osabi, e_abiver): | 
|   445     self.type = self.ELF_TYPES[e_type] |   446     self.type = self.ELF_TYPES[e_type] | 
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   931               '386'   : 'X8632', |   932               '386'   : 'X8632', | 
|   932               '686'   : 'X8632', |   933               '686'   : 'X8632', | 
|   933  |   934  | 
|   934               'amd64' : 'X8664', |   935               'amd64' : 'X8664', | 
|   935               'x86_64': 'X8664', |   936               'x86_64': 'X8664', | 
|   936               'x86-64': 'X8664', |   937               'x86-64': 'X8664', | 
|   937               'x8664' : 'X8664', |   938               'x8664' : 'X8664', | 
|   938  |   939  | 
|   939               'arm'   : 'ARM', |   940               'arm'   : 'ARM', | 
|   940               'armv7' : 'ARM', |   941               'armv7' : 'ARM', | 
|   941               'arm-thumb2' : 'ARM' } |   942               'arm-thumb2' : 'ARM', | 
 |   943  | 
 |   944               'mips32': 'MIPS32', | 
 |   945               'mips'  : 'MIPS32', | 
 |   946               } | 
|   942   if arch not in archfix: |   947   if arch not in archfix: | 
|   943     Log.Fatal('Unrecognized arch "%s"!', arch) |   948     Log.Fatal('Unrecognized arch "%s"!', arch) | 
|   944   return archfix[arch] |   949   return archfix[arch] | 
|   945  |   950  | 
|   946 def IsWindowsPython(): |   951 def IsWindowsPython(): | 
|   947   return 'windows' in platform.system().lower() |   952   return 'windows' in platform.system().lower() | 
|   948  |   953  | 
|   949 def SetupCygwinLibs(): |   954 def SetupCygwinLibs(): | 
|   950   bindir = env.getone('DRIVER_BIN') |   955   bindir = env.getone('DRIVER_BIN') | 
|   951   os.environ['PATH'] += os.pathsep + pathtools.tosys(bindir) |   956   os.environ['PATH'] += os.pathsep + pathtools.tosys(bindir) | 
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1096         # Last step |  1101         # Last step | 
|  1097         step_output = self.output |  1102         step_output = self.output | 
|  1098       else: |  1103       else: | 
|  1099         # Intermediate step |  1104         # Intermediate step | 
|  1100         if self.use_names_for_input: |  1105         if self.use_names_for_input: | 
|  1101           step_output = self.namegen.TempNameForInput(self.input, output_type) |  1106           step_output = self.namegen.TempNameForInput(self.input, output_type) | 
|  1102         else: |  1107         else: | 
|  1103           step_output = self.namegen.TempNameForOutput(output_type) |  1108           step_output = self.namegen.TempNameForOutput(output_type) | 
|  1104       callback(step_input, step_output, **extra) |  1109       callback(step_input, step_output, **extra) | 
|  1105       step_input = step_output |  1110       step_input = step_output | 
| OLD | NEW |