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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 '${LIBMODE_NEWLIB ? -l:libcrt_platform.a} ', | 93 '${LIBMODE_NEWLIB ? -l:libcrt_platform.a} ', |
94 | 94 |
95 # Determine whether or not to use bitcode metadata to generate .so stubs | 95 # Determine whether or not to use bitcode metadata to generate .so stubs |
96 # for the final link. | 96 # for the final link. |
97 'USE_META': '0', | 97 'USE_META': '0', |
98 | 98 |
99 'TRIPLE' : '${TRIPLE_%ARCH%}', | 99 'TRIPLE' : '${TRIPLE_%ARCH%}', |
100 'TRIPLE_ARM' : 'armv7a-none-nacl-gnueabi', | 100 'TRIPLE_ARM' : 'armv7a-none-nacl-gnueabi', |
101 'TRIPLE_X8632': 'i686-none-nacl-gnu', | 101 'TRIPLE_X8632': 'i686-none-nacl-gnu', |
102 'TRIPLE_X8664': 'x86_64-none-nacl-gnu', | 102 'TRIPLE_X8664': 'x86_64-none-nacl-gnu', |
| 103 'TRIPLE_MIPS32': 'mipsel-none-nacl-gnu', |
103 | 104 |
104 'LLC_FLAGS_COMMON': '${PIC ? -relocation-model=pic} ' + | 105 'LLC_FLAGS_COMMON': '${PIC ? -relocation-model=pic} ' + |
105 # -force-tls-non-pic makes the code generator (llc) | 106 # -force-tls-non-pic makes the code generator (llc) |
106 # do the work that would otherwise be done by | 107 # do the work that would otherwise be done by |
107 # linker rewrites which are quite messy in the nacl | 108 # linker rewrites which are quite messy in the nacl |
108 # case and hence have not been implemented in gold | 109 # case and hence have not been implemented in gold |
109 '${PIC && !SHARED ? -force-tls-non-pic} ' + | 110 '${PIC && !SHARED ? -force-tls-non-pic} ' + |
110 # this translates the pexe one function at a time | 111 # this translates the pexe one function at a time |
111 # which is also what the streaming translation does | 112 # which is also what the streaming translation does |
112 '-reduce-memory-footprint', | 113 '-reduce-memory-footprint', |
113 | 114 |
114 | 115 |
115 'LLC_FLAGS_ARM' : | 116 'LLC_FLAGS_ARM' : |
116 ('-arm-reserve-r9 -sfi-disable-cp ' + | 117 ('-arm-reserve-r9 -sfi-disable-cp ' + |
117 '-sfi-load -sfi-store -sfi-stack -sfi-branch -sfi-data ' + | 118 '-sfi-load -sfi-store -sfi-stack -sfi-branch -sfi-data ' + |
118 '-no-inline-jumptables -float-abi=hard'), | 119 '-no-inline-jumptables -float-abi=hard'), |
119 | 120 |
120 'LLC_FLAGS_X8632' : '', | 121 'LLC_FLAGS_X8632' : '', |
121 'LLC_FLAGS_X8664' : '', | 122 'LLC_FLAGS_X8664' : '', |
122 | 123 |
| 124 'LLC_FLAGS_MIPS32': '-sfi-load -sfi-store -sfi-stack -sfi-branch -sfi-data', |
| 125 |
123 # LLC flags which set the target and output type. | 126 # LLC flags which set the target and output type. |
124 # These are handled separately by libLTO. | 127 # These are handled separately by libLTO. |
125 'LLC_FLAGS_TARGET' : '-mcpu=${LLC_MCPU} ' + | 128 'LLC_FLAGS_TARGET' : '-mcpu=${LLC_MCPU} ' + |
126 '-mtriple=${TRIPLE} ' + | 129 '-mtriple=${TRIPLE} ' + |
127 '-filetype=${filetype}', | 130 '-filetype=${filetype}', |
128 # Additional non-default flags go here. | 131 # Additional non-default flags go here. |
129 'LLC_FLAGS_EXTRA' : '', | 132 'LLC_FLAGS_EXTRA' : '', |
130 | 133 |
131 # slower translation == faster code | 134 # slower translation == faster code |
132 'LLC_FLAGS_SLOW': | 135 'LLC_FLAGS_SLOW': |
(...skipping 22 matching lines...) Expand all Loading... |
155 'LLC_FLAGS_FAST_X8664': | 158 'LLC_FLAGS_FAST_X8664': |
156 '-O1 ' + | 159 '-O1 ' + |
157 # broken | 160 # broken |
158 # '-fast-isel ' + | 161 # '-fast-isel ' + |
159 '-tail-merge-threshold=20', | 162 '-tail-merge-threshold=20', |
160 'LLC_FLAGS_FAST_ARM': | 163 'LLC_FLAGS_FAST_ARM': |
161 # due to slow turn around times ARM settings have not been explored in depth | 164 # due to slow turn around times ARM settings have not been explored in depth |
162 # '-O2 ' + | 165 # '-O2 ' + |
163 '-fast-isel ' + | 166 '-fast-isel ' + |
164 '-tail-merge-threshold=20', | 167 '-tail-merge-threshold=20', |
| 168 'LLC_FLAGS_FAST_MIPS32': '-fast-isel -tail-merge-threshold=20', |
165 | 169 |
166 'LLC_FLAGS': '${LLC_FLAGS_TARGET} ' + | 170 'LLC_FLAGS': '${LLC_FLAGS_TARGET} ' + |
167 '${LLC_FLAGS_COMMON} ' + | 171 '${LLC_FLAGS_COMMON} ' + |
168 '${LLC_FLAGS_%ARCH%} ' + | 172 '${LLC_FLAGS_%ARCH%} ' + |
169 '${LLC_FLAGS_EXTRA} ' + | 173 '${LLC_FLAGS_EXTRA} ' + |
170 '${FAST_TRANSLATION ? ${LLC_FLAGS_FAST} : ${LLC_FLAGS_SLOW}}', | 174 '${FAST_TRANSLATION ? ${LLC_FLAGS_FAST} : ${LLC_FLAGS_SLOW}}', |
171 | 175 |
172 # CPU that is representative of baseline feature requirements for NaCl | 176 # CPU that is representative of baseline feature requirements for NaCl |
173 # and/or chrome. We may want to make this more like "-mtune" | 177 # and/or chrome. We may want to make this more like "-mtune" |
174 # by specifying both "-mcpu=X" and "-mattr=+feat1,-feat2,...". | 178 # by specifying both "-mcpu=X" and "-mattr=+feat1,-feat2,...". |
175 # Note: this may be different from the in-browser translator, which may | 179 # Note: this may be different from the in-browser translator, which may |
176 # do auto feature detection based on CPUID, but constrained by what is | 180 # do auto feature detection based on CPUID, but constrained by what is |
177 # accepted by NaCl validators. | 181 # accepted by NaCl validators. |
178 'LLC_MCPU' : '${LLC_MCPU_%ARCH%}', | 182 'LLC_MCPU' : '${LLC_MCPU_%ARCH%}', |
179 'LLC_MCPU_ARM' : 'cortex-a8', | 183 'LLC_MCPU_ARM' : 'cortex-a8', |
180 'LLC_MCPU_X8632' : 'pentium4', | 184 'LLC_MCPU_X8632' : 'pentium4', |
181 'LLC_MCPU_X8664' : 'core2', | 185 'LLC_MCPU_X8664' : 'core2', |
| 186 'LLC_MCPU_MIPS32' : 'mips32r2', |
182 | 187 |
183 # Note: this is only used in the unsandboxed case | 188 # Note: this is only used in the unsandboxed case |
184 'RUN_LLC' : '${LLVM_LLC} ${LLC_FLAGS} ${input} -o ${output} ' + | 189 'RUN_LLC' : '${LLVM_LLC} ${LLC_FLAGS} ${input} -o ${output} ' + |
185 '-metadata-text ${output}.meta', | 190 '-metadata-text ${output}.meta', |
186 # Rate in bits/sec to stream the bitcode from sel_universal over SRPC | 191 # Rate in bits/sec to stream the bitcode from sel_universal over SRPC |
187 # for testing. Defaults to 1Gbps (effectively unlimited). | 192 # for testing. Defaults to 1Gbps (effectively unlimited). |
188 # If 0, use the non-streaming file-descriptor codepath. | 193 # If 0, use the non-streaming file-descriptor codepath. |
189 'BITCODE_STREAM_RATE' : '1000000000', | 194 'BITCODE_STREAM_RATE' : '1000000000', |
190 } | 195 } |
191 | 196 |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 Portable executable (.pexe) -> NaCl ELF executable (.nexe) | 604 Portable executable (.pexe) -> NaCl ELF executable (.nexe) |
600 | 605 |
601 ADVANCED OPTIONS: | 606 ADVANCED OPTIONS: |
602 -mattr=<+feat1,-feat2> Toggle specific cpu features on and off. | 607 -mattr=<+feat1,-feat2> Toggle specific cpu features on and off. |
603 -mcpu=<cpu-name> Target a specific cpu type. Tunes code as well as | 608 -mcpu=<cpu-name> Target a specific cpu type. Tunes code as well as |
604 turns cpu features on and off. | 609 turns cpu features on and off. |
605 -S Generate native assembly only. | 610 -S Generate native assembly only. |
606 -c Generate native object file only. | 611 -c Generate native object file only. |
607 --pnacl-sb Use the translator which runs inside the NaCl sandbox. | 612 --pnacl-sb Use the translator which runs inside the NaCl sandbox. |
608 """ | 613 """ |
OLD | NEW |