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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 Run(env.get('CC') + env.get('CC_FLAGS')) | 490 Run(env.get('CC') + env.get('CC_FLAGS')) |
491 return 0 | 491 return 0 |
492 | 492 |
493 unmatched = env.get('UNMATCHED') | 493 unmatched = env.get('UNMATCHED') |
494 if len(unmatched) > 0: | 494 if len(unmatched) > 0: |
495 UnrecognizedOption(*unmatched) | 495 UnrecognizedOption(*unmatched) |
496 | 496 |
497 # If -arch was given, we are compiling directly to native code | 497 # If -arch was given, we are compiling directly to native code |
498 compiling_to_native = GetArch() is not None | 498 compiling_to_native = GetArch() is not None |
499 | 499 |
500 if env.getbool('ALLOW_NATIVE') and not compiling_to_native: | 500 if env.getbool('ALLOW_NATIVE'): |
501 Log.Fatal("--pnacl-allow-native without -arch is not meaningful.") | 501 if not compiling_to_native: |
| 502 Log.Fatal("--pnacl-allow-native without -arch is not meaningful.") |
| 503 # For native/mixed links, also bring in the native libgcc to avoid link |
| 504 # failure if pre-translated native code needs functions from it. |
| 505 env.append('LD_FLAGS', env.eval('-L${LIBS_NATIVE_ARCH}')) |
| 506 env.append('STDLIBS', '-lgcc') |
| 507 |
502 | 508 |
503 if not env.get('STDLIB'): | 509 if not env.get('STDLIB'): |
504 # Default C++ Standard Library. | 510 # Default C++ Standard Library. |
505 SetStdLib('libc++') | 511 SetStdLib('libc++') |
506 | 512 |
507 inputs = env.get('INPUTS') | 513 inputs = env.get('INPUTS') |
508 output = env.getone('OUTPUT') | 514 output = env.getone('OUTPUT') |
509 | 515 |
510 if len(inputs) == 0: | 516 if len(inputs) == 0: |
511 if env.getbool('VERBOSE'): | 517 if env.getbool('VERBOSE'): |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 -g Generate complete debug information. | 790 -g Generate complete debug information. |
785 -gline-tables-only Generate debug line-information only | 791 -gline-tables-only Generate debug line-information only |
786 (allowing for stack traces). | 792 (allowing for stack traces). |
787 -flimit-debug-info Generate limited debug information. | 793 -flimit-debug-info Generate limited debug information. |
788 -save-temps Keep intermediate compilation results. | 794 -save-temps Keep intermediate compilation results. |
789 -v Verbose output / show commands. | 795 -v Verbose output / show commands. |
790 -h | --help Show this help. | 796 -h | --help Show this help. |
791 --help-full Show underlying clang driver's help message | 797 --help-full Show underlying clang driver's help message |
792 (warning: not all options supported). | 798 (warning: not all options supported). |
793 """ % (tool) | 799 """ % (tool) |
OLD | NEW |