| 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 """NEXE building script | 6 """NEXE building script |
| 7 | 7 |
| 8 This module will take a set of source files, include paths, library paths, and | 8 This module will take a set of source files, include paths, library paths, and |
| 9 additional arguments, and use them to build. | 9 additional arguments, and use them to build. |
| 10 """ | 10 """ |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 cmd_line = [bin_name, '-o', link_out, '-Wl,--as-needed'] | 586 cmd_line = [bin_name, '-o', link_out, '-Wl,--as-needed'] |
| 587 if not self.empty: | 587 if not self.empty: |
| 588 cmd_line += srcs | 588 cmd_line += srcs |
| 589 cmd_line += self.link_options | 589 cmd_line += self.link_options |
| 590 | 590 |
| 591 err = self.Run(cmd_line, link_out) | 591 err = self.Run(cmd_line, link_out) |
| 592 if err: | 592 if err: |
| 593 raise Error('FAILED with %d: %s' % (err, ' '.join(cmd_line))) | 593 raise Error('FAILED with %d: %s' % (err, ' '.join(cmd_line))) |
| 594 | 594 |
| 595 if self.tls_edit is not None: | 595 if self.tls_edit is not None: |
| 596 tls_edit_cmd = [self.tls_edit, link_out, out] | 596 tls_edit_cmd = [FixPath(self.tls_edit), link_out, out] |
| 597 tls_edit_err = self.Run(tls_edit_cmd, out) | 597 tls_edit_err = self.Run(tls_edit_cmd, out) |
| 598 if tls_edit_err: | 598 if tls_edit_err: |
| 599 raise Error('FAILED with %d: %s' % (err, ' '.join(tls_edit_cmd))) | 599 raise Error('FAILED with %d: %s' % (err, ' '.join(tls_edit_cmd))) |
| 600 | 600 |
| 601 return out | 601 return out |
| 602 | 602 |
| 603 # For now, only support translating a pexe, and not .o file(s) | 603 # For now, only support translating a pexe, and not .o file(s) |
| 604 def Translate(self, src): | 604 def Translate(self, src): |
| 605 """Translate a pexe to a nexe.""" | 605 """Translate a pexe to a nexe.""" |
| 606 out = self.TranslateOutputName() | 606 out = self.TranslateOutputName() |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 shutil.copy(objs[0], options.name) | 835 shutil.copy(objs[0], options.name) |
| 836 else: | 836 else: |
| 837 build.Generate(objs) | 837 build.Generate(objs) |
| 838 return 0 | 838 return 0 |
| 839 except Error as e: | 839 except Error as e: |
| 840 sys.stderr.write('%s\n' % e) | 840 sys.stderr.write('%s\n' % e) |
| 841 return 1 | 841 return 1 |
| 842 | 842 |
| 843 if __name__ == '__main__': | 843 if __name__ == '__main__': |
| 844 sys.exit(Main(sys.argv)) | 844 sys.exit(Main(sys.argv)) |
| OLD | NEW |