OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium 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 """Tool for automatically creating .nmf files from .nexe/.pexe/.bc executables. | 6 """Tool for automatically creating .nmf files from .nexe/.pexe/.bc executables. |
7 | 7 |
8 As well as creating the nmf file this tool can also find and stage | 8 As well as creating the nmf file this tool can also find and stage |
9 any shared libraries dependencies that the executables might have. | 9 any shared libraries dependencies that the executables might have. |
10 """ | 10 """ |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 | 500 |
501 if not os.path.exists(objdump): | 501 if not os.path.exists(objdump): |
502 sys.stderr.write('WARNING: failed to find objdump in default ' | 502 sys.stderr.write('WARNING: failed to find objdump in default ' |
503 'location: %s' % objdump) | 503 'location: %s' % objdump) |
504 return None | 504 return None |
505 | 505 |
506 return objdump | 506 return objdump |
507 | 507 |
508 | 508 |
509 def GetDefaultLibPath(config): | 509 def GetDefaultLibPath(config): |
510 """Derive default library path to use when searching for shared | 510 """Derive default library path. |
511 objects. This currently include the toolchain library folders | 511 |
512 as well as the top level SDK lib folder and the naclports lib | 512 This path is used when searching for shared objects. This currently includes |
513 folder. We include both 32-bit and 64-bit library paths. | 513 the toolchain library folders and the top level SDK lib folder. |
514 """ | 514 """ |
515 sdk_root = GetSDKRoot() | 515 sdk_root = GetSDKRoot() |
516 | 516 |
517 osname = getos.GetPlatform() | 517 osname = getos.GetPlatform() |
518 libpath = [ | 518 libpath = [ |
519 # Core toolchain libraries | 519 # Core toolchain libraries |
520 'toolchain/%s_x86_glibc/x86_64-nacl/lib' % osname, | 520 'toolchain/%s_x86_glibc/x86_64-nacl/lib' % osname, |
521 'toolchain/%s_x86_glibc/x86_64-nacl/lib32' % osname, | 521 'toolchain/%s_x86_glibc/x86_64-nacl/lib32' % osname, |
522 'toolchain/%s_arm_glibc/arm-nacl/lib' % osname, | 522 'toolchain/%s_arm_glibc/arm-nacl/lib' % osname, |
523 # naclports installed libraries | 523 # user installed libraries (used by webports) |
524 'toolchain/%s_x86_glibc/x86_64-nacl/usr/lib' % osname, | 524 'toolchain/%s_x86_glibc/x86_64-nacl/usr/lib' % osname, |
525 'toolchain/%s_x86_glibc/i686-nacl/usr/lib' % osname, | 525 'toolchain/%s_x86_glibc/i686-nacl/usr/lib' % osname, |
526 'toolchain/%s_arm_glibc/arm-nacl/usr/lib' % osname, | 526 'toolchain/%s_arm_glibc/arm-nacl/usr/lib' % osname, |
527 # SDK bundle libraries | 527 # SDK bundle libraries |
528 'lib/glibc_x86_32/%s' % config, | 528 'lib/glibc_x86_32/%s' % config, |
529 'lib/glibc_x86_64/%s' % config, | 529 'lib/glibc_x86_64/%s' % config, |
530 'lib/glibc_arm/%s' % config, | 530 'lib/glibc_arm/%s' % config, |
531 # naclports bundle libraries | |
532 'ports/lib/glibc_x86_32/%s' % config, | |
533 'ports/lib/glibc_x86_64/%s' % config, | |
534 'ports/lib/glibc_arm/%s' % config, | |
535 ] | 531 ] |
536 | 532 |
537 # In some cases (e.g. ASAN, TSAN, STANDALONE) the name of the configuration | 533 # In some cases (e.g. ASAN, TSAN, STANDALONE) the name of the configuration |
538 # can be different to simply Debug or Release. For example 'msan_Release'. | 534 # can be different to simply Debug or Release. For example 'msan_Release'. |
539 # In this case we search for libraries first in this directory and then | 535 # In this case we search for libraries first in this directory and then |
540 # fall back to 'Release'. | 536 # fall back to 'Release'. |
541 if config not in ['Debug', 'Release']: | 537 if config not in ['Debug', 'Release']: |
542 config_fallback = 'Release' | 538 config_fallback = 'Release' |
543 if 'Debug' in config: | 539 if 'Debug' in config: |
544 config_fallback = 'Debug' | 540 config_fallback = 'Debug' |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 if __name__ == '__main__': | 703 if __name__ == '__main__': |
708 try: | 704 try: |
709 rtn = main(sys.argv[1:]) | 705 rtn = main(sys.argv[1:]) |
710 except Error, e: | 706 except Error, e: |
711 sys.stderr.write('%s: %s\n' % (os.path.basename(__file__), e)) | 707 sys.stderr.write('%s: %s\n' % (os.path.basename(__file__), e)) |
712 rtn = 1 | 708 rtn = 1 |
713 except KeyboardInterrupt: | 709 except KeyboardInterrupt: |
714 sys.stderr.write('%s: interrupted\n' % os.path.basename(__file__)) | 710 sys.stderr.write('%s: interrupted\n' % os.path.basename(__file__)) |
715 rtn = 1 | 711 rtn = 1 |
716 sys.exit(rtn) | 712 sys.exit(rtn) |
OLD | NEW |