| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 # Add glibc/lib-<arch>/ to the search path. | 82 # Add glibc/lib-<arch>/ to the search path. |
| 83 # These are here to let the bitcode link find native objects | 83 # These are here to let the bitcode link find native objects |
| 84 # needed by the GLibC toolchain. | 84 # needed by the GLibC toolchain. |
| 85 # TODO(pdox): Remove these when we have bitcode .pso stubs for GlibC. | 85 # TODO(pdox): Remove these when we have bitcode .pso stubs for GlibC. |
| 86 'SEARCH_DIRS_NATIVE': '${LIBMODE_GLIBC ? ${LIBS_ARCH}/}', | 86 'SEARCH_DIRS_NATIVE': '${LIBMODE_GLIBC ? ${LIBS_ARCH}/}', |
| 87 | 87 |
| 88 'LIBS_ARCH' : '${LIBS_%ARCH%}', | 88 'LIBS_ARCH' : '${LIBS_%ARCH%}', |
| 89 'LIBS_ARM' : '${BASE_GLIBC}/lib-arm', | 89 'LIBS_ARM' : '${BASE_GLIBC}/lib-arm', |
| 90 'LIBS_X8632' : '${BASE_GLIBC}/lib-x86-32', | 90 'LIBS_X8632' : '${BASE_GLIBC}/lib-x86-32', |
| 91 'LIBS_X8664' : '${BASE_GLIBC}/lib-x86-64', | 91 'LIBS_X8664' : '${BASE_GLIBC}/lib-x86-64', |
| 92 'LIBS_MIPS32' : '${BASE_GLIBC}/lib-mips32', |
| 92 # HACK-END | 93 # HACK-END |
| 93 | 94 |
| 94 'LD_GOLD_OFORMAT' : '${LD_GOLD_OFORMAT_%ARCH%}', | 95 'LD_GOLD_OFORMAT' : '${LD_GOLD_OFORMAT_%ARCH%}', |
| 95 'LD_GOLD_OFORMAT_ARM' : 'elf32-littlearm', | 96 'LD_GOLD_OFORMAT_ARM' : 'elf32-littlearm', |
| 96 'LD_GOLD_OFORMAT_X8632' : 'elf32-nacl', | 97 'LD_GOLD_OFORMAT_X8632' : 'elf32-nacl', |
| 97 'LD_GOLD_OFORMAT_X8664' : 'elf64-nacl', | 98 'LD_GOLD_OFORMAT_X8664' : 'elf64-nacl', |
| 99 'LD_GOLD_OFORMAT_MIPS32' : 'elf32-tradlittlemips', |
| 98 | 100 |
| 99 'BCLD' : '${LD_GOLD}', | 101 'BCLD' : '${LD_GOLD}', |
| 100 'BCLD_FLAGS': '--native-client --oformat ${LD_GOLD_OFORMAT} -Ttext=0x20000 ' + | 102 'BCLD_FLAGS': '--native-client --oformat ${LD_GOLD_OFORMAT} -Ttext=0x20000 ' + |
| 101 '${!SHARED && !RELOCATABLE ? --undef-sym-check} ' + | 103 '${!SHARED && !RELOCATABLE ? --undef-sym-check} ' + |
| 102 '${GOLD_PLUGIN_ARGS} ${LD_FLAGS}', | 104 '${GOLD_PLUGIN_ARGS} ${LD_FLAGS}', |
| 103 'RUN_BCLD': ('${BCLD} ${BCLD_FLAGS} ${inputs} -o ${output}'), | 105 'RUN_BCLD': ('${BCLD} ${BCLD_FLAGS} ${inputs} -o ${output}'), |
| 104 } | 106 } |
| 105 | 107 |
| 106 def AddToBCLinkFlags(*args): | 108 def AddToBCLinkFlags(*args): |
| 107 env.append('LD_FLAGS', *args) | 109 env.append('LD_FLAGS', *args) |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 RunDriver('translate', args) | 437 RunDriver('translate', args) |
| 436 | 438 |
| 437 def LinkBC(inputs, output): | 439 def LinkBC(inputs, output): |
| 438 '''Input: a bunch of bc/o/lib input files | 440 '''Input: a bunch of bc/o/lib input files |
| 439 Output: a combined & optimized bitcode file | 441 Output: a combined & optimized bitcode file |
| 440 ''' | 442 ''' |
| 441 # Produce combined bitcode file | 443 # Produce combined bitcode file |
| 442 RunWithEnv('${RUN_BCLD}', | 444 RunWithEnv('${RUN_BCLD}', |
| 443 inputs=inputs, | 445 inputs=inputs, |
| 444 output=output) | 446 output=output) |
| OLD | NEW |