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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 chain.add(DoLTO, 'opt.' + bitcode_type) | 371 chain.add(DoLTO, 'opt.' + bitcode_type) |
372 elif env.getone('STRIP_MODE') != 'none': | 372 elif env.getone('STRIP_MODE') != 'none': |
373 chain.add(DoStrip, 'stripped.' + bitcode_type) | 373 chain.add(DoStrip, 'stripped.' + bitcode_type) |
374 | 374 |
375 if env.getbool('STATIC'): | 375 if env.getbool('STATIC'): |
376 # ABI simplification passes. We should not place arbitrary | 376 # ABI simplification passes. We should not place arbitrary |
377 # passes after '-expand-constant-expr' because they might | 377 # passes after '-expand-constant-expr' because they might |
378 # reintroduce ConstantExprs. However, '-expand-getelementptr' | 378 # reintroduce ConstantExprs. However, '-expand-getelementptr' |
379 # must follow '-expand-constant-expr' to expand the | 379 # must follow '-expand-constant-expr' to expand the |
380 # getelementptr instructions it creates. | 380 # getelementptr instructions it creates. |
381 passes = ['-expand-constant-expr', | 381 # We place '-strip-metadata' after optimization passes since |
| 382 # optimizations depend on the metadata. |
| 383 passes = ['-strip-metadata', |
| 384 '-expand-constant-expr', |
382 '-expand-getelementptr'] | 385 '-expand-getelementptr'] |
383 if (not env.getbool('DISABLE_ABI_CHECK') and | 386 if (not env.getbool('DISABLE_ABI_CHECK') and |
384 not env.getbool('ALLOW_CXX_EXCEPTIONS') and | 387 not env.getbool('ALLOW_CXX_EXCEPTIONS') and |
385 len(native_objects) == 0): | 388 len(native_objects) == 0): |
386 passes += ['-verify-pnaclabi-module', | 389 passes += ['-verify-pnaclabi-module', |
387 '-verify-pnaclabi-functions'] | 390 '-verify-pnaclabi-functions', |
| 391 # A flag for the above -verify-pnaclabi-* passes. |
| 392 '-pnaclabi-allow-debug-metadata'] |
388 chain.add(DoLLVMPasses(passes), | 393 chain.add(DoLLVMPasses(passes), |
389 'expand_features_after_opt.' + bitcode_type) | 394 'expand_features_after_opt.' + bitcode_type) |
390 else: | 395 else: |
391 chain = DriverChain('', output, tng) | 396 chain = DriverChain('', output, tng) |
392 | 397 |
393 # If -arch is also specified, invoke pnacl-translate afterwards. | 398 # If -arch is also specified, invoke pnacl-translate afterwards. |
394 if arch_flag_given: | 399 if arch_flag_given: |
395 env.set('NATIVE_OBJECTS', *native_objects) | 400 env.set('NATIVE_OBJECTS', *native_objects) |
396 chain.add(DoTranslate, native_type) | 401 chain.add(DoTranslate, native_type) |
397 | 402 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 -O<opt-level> Optimize output file | 539 -O<opt-level> Optimize output file |
535 -M, --print-map Print map file on standard output | 540 -M, --print-map Print map file on standard output |
536 --whole-archive Include all objects from following archives | 541 --whole-archive Include all objects from following archives |
537 --no-whole-archive Turn off --whole-archive | 542 --no-whole-archive Turn off --whole-archive |
538 -s, --strip-all Strip all symbols | 543 -s, --strip-all Strip all symbols |
539 -S, --strip-debug Strip debugging symbols | 544 -S, --strip-debug Strip debugging symbols |
540 --undefined SYMBOL Start with undefined reference to SYMBOL | 545 --undefined SYMBOL Start with undefined reference to SYMBOL |
541 | 546 |
542 -help | -h Output this help. | 547 -help | -h Output this help. |
543 """ | 548 """ |
OLD | NEW |