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