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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 # Determine if we should build nexes compatible with the IRT | 25 # Determine if we should build nexes compatible with the IRT |
26 'USE_IRT' : '1', | 26 'USE_IRT' : '1', |
27 | 27 |
28 # Allow C++ exception handling in the pexe. | 28 # Allow C++ exception handling in the pexe. |
29 'ALLOW_CXX_EXCEPTIONS' : '0', | 29 'ALLOW_CXX_EXCEPTIONS' : '0', |
30 | 30 |
31 # Use the IRT shim by default. This can be disabled with an explicit | 31 # Use the IRT shim by default. This can be disabled with an explicit |
32 # flag (--noirtshim) or via -nostdlib. | 32 # flag (--noirtshim) or via -nostdlib. |
33 'USE_IRT_SHIM' : '${!SHARED ? 1 : 0}', | 33 'USE_IRT_SHIM' : '${!SHARED ? 1 : 0}', |
34 # Experimental mode exploring newlib as a shared library | |
35 'NEWLIB_SHARED_EXPERIMENT': '0', | |
36 | 34 |
37 # To simulate the sandboxed translator better and avoid user surprises, | 35 # To simulate the sandboxed translator better and avoid user surprises, |
38 # reject LLVM bitcode (non-finalized) by default, accepting only PNaCl | 36 # reject LLVM bitcode (non-finalized) by default, accepting only PNaCl |
39 # (finalized) bitcode. --allow-llvm-bitcode-input has to be passed | 37 # (finalized) bitcode. --allow-llvm-bitcode-input has to be passed |
40 # explicitly to override this. | 38 # explicitly to override this. |
41 'ALLOW_LLVM_BITCODE_INPUT': '0', | 39 'ALLOW_LLVM_BITCODE_INPUT': '0', |
42 | 40 |
43 # Flags for pnacl-nativeld | 41 # Flags for pnacl-nativeld |
44 'LD_FLAGS': '${STATIC ? -static} ${SHARED ? -shared}', | 42 'LD_FLAGS': '${STATIC ? -static} ${SHARED ? -shared}', |
45 | 43 |
(...skipping 19 matching lines...) Expand all Loading... |
65 'LD_ARGS_IRT_SHIM': '-l:libpnacl_irt_shim.a', | 63 'LD_ARGS_IRT_SHIM': '-l:libpnacl_irt_shim.a', |
66 'LD_ARGS_IRT_SHIM_DUMMY': '-l:libpnacl_irt_shim_dummy.a', | 64 'LD_ARGS_IRT_SHIM_DUMMY': '-l:libpnacl_irt_shim_dummy.a', |
67 | 65 |
68 'LD_ARGS_ENTRY': '--entry=__pnacl_start', | 66 'LD_ARGS_ENTRY': '--entry=__pnacl_start', |
69 | 67 |
70 # TODO(eliben): remove SHARED stuff altogether | 68 # TODO(eliben): remove SHARED stuff altogether |
71 'STATIC_CRTBEGIN' : '${ALLOW_CXX_EXCEPTIONS ? ' + | 69 'STATIC_CRTBEGIN' : '${ALLOW_CXX_EXCEPTIONS ? ' + |
72 '-l:crtbegin_for_eh.o : -l:crtbegin.o}', | 70 '-l:crtbegin_for_eh.o : -l:crtbegin.o}', |
73 'CRTBEGIN' : '${SHARED ? -l:crtbeginS.o : ${STATIC_CRTBEGIN}}', | 71 'CRTBEGIN' : '${SHARED ? -l:crtbeginS.o : ${STATIC_CRTBEGIN}}', |
74 'CRTEND' : '${SHARED ? -l:crtendS.o : -l:crtend.o}', | 72 'CRTEND' : '${SHARED ? -l:crtendS.o : -l:crtend.o}', |
75 # static and dynamic newlib images link against the static libgcc_eh | 73 'LIBGCC_EH': '${STATIC ? -l:libgcc_eh.a : -l:libgcc_s.so.1}', |
76 'LIBGCC_EH': '${STATIC || NEWLIB_SHARED_EXPERIMENT && !SHARED ? ' + | |
77 '-l:libgcc_eh.a : ' + | |
78 # NOTE: libgcc_s.so drags in "glibc.so" | |
79 # TODO(robertm): provide a "better" libgcc_s.so | |
80 ' ${NEWLIB_SHARED_EXPERIMENT ? : -l:libgcc_s.so.1}}', | |
81 | 74 |
82 'LD_ARGS_nostdlib': '-nostdlib ${ld_inputs}', | 75 'LD_ARGS_nostdlib': '-nostdlib ${ld_inputs}', |
83 | 76 |
84 # These are just the dependencies in the native link. | 77 # These are just the dependencies in the native link. |
85 'LD_ARGS_normal': | 78 'LD_ARGS_normal': |
86 '${CRTBEGIN} ${ld_inputs} ' + | 79 '${CRTBEGIN} ${ld_inputs} ' + |
87 '${USE_IRT_SHIM ? ${LD_ARGS_IRT_SHIM} : ${LD_ARGS_IRT_SHIM_DUMMY}} ' + | 80 '${USE_IRT_SHIM ? ${LD_ARGS_IRT_SHIM} : ${LD_ARGS_IRT_SHIM_DUMMY}} ' + |
88 '${STATIC ? --start-group} ' + | 81 '${STATIC ? --start-group} ' + |
89 '${USE_DEFAULTLIBS ? ${DEFAULTLIBS}} ' + | 82 '${USE_DEFAULTLIBS ? ${DEFAULTLIBS}} ' + |
90 '${STATIC ? --end-group} ' + | 83 '${STATIC ? --end-group} ' + |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 ( '-shared', "env.set('SHARED', '1')"), | 201 ( '-shared', "env.set('SHARED', '1')"), |
209 ( '-nostdlib', "env.set('STDLIB', '0')"), | 202 ( '-nostdlib', "env.set('STDLIB', '0')"), |
210 | 203 |
211 # Disables the default libraries. | 204 # Disables the default libraries. |
212 # This flag is needed for building libgcc_s.so. | 205 # This flag is needed for building libgcc_s.so. |
213 ( '-nodefaultlibs', "env.set('USE_DEFAULTLIBS', '0')"), | 206 ( '-nodefaultlibs', "env.set('USE_DEFAULTLIBS', '0')"), |
214 | 207 |
215 ( '--noirt', "env.set('USE_IRT', '0')\n" | 208 ( '--noirt', "env.set('USE_IRT', '0')\n" |
216 "env.append('LD_FLAGS', '--noirt')"), | 209 "env.append('LD_FLAGS', '--noirt')"), |
217 ( '--noirtshim', "env.set('USE_IRT_SHIM', '0')"), | 210 ( '--noirtshim', "env.set('USE_IRT_SHIM', '0')"), |
218 ( '--newlib-shared-experiment', "env.set('NEWLIB_SHARED_EXPERIMENT', '1')"), | |
219 ( '(--pnacl-nativeld=.+)', "env.append('LD_FLAGS', $0)"), | 211 ( '(--pnacl-nativeld=.+)', "env.append('LD_FLAGS', $0)"), |
220 | 212 |
221 # Allowing C++ exception handling causes a specific set of native objects to | 213 # Allowing C++ exception handling causes a specific set of native objects to |
222 # get linked into the nexe. | 214 # get linked into the nexe. |
223 ( '--pnacl-allow-exceptions', "env.set('ALLOW_CXX_EXCEPTIONS', '1')"), | 215 ( '--pnacl-allow-exceptions', "env.set('ALLOW_CXX_EXCEPTIONS', '1')"), |
224 | 216 |
225 ( '--allow-llvm-bitcode-input', "env.set('ALLOW_LLVM_BITCODE_INPUT', '1')"), | 217 ( '--allow-llvm-bitcode-input', "env.set('ALLOW_LLVM_BITCODE_INPUT', '1')"), |
226 | 218 |
227 ( '-rpath-link=(.+)', "env.append('LD_FLAGS', '-L'+$0)"), | 219 ( '-rpath-link=(.+)', "env.append('LD_FLAGS', '-L'+$0)"), |
228 | 220 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 | 480 |
489 ADVANCED OPTIONS: | 481 ADVANCED OPTIONS: |
490 -mattr=<+feat1,-feat2> Toggle specific cpu features on and off. | 482 -mattr=<+feat1,-feat2> Toggle specific cpu features on and off. |
491 -mcpu=<cpu-name> Target a specific cpu type. Tunes code as well as | 483 -mcpu=<cpu-name> Target a specific cpu type. Tunes code as well as |
492 turns cpu features on and off. | 484 turns cpu features on and off. |
493 -S Generate native assembly only. | 485 -S Generate native assembly only. |
494 -c Generate native object file only. | 486 -c Generate native object file only. |
495 --pnacl-sb Use the translator which runs inside the NaCl sandbox. | 487 --pnacl-sb Use the translator which runs inside the NaCl sandbox. |
496 -O[0-3] Change translation-time optimization level. | 488 -O[0-3] Change translation-time optimization level. |
497 """ | 489 """ |
OLD | NEW |