| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 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 # % tools/llvm/utman.sh driver | 7 # % tools/llvm/utman.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 # |
| 11 | 11 |
| 12 import driver_tools | 12 import driver_tools |
| 13 | 13 |
| 14 env = driver_tools.env | 14 env = driver_tools.env |
| 15 | 15 |
| 16 EXTRA_ENV = { | 16 EXTRA_ENV = { |
| 17 'INPUTS' : '', | 17 'INPUTS' : '', |
| 18 'OUTPUT' : '', | 18 'OUTPUT' : '', |
| 19 | 19 |
| 20 # Options | 20 # Options |
| 21 'DIAGNOSTIC' : '0', | 21 'DIAGNOSTIC' : '0', |
| 22 'ASPP_FLAGS': '-DNACL_LINUX=1', | 22 'ASPP_FLAGS': '-DNACL_LINUX=1', |
| 23 | 23 |
| 24 'AS_FLAGS_ARM' : '-mfpu=vfp -march=armv7-a', | 24 'AS_FLAGS_ARM' : '-mfpu=vfp -march=armv7-a', |
| 25 # BUG: http://code.google.com/p/nativeclient/issues/detail?id=1968 |
| 25 # once we can use llvm's ARM assembler we should use these flags | 26 # once we can use llvm's ARM assembler we should use these flags |
| 26 #'AS_FLAGS_ARM' : '-assemble -filetype=obj -arch=arm -triple=armv7a-nacl', | 27 #'AS_FLAGS_ARM' : '-assemble -filetype=obj -arch=arm -triple=armv7a-nacl', |
| 27 'AS_FLAGS_X8632' : '-assemble -filetype=obj -arch=x86 -triple=i686-nacl', | 28 'AS_FLAGS_X8632' : '-assemble -filetype=obj -arch=x86 -triple=i686-nacl', |
| 28 'AS_FLAGS_X8664' : '-assemble -filetype=obj -arch=x86-64 -triple=x86_64-nacl', | 29 'AS_FLAGS_X8664' : '-assemble -filetype=obj -arch=x86-64 -triple=x86_64-nacl', |
| 29 | 30 |
| 30 'RUN_BITCODE_AS' : '${LLVM_AS} ${input} -o ${output}', | 31 'RUN_BITCODE_AS' : '${LLVM_AS} ${input} -o ${output}', |
| 31 'RUN_NATIVE_AS' : '${AS_%ARCH%} ${AS_FLAGS_%ARCH%} ${input} -o ${output}', | 32 'RUN_NATIVE_AS' : '${AS_%ARCH%} ${AS_FLAGS_%ARCH%} ${input} -o ${output}', |
| 32 | 33 |
| 33 # NOTE: should we run the vanilla preprocessor instead? | 34 # NOTE: should we run the vanilla preprocessor instead? |
| 34 'RUN_PP' : '${CLANG} -E ${ASPP_FLAGS} ${input} -o ${output}' | 35 'RUN_PP' : '${CLANG} -E ${ASPP_FLAGS} ${input} -o ${output}' |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 driver_tools.RunWithLog("${RUN_BITCODE_AS}") | 115 driver_tools.RunWithLog("${RUN_BITCODE_AS}") |
| 115 else: | 116 else: |
| 116 # .s to .o | 117 # .s to .o |
| 117 driver_tools.RunWithLog("${RUN_NATIVE_AS}") | 118 driver_tools.RunWithLog("${RUN_NATIVE_AS}") |
| 118 env.pop() | 119 env.pop() |
| 119 return 0 | 120 return 0 |
| 120 | 121 |
| 121 | 122 |
| 122 if __name__ == "__main__": | 123 if __name__ == "__main__": |
| 123 driver_tools.DriverMain(main) | 124 driver_tools.DriverMain(main) |
| OLD | NEW |